emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-23 r99671: Fix 2009-11-13 change to a


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-23 r99671: Fix 2009-11-13 change to append-to-buffer (Bug#5749).
Date: Wed, 24 Mar 2010 12:18:13 -0400
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 99671
committer: Chong Yidong <address@hidden>
branch nick: emacs-23
timestamp: Wed 2010-03-24 12:18:13 -0400
message:
  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)
modified:
  lisp/ChangeLog
  lisp/simple.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog    2010-03-24 15:57:16 +0000
+++ b/lisp/ChangeLog    2010-03-24 16:18:13 +0000
@@ -1,3 +1,9 @@
+2010-03-24  Chong Yidong  <address@hidden>
+
+       * simple.el (append-to-buffer): Ensure that point is preserved if
+       BUFFER is the current buffer.  Suggested by YAMAMOTO Mitsuharu.
+       (Bug#5749)
+
 2010-03-24  Stefan Monnier  <address@hidden>
 
        * progmodes/make-mode.el (makefile-rule-action-regex): Backtrack less.

=== modified file 'lisp/simple.el'
--- a/lisp/simple.el    2010-02-16 14:40:45 +0000
+++ b/lisp/simple.el    2010-03-24 16:18:13 +0000
@@ -3473,12 +3473,13 @@
            (windows (get-buffer-window-list append-to t t))
            point)
       (with-current-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))))))))
+       (save-excursion
+         (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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]