diff options
| author | Juri Linkov | 2007-07-15 19:58:18 +0000 |
|---|---|---|
| committer | Juri Linkov | 2007-07-15 19:58:18 +0000 |
| commit | 0aeeaa263edb1baacae67cb9332cce4dc6864d2f (patch) | |
| tree | 52753053a18f718d90b9b1da61ab15552750e1b4 | |
| parent | 195d88f474f26dee7db29e240a5546262c97ff43 (diff) | |
| download | emacs-0aeeaa263edb1baacae67cb9332cce4dc6864d2f.tar.gz emacs-0aeeaa263edb1baacae67cb9332cce4dc6864d2f.zip | |
(cua-paste): Before a yank command,
check also whether last-command is one of mouse-save-then-kill,
mouse-secondary-save-then-kill, mouse-set-region, mouse-drag-region.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/emulation/cua-base.el | 15 |
2 files changed, 17 insertions, 5 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 29e342f94ea..f880e6899e9 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2007-07-15 Juri Linkov <juri@jurta.org> | ||
| 2 | |||
| 3 | * delsel.el (delete-selection-pre-hook): | ||
| 4 | * emulation/cua-base.el (cua-paste): Before a yank command, | ||
| 5 | check also whether last-command is one of mouse-save-then-kill, | ||
| 6 | mouse-secondary-save-then-kill, mouse-set-region, mouse-drag-region. | ||
| 7 | |||
| 1 | 2007-07-15 Michael Albinus <albinus@localhost> | 8 | 2007-07-15 Michael Albinus <albinus@localhost> |
| 2 | 9 | ||
| 3 | * recentf.el (recentf-keep-default-predicate): New defun. | 10 | * recentf.el (recentf-keep-default-predicate): New defun. |
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el index 653597fb83b..b9cbf0118b4 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." | |||
| 898 | (t | 898 | (t |
| 899 | ;; Must save register here, since delete may override reg 0. | 899 | ;; Must save register here, since delete may override reg 0. |
| 900 | (if mark-active | 900 | (if mark-active |
| 901 | ;; Before a yank command, make sure we don't yank | ||
| 902 | ;; the same region that we are going to delete. | ||
| 903 | ;; That would make yank a no-op. | ||
| 904 | (if cua--rectangle | 901 | (if cua--rectangle |
| 905 | (progn | 902 | (progn |
| 906 | (goto-char (min (mark) (point))) | 903 | (goto-char (min (mark) (point))) |
| @@ -908,8 +905,16 @@ If global mark is active, copy from register or one character." | |||
| 908 | (setq paste-lines (cua--delete-rectangle)) | 905 | (setq paste-lines (cua--delete-rectangle)) |
| 909 | (if (= paste-lines 1) | 906 | (if (= paste-lines 1) |
| 910 | (setq paste-lines nil))) ;; paste all | 907 | (setq paste-lines nil))) ;; paste all |
| 911 | (if (string= (filter-buffer-substring (point) (mark)) | 908 | ;; Before a yank command, make sure we don't yank the |
| 912 | (car kill-ring)) | 909 | ;; head of the kill-ring that really comes from the |
| 910 | ;; currently active region we are going to delete | ||
| 911 | ;; (when last-command is one that uses copy-region-as-kill | ||
| 912 | ;; or kill-new). That would make yank a no-op. | ||
| 913 | (if (and (string= (filter-buffer-substring (point) (mark)) | ||
| 914 | (car kill-ring)) | ||
| 915 | (memq last-command | ||
| 916 | '(mouse-set-region mouse-drag-region | ||
| 917 | mouse-save-then-kill mouse-secondary-save-then-kill))) | ||
| 913 | (current-kill 1)) | 918 | (current-kill 1)) |
| 914 | (cua-delete-region))) | 919 | (cua-delete-region))) |
| 915 | (cond | 920 | (cond |