From 4144e15e96e7d67ff0ebbed15ecc14154ba68da2 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Tue, 16 Oct 2007 15:18:39 +0000 Subject: [PATCH] (reindent-then-newline-and-indent): Don't assume that indent-according-to-mode preserves point. --- lisp/ChangeLog | 5 +++++ lisp/simple.el | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 69919bdec0f..2e5bb8bd790 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2007-10-16 Stefan Monnier + + * simple.el (reindent-then-newline-and-indent): Don't assume that + indent-according-to-mode preserves point. + 2007-10-16 Juanma Barranquero * bs.el (bs--make-header-match-string, bs-show-in-buffer) diff --git a/lisp/simple.el b/lisp/simple.el index b5ca79de027..3d5f6bfab10 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -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)))