summaryrefslogtreecommitdiff
path: root/lisp/emulation/cua-base.el
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>2007-07-24 01:25:28 +0000
committerMiles Bader <miles@gnu.org>2007-07-24 01:25:28 +0000
commit492d9f3e3ccd2b640958e840caa451e9e04e86db (patch)
treec87779daf272535b621216ef05179fa48102e57e /lisp/emulation/cua-base.el
parent7eb1e4534e88a32fe5e549e630fdabf3e062be2b (diff)
parent1e8995158740b15936887264a3d7183beb5c51d9 (diff)
downloademacs-492d9f3e3ccd2b640958e840caa451e9e04e86db.tar.gz
Merge from emacs--devo--0
Patches applied: * emacs--devo--0 (patch 814-823) - Update from CVS - Merge from emacs--rel--22 * emacs--rel--22 (patch 59-69) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 237-238) - Update from CVS Revision: emacs@sv.gnu.org/emacs--multi-tty--0--patch-26
Diffstat (limited to 'lisp/emulation/cua-base.el')
-rw-r--r--lisp/emulation/cua-base.el15
1 files changed, 10 insertions, 5 deletions
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index e458c5d7353..da0ace34404 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -898,9 +898,6 @@ If global mark is active, copy from register or one character."
(t
;; Must save register here, since delete may override reg 0.
(if mark-active
- ;; 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.
(if cua--rectangle
(progn
(goto-char (min (mark) (point)))
@@ -908,8 +905,16 @@ If global mark is active, copy from register or one character."
(setq paste-lines (cua--delete-rectangle))
(if (= paste-lines 1)
(setq paste-lines nil))) ;; paste all
- (if (string= (filter-buffer-substring (point) (mark))
- (car kill-ring))
+ ;; 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.
+ (if (and (string= (filter-buffer-substring (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))
(cua-delete-region)))
(cond