Mercurial > emacs
changeset 28187:507041681c73
(append-to-buffer): Update point of windows after
insertion.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Fri, 17 Mar 2000 22:33:28 +0000 |
parents | a552a942b327 |
children | 0e0b0df72444 |
files | lisp/simple.el |
diffstat | 1 files changed, 10 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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.