indent-according-to-mode preserves point.
+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)
(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)))