emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/delsel.el,v


From: Juri Linkov
Subject: [Emacs-diffs] Changes to emacs/lisp/delsel.el,v
Date: Sun, 15 Jul 2007 19:55:33 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Juri Linkov <jurta>     07/07/15 19:55:33

Index: delsel.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/delsel.el,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -b -r1.38 -r1.39
--- delsel.el   21 Jan 2007 03:53:12 -0000      1.38
+++ delsel.el   15 Jul 2007 19:55:32 -0000      1.39
@@ -87,12 +87,16 @@
          (cond ((eq type 'kill)
                 (delete-active-region t))
                ((eq type 'yank)
-                ;; Before a yank command,
-                ;; make sure we don't yank the same region
-                ;; that we are going to delete.
-                ;; That would make yank a no-op.
-                (when (string= (buffer-substring-no-properties (point) (mark))
+                ;; Before a yank command, make sure we don't yank the
+                ;; head of the kill-ring that really comes from the
+                ;; currently active region we are going to delete
+                ;; (when last-command is one that uses copy-region-as-kill
+                ;; or kill-new).  That would make yank a no-op.
+                (when (and (string= (buffer-substring-no-properties (point) 
(mark))
                                (car kill-ring))
+                           (memq last-command
+                                 '(mouse-set-region mouse-drag-region
+                                   mouse-save-then-kill 
mouse-secondary-save-then-kill)))
                   (current-kill 1))
                 (delete-active-region))
                ((eq type 'supersede)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]