From: Noam Postavsky <npostavs@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 18764@debbugs.gnu.org
Subject: bug#18764: 24.4; electric-indent in *scratch* signals an error
Date: Sat, 16 Jun 2018 19:13:29 -0400 [thread overview]
Message-ID: <87lgbetjdy.fsf@gmail.com> (raw)
In-Reply-To: <83muvuzsc8.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 16 Jun 2018 18:03:35 +0300")
Eli Zaretskii <eliz@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)))))))
next prev parent reply other threads:[~2018-06-16 23:13 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-18 14:59 bug#18764: 24.4; electric-indent in *scratch* signals an error Eli Zaretskii
2018-06-15 2:34 ` Noam Postavsky
2018-06-16 11:30 ` Eli Zaretskii
2018-06-16 13:48 ` Noam Postavsky
2018-06-16 15:03 ` Eli Zaretskii
2018-06-16 23:13 ` Noam Postavsky [this message]
2018-06-17 3:48 ` Eli Zaretskii
2018-06-18 9:33 ` Dmitry Gutov
2018-06-18 15:15 ` Eli Zaretskii
2018-06-21 0:19 ` Noam Postavsky
2018-06-21 14:39 ` Eli Zaretskii
2018-06-24 1:40 ` Noam Postavsky
2018-06-24 14:52 ` Eli Zaretskii
2018-06-25 23:20 ` Noam Postavsky
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lgbetjdy.fsf@gmail.com \
--to=npostavs@gmail.com \
--cc=18764@debbugs.gnu.org \
--cc=eliz@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).