GNU bug report logs -
#15767
24.3; [patch] electric-indent-mode bug
Previous Next
Reported by: Dave Abrahams <dave <at> boostpro.com>
Date: Wed, 30 Oct 2013 23:43:02 UTC
Severity: minor
Tags: patch
Found in version 24.3
Done: Stefan Monnier <monnier <at> iro.umontreal.ca>
Bug is archived. No further changes may be made.
Full log
Message #16 received at 15767-done <at> debbugs.gnu.org (full text, mbox):
> (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))))
This bug report was last modified 11 years and 199 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.