From: akater <nuclearspace@gmail.com>
To: Lars Ingebrigtsen <larsi@gnus.org>,
"Basil L. Contovounesios" <contovob@tcd.ie>
Cc: "Mattias Engdegård" <mattiase@acm.org>,
9622@debbugs.gnu.org, "Diogo F. S. Ramos" <diogofsr@gmail.com>
Subject: bug#9622: [PATCH] Re: bug#9622: 23.3; flet indentation
Date: Thu, 30 Sep 2021 13:57:04 +0000 [thread overview]
Message-ID: <87a6junp3j.fsf@gmail.com> (raw)
In-Reply-To: <8735pm2nai.fsf@gnus.org>
[-- Attachment #1.1: Type: text/plain, Size: 421 bytes --]
Lars Ingebrigtsen <larsi@gnus.org> writes:
> Perhaps we should consider backing out these changed in Emacs 28 and
> continuing to work on them on the trunk?
I don't think so. The first attempt was written in a hurry, and merged
without extensive testing; in the second I did exhaustive tests, it just
never crossed my mind to test on unbalanced expressions. This very much
looks like the last ignore-errors of them:
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 865 bytes --]
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Fix indentation regression --]
[-- Type: text/x-diff, Size: 1691 bytes --]
From 2e5f87b345d349dc6657f8034102a842d0685232 Mon Sep 17 00:00:00 2001
From: akater <nuclearspace@gmail.com>
Date: Thu, 30 Sep 2021 13:37:59 +0000
Subject: [PATCH] Fix other regressions in cl-flet indentation
* lisp/emacs-lisp/lisp-mode.el (lisp--local-defform-body-p):
Fix indentation regression
introduced by 38037e04cb05cb1f2b604f0b1602d36b0bcf6985
(bug#9622), namely don't fail in unreadable (incl. unbalanced) sexps.
---
lisp/emacs-lisp/lisp-mode.el | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/lisp/emacs-lisp/lisp-mode.el b/lisp/emacs-lisp/lisp-mode.el
index cd054801bc..57196dfec4 100644
--- a/lisp/emacs-lisp/lisp-mode.el
+++ b/lisp/emacs-lisp/lisp-mode.el
@@ -1124,9 +1124,13 @@ defun lisp--local-defform-body-p (state)
(when second-order-parent
(save-excursion
(goto-char (1+ second-order-parent))
- (and (memq (read (current-buffer))
- '( cl-flet cl-labels cl-macrolet cl-flet*
- cl-symbol-macrolet))
+ (and (when-let ((head (ignore-errors
+ ;; FIXME: This does not distinguish
+ ;; between reading nil and a read error.
+ ;; We don't care but still, better fix this.
+ (read (current-buffer)))))
+ (memq head '( cl-flet cl-labels cl-macrolet cl-flet*
+ cl-symbol-macrolet)))
;; Now we must check that we are
;; in the second element of the flet-like form.
;; It would be easier if `parse-partial-sexp' also recorded
--
2.32.0
next prev parent reply other threads:[~2021-09-30 13:57 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <504153FB-8633-4755-A91A-DF5DD64E6FAA@acm.org>
2021-09-28 3:01 ` bug#9622: 23.3; flet indentation akater
2021-09-28 5:23 ` Lars Ingebrigtsen
2021-09-28 10:11 ` Mattias Engdegård
2021-09-28 10:35 ` Mattias Engdegård
2021-09-28 16:39 ` akater
2021-09-29 18:12 ` bug#9622: [PATCH] " akater
2021-09-30 6:37 ` Lars Ingebrigtsen
2021-09-30 8:05 ` Mattias Engdegård
2021-09-30 13:06 ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-30 13:41 ` Lars Ingebrigtsen
2021-09-30 13:57 ` akater [this message]
2021-10-01 11:27 ` Lars Ingebrigtsen
2021-10-09 7:26 ` akater
2021-10-09 11:23 ` Lars Ingebrigtsen
2021-10-28 19:23 ` akater
2021-10-28 21:53 ` Lars Ingebrigtsen
2021-09-30 14:52 ` Mattias Engdegård
2021-09-30 15:11 ` Basil L. Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-30 15:23 ` Thierry Volpiatto
2021-09-30 15:33 ` akater
2021-09-30 16:04 ` Thierry Volpiatto
2021-09-30 15:25 ` Mattias Engdegård
2021-09-30 15:56 ` akater
2021-09-30 19:28 ` miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-09-30 23:23 ` akater
2021-11-08 1:13 ` Michael Heerdegen
2021-11-08 6:18 ` bug#9622: [PATCH] " akater
2021-11-08 6:38 ` Lars Ingebrigtsen
2021-11-08 6:38 ` akater
2021-11-08 6:53 ` Lars Ingebrigtsen
2021-11-08 9:36 ` akater
2021-11-09 3:25 ` Lars Ingebrigtsen
2021-11-08 16:30 ` Michael Heerdegen
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=87a6junp3j.fsf@gmail.com \
--to=nuclearspace@gmail.com \
--cc=9622@debbugs.gnu.org \
--cc=contovob@tcd.ie \
--cc=diogofsr@gmail.com \
--cc=larsi@gnus.org \
--cc=mattiase@acm.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).