]> git.eshelyaron.com Git - emacs.git/commitdiff
(append-to-buffer): Update point of windows after
authorGerd Moellmann <gerd@gnu.org>
Fri, 17 Mar 2000 22:33:28 +0000 (22:33 +0000)
committerGerd Moellmann <gerd@gnu.org>
Fri, 17 Mar 2000 22:33:28 +0000 (22:33 +0000)
insertion.

lisp/simple.el

index 17bc9e70e363926cc8bab8d143548496af14ad99..3397e24a62a9d3e2e9476a210270971bc3b46367 100644 (file)
@@ -2011,9 +2011,16 @@ START and END specify the portion of the current buffer to be copied."
         (region-beginning) (region-end)))
   (let ((oldbuf (current-buffer)))
     (save-excursion
-      (set-buffer (get-buffer-create buffer))
-      (barf-if-buffer-read-only)
-      (insert-buffer-substring oldbuf start end))))
+      (let* ((append-to (get-buffer-create buffer))
+            (windows (get-buffer-window-list append-to t t))
+            point)
+       (set-buffer append-to)
+       (setq point (point))
+       (barf-if-buffer-read-only)
+       (insert-buffer-substring oldbuf start end)
+       (dolist (window windows)
+         (when (= (window-point window) point)
+           (set-window-point window (point))))))))
 
 (defun prepend-to-buffer (buffer start end)
   "Prepend to specified buffer the text of the region.