emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] Changes to emacs/lisp/simple.el,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/lisp/simple.el,v
Date: Wed, 24 Oct 2007 01:51:05 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        07/10/24 01:51:04

Index: simple.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/simple.el,v
retrieving revision 1.883
retrieving revision 1.884
diff -u -b -r1.883 -r1.884
--- simple.el   22 Oct 2007 00:17:26 -0000      1.883
+++ simple.el   24 Oct 2007 01:51:02 -0000      1.884
@@ -633,9 +633,16 @@
     (newline)
     (save-excursion
       (goto-char pos)
-      ;; 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))
+      ;; We are at EOL before the call to indent-according-to-mode, and
+      ;; after it we usually are as well, but not always.  We tried to
+      ;; address it with `save-excursion' but that uses a normal marker
+      ;; whereas we need `move after insertion', so we do the save/restore
+      ;; by hand.
+      (setq pos (copy-marker pos t))
+      (indent-according-to-mode)
+      (goto-char pos)
+      ;; Remove the trailing white-space after indentation because
+      ;; indentation may introduce the whitespace.
       (delete-horizontal-space t))
     (indent-according-to-mode)))
 




reply via email to

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