GNU bug report logs -
#18764
24.4; electric-indent in *scratch* signals an error
Previous Next
Reported by: Eli Zaretskii <eliz <at> gnu.org>
Date: Sat, 18 Oct 2014 15:00:03 UTC
Severity: normal
Tags: confirmed, fixed, patch
Found in versions 24.4, 26.1
Fixed in version 27.1
Done: Noam Postavsky <npostavs <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Eli Zaretskii <eliz <at> gnu.org> writes:
> Then let me rephrase: why are we signaling an error instead of
> silently doing nothing? IOW, if something cannot be indented, let's
> leave it unindented. Does that make sense?
So just suppress the errors? Worries me a bit that some future problems
could be harder to find because of that.
--- i/lisp/electric.el
+++ w/lisp/electric.el
@@ -262,6 +262,7 @@ electric-indent-post-self-insert-function
(unless (eq act 'do-indent) (nth 8 (syntax-ppss))))))))
;; For newline, we want to reindent both lines and basically behave like
;; reindent-then-newline-and-indent (whose code we hence copied).
+ (ignore-errors
(let ((at-newline (<= pos (line-beginning-position))))
(when at-newline
(let ((before (copy-marker (1- pos) t)))
@@ -285,7 +286,7 @@ electric-indent-post-self-insert-function
(delete-horizontal-space t)))))
(unless (and electric-indent-inhibit
(not at-newline))
- (indent-according-to-mode))))))
+ (indent-according-to-mode)))))))
This bug report was last modified 7 years and 28 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.