aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Moellmann2000-03-17 22:33:28 +0000
committerGerd Moellmann2000-03-17 22:33:28 +0000
commitc069a4804fce13d147634f0cbef02c91cc7d2ed3 (patch)
tree87aa3e9656da17da071a84d696aa6bec325ac531
parent466840685febd3b615821df7ca789aef4fb6478f (diff)
downloademacs-c069a4804fce13d147634f0cbef02c91cc7d2ed3.tar.gz
emacs-c069a4804fce13d147634f0cbef02c91cc7d2ed3.zip
(append-to-buffer): Update point of windows after
insertion.
-rw-r--r--lisp/simple.el13
1 files changed, 10 insertions, 3 deletions
diff --git a/lisp/simple.el b/lisp/simple.el
index 17bc9e70e36..3397e24a62a 100644
--- a/lisp/simple.el
+++ b/lisp/simple.el
@@ -2011,9 +2011,16 @@ START and END specify the portion of the current buffer to be copied."
2011 (region-beginning) (region-end))) 2011 (region-beginning) (region-end)))
2012 (let ((oldbuf (current-buffer))) 2012 (let ((oldbuf (current-buffer)))
2013 (save-excursion 2013 (save-excursion
2014 (set-buffer (get-buffer-create buffer)) 2014 (let* ((append-to (get-buffer-create buffer))
2015 (barf-if-buffer-read-only) 2015 (windows (get-buffer-window-list append-to t t))
2016 (insert-buffer-substring oldbuf start end)))) 2016 point)
2017 (set-buffer append-to)
2018 (setq point (point))
2019 (barf-if-buffer-read-only)
2020 (insert-buffer-substring oldbuf start end)
2021 (dolist (window windows)
2022 (when (= (window-point window) point)
2023 (set-window-point window (point))))))))
2017 2024
2018(defun prepend-to-buffer (buffer start end) 2025(defun prepend-to-buffer (buffer start end)
2019 "Prepend to specified buffer the text of the region. 2026 "Prepend to specified buffer the text of the region.