GNU bug report logs - #72759
31.0.50; Emacs hangs with open-paren-in-column-0-is-defun-start set to nil

Previous Next

Package: emacs;

Reported by: Eshel Yaron <me <at> eshelyaron.com>

Date: Thu, 22 Aug 2024 10:09:01 UTC

Severity: normal

Found in version 31.0.50

Fixed in version 30.1

Done: Eshel Yaron <me <at> eshelyaron.com>

Bug is archived. No further changes may be made.

Full log


Message #17 received at 72759 <at> debbugs.gnu.org (full text, mbox):

From: Eshel Yaron <me <at> eshelyaron.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 72759 <at> debbugs.gnu.org
Subject: Re: 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
Eli Zaretskii <eliz <at> gnu.org> writes:

>> From: Eshel Yaron <me <at> eshelyaron.com>
>> Cc: 72759 <at> debbugs.gnu.org
>> Date: Thu, 22 Aug 2024 13:31:16 +0200
>> 
>> Eli Zaretskii <eliz <at> 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 <at> 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




This bug report was last modified 330 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.