]> git.eshelyaron.com Git - emacs.git/commitdiff
(reindent-then-newline-and-indent): Don't assume that
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 16 Oct 2007 15:18:39 +0000 (15:18 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 16 Oct 2007 15:18:39 +0000 (15:18 +0000)
indent-according-to-mode preserves point.

lisp/ChangeLog
lisp/simple.el

index 69919bdec0fa96a0eef8281d6642feca6f520081..2e5bb8bd7905e8c5188329f084614fa0b341dd5b 100644 (file)
@@ -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)
index b5ca79de02793c8952ba17e007dc48cf1ad4b40e..3d5f6bfab10c2189be09f8ce4cb230a4c4282066 100644 (file)
@@ -633,7 +633,9 @@ column specified by the function `current-left-margin'."
     (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)))