aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/delsel.el16
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/delsel.el b/lisp/delsel.el
index 7028bad9ad4..09b30d3e874 100644
--- a/lisp/delsel.el
+++ b/lisp/delsel.el
@@ -87,12 +87,16 @@ any selection."
87 (cond ((eq type 'kill) 87 (cond ((eq type 'kill)
88 (delete-active-region t)) 88 (delete-active-region t))
89 ((eq type 'yank) 89 ((eq type 'yank)
90 ;; Before a yank command, 90 ;; Before a yank command, make sure we don't yank the
91 ;; make sure we don't yank the same region 91 ;; head of the kill-ring that really comes from the
92 ;; that we are going to delete. 92 ;; currently active region we are going to delete
93 ;; That would make yank a no-op. 93 ;; (when last-command is one that uses copy-region-as-kill
94 (when (string= (buffer-substring-no-properties (point) (mark)) 94 ;; or kill-new). That would make yank a no-op.
95 (car kill-ring)) 95 (when (and (string= (buffer-substring-no-properties (point) (mark))
96 (car kill-ring))
97 (memq last-command
98 '(mouse-set-region mouse-drag-region
99 mouse-save-then-kill mouse-secondary-save-then-kill)))
96 (current-kill 1)) 100 (current-kill 1))
97 (delete-active-region)) 101 (delete-active-region))
98 ((eq type 'supersede) 102 ((eq type 'supersede)