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

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

bug#15767: 24.3; [patch] electric-indent-mode bug


From: Stefan Monnier
Subject: bug#15767: 24.3; [patch] electric-indent-mode bug
Date: Mon, 04 Nov 2013 15:04:31 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

>   (electric-indent-mode)
>   (electric-layout-mode)
>   (setq electric-indent-chars (append "{}" electric-indent-chars))
>   (setq electric-layout-rules '((?\{ . after) (?\} . before)))

> 3. type `f o o SPC {'

Thanks.  Your patch defeated a useful case, so I replaced it with the
one below,


        Stefan


--- lisp/electric.el    2013-10-07 18:51:26 +0000
+++ lisp/electric.el    2013-11-04 20:01:20 +0000
@@ -251,9 +251,10 @@
             ;; whereas we need `move after insertion', so we do the
             ;; save/restore by hand.
             (goto-char before)
+           (when (eolp)
             ;; Remove the trailing whitespace after indentation because
             ;; indentation may (re)introduce the whitespace.
-            (delete-horizontal-space t))))
+             (delete-horizontal-space t)))))
       (unless (or (memq indent-line-function '(indent-to-left-margin))
                   (and electric-indent-inhibit
                        (> pos (line-beginning-position))))





reply via email to

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