changeset 85327:84eaa97c1d65

(reindent-then-newline-and-indent): Don't assume that indent-according-to-mode preserves point.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Tue, 16 Oct 2007 15:18:39 +0000
parents d4cb1ed6569f
children d0d527210b0c
files lisp/ChangeLog lisp/simple.el
diffstat 2 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Oct 16 10:40:02 2007 +0000
+++ b/lisp/ChangeLog	Tue Oct 16 15:18:39 2007 +0000
@@ -1,3 +1,8 @@
+2007-10-16  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+	* simple.el (reindent-then-newline-and-indent): Don't assume that
+	indent-according-to-mode preserves point.
+
 2007-10-16  Juanma Barranquero  <lekktu@gmail.com>
 
 	* bs.el (bs--make-header-match-string, bs-show-in-buffer)
--- a/lisp/simple.el	Tue Oct 16 10:40:02 2007 +0000
+++ b/lisp/simple.el	Tue Oct 16 15:18:39 2007 +0000
@@ -633,7 +633,9 @@
     (newline)
     (save-excursion
       (goto-char pos)
-      (indent-according-to-mode)
+      ;; Usually indent-according-to-mode should "preserve" point, but it is
+      ;; not guaranteed; e.g. indent-to-left-margin doesn't.
+      (save-excursion (indent-according-to-mode))
       (delete-horizontal-space t))
     (indent-according-to-mode)))