# HG changeset patch # User Gerd Moellmann # Date 953332408 0 # Node ID 507041681c7311a7c06e5021ffa926212dbf6e55 # Parent a552a942b327d0f9cf3e4f21ced5c7ce3edbd251 (append-to-buffer): Update point of windows after insertion. diff -r a552a942b327 -r 507041681c73 lisp/simple.el --- a/lisp/simple.el Fri Mar 17 22:32:39 2000 +0000 +++ b/lisp/simple.el Fri Mar 17 22:33:28 2000 +0000 @@ -2011,9 +2011,16 @@ (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.