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) |