aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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.