aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2002-11-29 15:09:37 +0000
committerRichard M. Stallman2002-11-29 15:09:37 +0000
commit120de5bda3c3ec70cabdd91eae91ac3608226099 (patch)
tree5c5d151ecb6aa655a9b285c5eb791d281998c4bf
parente9b1d996569f53ceb8130780402f1855f58225f4 (diff)
downloademacs-120de5bda3c3ec70cabdd91eae91ac3608226099.tar.gz
emacs-120de5bda3c3ec70cabdd91eae91ac3608226099.zip
(yank-window-start): New variable.
(yank): Record yank-window-start (yank-pop): Use yank-window-start.
-rw-r--r--lisp/simple.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 08dd0474fbf..0b3c14d72ac 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -1930,6 +1930,8 @@ The argument is used for internal purposes; do not supply one."
1930 :group 'editing 1930 :group 'editing
1931 :version "21.4") 1931 :version "21.4")
1932 1932
1933(defvar yank-window-start nil)
1934
1933(defun yank-pop (arg) 1935(defun yank-pop (arg)
1934 "Replace just-yanked stretch of killed text with a different stretch. 1936 "Replace just-yanked stretch of killed text with a different stretch.
1935This command is allowed only immediately after a `yank' or a `yank-pop'. 1937This command is allowed only immediately after a `yank' or a `yank-pop'.
@@ -1952,6 +1954,9 @@ comes the newest one."
1952 (delete-region (point) (mark t)) 1954 (delete-region (point) (mark t))
1953 (set-marker (mark-marker) (point) (current-buffer)) 1955 (set-marker (mark-marker) (point) (current-buffer))
1954 (insert-for-yank (current-kill arg)) 1956 (insert-for-yank (current-kill arg))
1957 ;; Set the window start back where it was in the yank command,
1958 ;; if possible.
1959 (set-window-start (selected-window) yank-window-start t)
1955 (if before 1960 (if before
1956 ;; This is like exchange-point-and-mark, but doesn't activate the mark. 1961 ;; This is like exchange-point-and-mark, but doesn't activate the mark.
1957 ;; It is cleaner to avoid activation, even though the command 1962 ;; It is cleaner to avoid activation, even though the command
@@ -1969,6 +1974,7 @@ With argument N, reinsert the Nth most recently killed stretch of killed
1969text. 1974text.
1970See also the command \\[yank-pop]." 1975See also the command \\[yank-pop]."
1971 (interactive "*P") 1976 (interactive "*P")
1977 (setq yank-window-start (window-start))
1972 ;; If we don't get all the way thru, make last-command indicate that 1978 ;; If we don't get all the way thru, make last-command indicate that
1973 ;; for the following command. 1979 ;; for the following command.
1974 (setq this-command t) 1980 (setq this-command t)