diff options
| author | Chong Yidong | 2010-03-24 12:18:13 -0400 |
|---|---|---|
| committer | Chong Yidong | 2010-03-24 12:18:13 -0400 |
| commit | d0fba1745fc6b4a9b078957cae994ff694ba5efe (patch) | |
| tree | 7b60aed01a0db61d68bbe500f365c8102d866d17 | |
| parent | efee6a6d9cec2af824b8355c93d8f47b72a685a8 (diff) | |
| download | emacs-d0fba1745fc6b4a9b078957cae994ff694ba5efe.tar.gz emacs-d0fba1745fc6b4a9b078957cae994ff694ba5efe.zip | |
Fix 2009-11-13 change to append-to-buffer (Bug#5749).
* simple.el (append-to-buffer): Ensure that point is preserved if
BUFFER is the current buffer. Suggested by YAMAMOTO Mitsuharu.
(Bug#5749)
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/simple.el | 13 |
2 files changed, 13 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index a83786a5927..4cfb8549b46 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2010-03-24 Chong Yidong <cyd@stupidchicken.com> | ||
| 2 | |||
| 3 | * simple.el (append-to-buffer): Ensure that point is preserved if | ||
| 4 | BUFFER is the current buffer. Suggested by YAMAMOTO Mitsuharu. | ||
| 5 | (Bug#5749) | ||
| 6 | |||
| 1 | 2010-03-24 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2010-03-24 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * progmodes/make-mode.el (makefile-rule-action-regex): Backtrack less. | 9 | * progmodes/make-mode.el (makefile-rule-action-regex): Backtrack less. |
diff --git a/lisp/simple.el b/lisp/simple.el index 30498ea2704..2adf4756dca 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -3473,12 +3473,13 @@ START and END specify the portion of the current buffer to be copied." | |||
| 3473 | (windows (get-buffer-window-list append-to t t)) | 3473 | (windows (get-buffer-window-list append-to t t)) |
| 3474 | point) | 3474 | point) |
| 3475 | (with-current-buffer append-to | 3475 | (with-current-buffer append-to |
| 3476 | (setq point (point)) | 3476 | (save-excursion |
| 3477 | (barf-if-buffer-read-only) | 3477 | (setq point (point)) |
| 3478 | (insert-buffer-substring oldbuf start end) | 3478 | (barf-if-buffer-read-only) |
| 3479 | (dolist (window windows) | 3479 | (insert-buffer-substring oldbuf start end) |
| 3480 | (when (= (window-point window) point) | 3480 | (dolist (window windows) |
| 3481 | (set-window-point window (point)))))))) | 3481 | (when (= (window-point window) point) |
| 3482 | (set-window-point window (point))))))))) | ||
| 3482 | 3483 | ||
| 3483 | (defun prepend-to-buffer (buffer start end) | 3484 | (defun prepend-to-buffer (buffer start end) |
| 3484 | "Prepend to specified buffer the text of the region. | 3485 | "Prepend to specified buffer the text of the region. |