/[emacs]/emacs/lisp/delsel.el
ViewVC logotype

Diff of /emacs/lisp/delsel.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.28 by gerd, Tue Jul 31 11:36:09 2001 UTC revision 1.29 by rms, Mon Nov 19 06:21:11 2001 UTC
# Line 84  any selection." Line 84  any selection."
84               (not buffer-read-only))               (not buffer-read-only))
85      (let ((type (and (symbolp this-command)      (let ((type (and (symbolp this-command)
86                       (get this-command 'delete-selection))))                       (get this-command 'delete-selection))))
87        (cond ((eq type 'kill)        (condition-case data
88               (delete-active-region t))            (cond ((eq type 'kill)
89              ((eq type 'yank)                   (delete-active-region t))
90               ;; Before a yank command,                  ((eq type 'yank)
91               ;; make sure we don't yank the same region                   ;; Before a yank command,
92               ;; that we are going to delete.                   ;; make sure we don't yank the same region
93               ;; That would make yank a no-op.                   ;; that we are going to delete.
94               (when (string= (buffer-substring-no-properties (point) (mark))                   ;; That would make yank a no-op.
95                              (car kill-ring))                   (when (string= (buffer-substring-no-properties (point) (mark))
96                 (current-kill 1))                                  (car kill-ring))
97               (delete-active-region))                     (current-kill 1))
98              ((eq type 'supersede)                   (delete-active-region))
99               (let ((empty-region (= (point) (mark))))                  ((eq type 'supersede)
100                 (delete-active-region)                   (let ((empty-region (= (point) (mark))))
101                 (unless empty-region                     (delete-active-region)
102                   (setq this-command 'ignore))))                     (unless empty-region
103              (type                       (setq this-command 'ignore))))
104               (delete-active-region))))))                  (type
105                     (delete-active-region)))
106            (file-supersession
107             ;; If ask-user-about-supersession-threat signals an error,
108             ;; stop safe_run_hooks from clearing out pre-command-hook.
109             (and (eq inhibit-quit 'pre-command-hook)
110                  (setq inhibit-quit 'delete-selection-dummy))
111             (signal 'file-supersession (cdr data)))))))
112    
113  (put 'self-insert-command 'delete-selection t)  (put 'self-insert-command 'delete-selection t)
114  (put 'self-insert-iso 'delete-selection t)  (put 'self-insert-iso 'delete-selection t)

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26