aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2007-08-21 20:04:51 +0000
committerJuri Linkov2007-08-21 20:04:51 +0000
commit67755cc4839b19875f9cf8ae5b5c48ea81b6649e (patch)
tree1860e57d3e264b02e843d018bbb1247da7bdff3f
parente255d6b0a1210d8f4fc6b2bff814ad39c658b81e (diff)
downloademacs-67755cc4839b19875f9cf8ae5b5c48ea81b6649e.tar.gz
emacs-67755cc4839b19875f9cf8ae5b5c48ea81b6649e.zip
(delete-selection-pre-hook): Use `mouse-region-match' instead of checking last-command.
-rw-r--r--lisp/delsel.el9
1 files changed, 3 insertions, 6 deletions
diff --git a/lisp/delsel.el b/lisp/delsel.el
index 8d6e6ea97d2..b4ae7965a3f 100644
--- a/lisp/delsel.el
+++ b/lisp/delsel.el
@@ -89,14 +89,11 @@ any selection."
89 ((eq type 'yank) 89 ((eq type 'yank)
90 ;; Before a yank command, make sure we don't yank the 90 ;; Before a yank command, make sure we don't yank the
91 ;; head of the kill-ring that really comes from the 91 ;; head of the kill-ring that really comes from the
92 ;; currently active region we are going to delete 92 ;; currently active region we are going to delete.
93 ;; (when last-command is one that uses copy-region-as-kill 93 ;; That would make yank a no-op.
94 ;; or kill-new). That would make yank a no-op.
95 (when (and (string= (buffer-substring-no-properties (point) (mark)) 94 (when (and (string= (buffer-substring-no-properties (point) (mark))
96 (car kill-ring)) 95 (car kill-ring))
97 (memq last-command 96 (mouse-region-match))
98 '(mouse-set-region mouse-drag-region
99 mouse-save-then-kill mouse-secondary-save-then-kill)))
100 (current-kill 1)) 97 (current-kill 1))
101 (delete-active-region)) 98 (delete-active-region))
102 ((eq type 'supersede) 99 ((eq type 'supersede)