diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-08-08 22:18:50 -0400 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2012-08-08 22:18:50 -0400 |
commit | 5d65606a7e7360077b9946c5e9a3359d5318d4b3 (patch) | |
tree | 412a589fed9b327ac83343ab259042638144c8ac | |
parent | cc92c454ade571f06d04a7578139b561c799b204 (diff) | |
download | emacs-5d65606a7e7360077b9946c5e9a3359d5318d4b3.tar.gz |
* lisp/delsel.el (delete-selection-pre-hook): Don't propagate the
file-supersession signals.
Fixes: debbugs:12161
-rw-r--r-- | lisp/ChangeLog | 5 | ||||
-rw-r--r-- | lisp/delsel.el | 14 |
2 files changed, 12 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f1039adc111..5edb41db100 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2012-08-09 Stefan Monnier <monnier@iro.umontreal.ca> + + * delsel.el (delete-selection-pre-hook): Don't propagate the + file-supersession signals (bug#12161). + 2012-08-08 Stefan Monnier <monnier@iro.umontreal.ca> * emacs-lisp/cl.el (cl-map-keymap-recursively, cl-map-intervals) diff --git a/lisp/delsel.el b/lisp/delsel.el index d6441123e04..a6435672201 100644 --- a/lisp/delsel.el +++ b/lisp/delsel.el @@ -89,7 +89,8 @@ any selection." ;; head of the kill-ring that really comes from the ;; currently active region we are going to delete. ;; That would make yank a no-op. - (when (and (string= (buffer-substring-no-properties (point) (mark)) + (when (and (string= (buffer-substring-no-properties + (point) (mark)) (car kill-ring)) (fboundp 'mouse-region-match) (mouse-region-match)) @@ -102,16 +103,15 @@ any selection." (setq this-command 'ignore)))) (type (delete-active-region) - (if (and overwrite-mode (eq this-command 'self-insert-command)) + (if (and overwrite-mode + (eq this-command 'self-insert-command)) (let ((overwrite-mode nil)) - (self-insert-command (prefix-numeric-value current-prefix-arg)) + (self-insert-command + (prefix-numeric-value current-prefix-arg)) (setq this-command 'ignore))))) - (file-supersession ;; If ask-user-about-supersession-threat signals an error, ;; stop safe_run_hooks from clearing out pre-command-hook. - (and (eq inhibit-quit 'pre-command-hook) - (setq inhibit-quit 'delete-selection-dummy)) - (signal 'file-supersession (cdr data))) + (file-supersession (message "%s" (cadr data)) (ding)) (text-read-only ;; This signal may come either from `delete-active-region' or ;; `self-insert-command' (when `overwrite-mode' is non-nil). |