emacs-pretest-bug
[Top][All Lists]
Advanced

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

Re: reindent-then-newline-and-indent has changed its behavior


From: Stefan Monnier
Subject: Re: reindent-then-newline-and-indent has changed its behavior
Date: 24 Oct 2003 10:43:57 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

> The behavior of reindent-then-newline-and-indent has changed in CVS emacs.

Good call.
Can you try the patch below?


        Stefan


PS: The change is because I've fixed the code to indent the first line
    *after* inserting the newline.  Otherwise calling the function with point
    just before `foo' on a line like

        elsefoo

    in a mode like modula-2 (or sml which I maintain ;-) can result in

        else
        foo

    rather than

      else
        foo


Index: simple.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/simple.el,v
retrieving revision 1.621
diff -u -u -b -r1.621 simple.el
--- simple.el   22 Sep 2003 15:11:02 -0000      1.621
+++ simple.el   24 Oct 2003 14:34:05 -0000
@@ -303,14 +303,14 @@
 In some text modes, where TAB inserts a tab, this indents to the
 column specified by the function `current-left-margin'."
   (interactive "*")
-  (delete-horizontal-space t)
   (let ((pos (point)))
     ;; Be careful to insert the newline before indenting the line.
     ;; Otherwise, the indentation might be wrong.
     (newline)
     (save-excursion
       (goto-char pos)
-      (indent-according-to-mode))
+      (indent-according-to-mode)
+      (delete-horizontal-space t))
     (indent-according-to-mode)))
 
 (defun quoted-insert (arg)




reply via email to

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