From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 72759@debbugs.gnu.org
Subject: bug#72759: 31.0.50; Emacs hangs with open-paren-in-column-0-is-defun-start set to nil
Date: Thu, 22 Aug 2024 14:37:01 +0200 [thread overview]
Message-ID: <m1msl4ente.fsf@dazzs-mbp.home> (raw)
In-Reply-To: <861q2gu56u.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 22 Aug 2024 15:12:41 +0300")
Eli Zaretskii <eliz@gnu.org> writes:
>> From: Eshel Yaron <me@eshelyaron.com>
>> Cc: 72759@debbugs.gnu.org
>> Date: Thu, 22 Aug 2024 13:31:16 +0200
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> >> Date: Thu, 22 Aug 2024 12:07:38 +0200
>> >> From: Eshel Yaron via "Bug reports for GNU Emacs,
>> >> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>> >>
>> >>
>> >> 1. emacs -Q
>> >> 2. (setq open-paren-in-column-0-is-defun-start nil)
>> >> 3. Insert " (foo"
>> >> 4. M-x flymake-mode
>> >> 5. Emacs hangs
>> >>
>> >> I can reproduce this with Emacs 29 and later.
>> >
>> > Thanks. Could you show the Lisp backtrace from the hang (assuming it
>> > hangs in Lisp code)?
>>
>> Sure, see the backtrace below. It appears that the hang is in
>> checkdoc-next-docstring, namely this loop...
>>
>> --8<---------------cut here---------------start------------->8---
>> (while (and (not (setq found (checkdoc--next-docstring)))
>> (beginning-of-defun -1)))
>> --8<---------------cut here---------------end--------------->8---
>>
>> ...never terminates, because beginning-of-defun behaves differently with
>> open-paren-in-column-0-is-defun-start set to nil.
>
> Would it make sense to have checkdoc-next-docstring bind
> open-paren-in-column-0-is-defun-start to a non-nil value?
Not entirely: the difference in behavior of beginning-of-defun is
unexpected, and may prove problematic in other cases as well, so it
would be best to fix the root cause IMO. Namely, in
beginning-of-defun-raw, the fallback cond clause fails to move forward
over an sexp that does starts after the beginning of the line.
You should also be able to see this in effect with C-- C-M-a at the
beginning of a line whose contents is " (foo)". The results vary
depending on the value of open-paren-in-column-0-is-defun-start.
Eshel
next prev parent reply other threads:[~2024-08-22 12:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-22 10:07 bug#72759: 31.0.50; Emacs hangs with open-paren-in-column-0-is-defun-start set to nil Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-22 10:56 ` Eli Zaretskii
2024-08-22 11:31 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-22 12:12 ` Eli Zaretskii
2024-08-22 12:37 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2024-08-22 13:54 ` Eli Zaretskii
2024-08-22 15:49 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-22 16:10 ` Eli Zaretskii
2024-08-22 17:08 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-22 17:54 ` Eli Zaretskii
2024-08-23 5:54 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-23 6:56 ` Eli Zaretskii
2024-08-23 8:33 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-08-23 13:14 ` Eli Zaretskii
2024-08-23 15:22 ` Eshel Yaron via Bug reports for GNU Emacs, the Swiss army knife of text editors
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=m1msl4ente.fsf@dazzs-mbp.home \
--to=bug-gnu-emacs@gnu.org \
--cc=72759@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=me@eshelyaron.com \
/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).