aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2006-12-05 22:35:30 +0000
committerKim F. Storm2006-12-05 22:35:30 +0000
commitfc36357836a4151a1d1b46b2ad466d417f29980d (patch)
tree54699f35ee721c1ccbe6f8ab00d2f9f2d024e2f3
parent14b1e13534bc63cef6bacd8552a2c992ad86e007 (diff)
downloademacs-fc36357836a4151a1d1b46b2ad466d417f29980d.tar.gz
emacs-fc36357836a4151a1d1b46b2ad466d417f29980d.zip
(cua-paste-pop-rotate-temporarily): Doc fix.
(cua-paste-pop): Rework last change for cua-paste-pop-rotate-temporarily, so first M-y and C-y works alike, pasting the head of the kill-ring, and prefix arg C-u M-y inserts the text inserted by the last M-y command.
-rw-r--r--lisp/emulation/cua-base.el27
1 files changed, 14 insertions, 13 deletions
diff --git a/lisp/emulation/cua-base.el b/lisp/emulation/cua-base.el
index 6eabed45d4e..d90d01c7879 100644
--- a/lisp/emulation/cua-base.el
+++ b/lisp/emulation/cua-base.el
@@ -368,11 +368,11 @@ managers, so try setting this to nil, if prefix override doesn't work."
368 368
369(defcustom cua-paste-pop-rotate-temporarily nil 369(defcustom cua-paste-pop-rotate-temporarily nil
370 "*If non-nil, \\[cua-paste-pop] only rotates the kill-ring temporarily. 370 "*If non-nil, \\[cua-paste-pop] only rotates the kill-ring temporarily.
371This means that \\[cua-paste] always inserts the most recent kill, while one or 371This means that both \\[yank] and the first \\[yank-pop] in a sequence always insert
372more \\[cua-paste-pop]'s immediately following it will replace the previous text 372the most recently killed text. Each immediately following \\[cua-paste-pop] replaces
373with the next older element on the `kill-ring'. If \\[cua-paste-pop] is used after 373the previous text with the next older element on the `kill-ring'.
374any other command, it will insert the same element from the `kill-ring' as last 374With prefix arg, \\[universal-argument] \\[yank-pop] inserts the same text as the most
375time it was used." 375recent \\[yank-pop] (or \\[yank]) command."
376 :type 'boolean 376 :type 'boolean
377 :group 'cua) 377 :group 'cua)
378 378
@@ -935,9 +935,11 @@ If global mark is active, copy from register or one character."
935;; C-y M-y M-y => only rotates kill ring temporarily, 935;; C-y M-y M-y => only rotates kill ring temporarily,
936;; so next C-y yanks what previous C-y yanked, 936;; so next C-y yanks what previous C-y yanked,
937;; 937;;
938;; But: After another command, M-y remembers the temporary 938;; M-y M-y M-y => equivalent to C-y M-y M-y
939;;
940;; But: After another command, C-u M-y remembers the temporary
939;; kill-ring position, so 941;; kill-ring position, so
940;; M-y => yanks what the last M-y yanked 942;; C-u M-y => yanks what the last M-y yanked
941;; 943;;
942 944
943(defvar cua-paste-pop-count nil) 945(defvar cua-paste-pop-count nil)
@@ -962,18 +964,17 @@ behaviour, see `cua-paste-pop-rotate-temporarily'."
962 (setq cua-paste-pop-count rotate) 964 (setq cua-paste-pop-count rotate)
963 (setq last-command 'yank) 965 (setq last-command 'yank)
964 (yank-pop cua-paste-pop-count)) 966 (yank-pop cua-paste-pop-count))
965 ((eq last-command 'cua-paste-pop) 967 ((and (eq last-command 'cua-paste-pop) (not (consp arg)))
966 (unless (consp arg) 968 (setq cua-paste-pop-count (+ cua-paste-pop-count rotate))
967 (setq cua-paste-pop-count (+ cua-paste-pop-count rotate)))
968 (setq last-command 'yank) 969 (setq last-command 'yank)
969 (yank-pop cua-paste-pop-count)) 970 (yank-pop cua-paste-pop-count))
970 (t 971 (t
971 (setq cua-paste-pop-count (+ cua-paste-pop-count rotate -1)) 972 (setq cua-paste-pop-count
973 (if (consp arg) (+ cua-paste-pop-count rotate -1) 1))
972 (yank (1+ cua-paste-pop-count))))) 974 (yank (1+ cua-paste-pop-count)))))
973 ;; Undo rotating the kill-ring, so next C-y will 975 ;; Undo rotating the kill-ring, so next C-y will
974 ;; yank the original head. 976 ;; yank the original head.
975 (unless (consp arg) 977 (setq kill-ring-yank-pointer kill-ring)
976 (setq kill-ring-yank-pointer kill-ring))
977 (setq this-command 'cua-paste-pop)))) 978 (setq this-command 'cua-paste-pop))))
978 979
979(defun cua-exchange-point-and-mark (arg) 980(defun cua-exchange-point-and-mark (arg)