all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
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 13:31:16 +0200	[thread overview]
Message-ID: <m1y14oequz.fsf@dazzs-mbp.home> (raw)
In-Reply-To: <868qwou8pv.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 22 Aug 2024 13:56:28 +0300")

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.


Here's an example backtrace:

--8<---------------cut here---------------start------------->8---
Debugger entered--beginning evaluation of function call form:
* (save-current-buffer (set-buffer buffer) (set-syntax-table table))
  (unwind-protect (progn (set-syntax-table (or syntax-ppss-table (syntax-table))) (let* ((cell (syntax-ppss--data)) (ppss-last (car cell)) (ppss-cache (cdr cell)) (old-ppss (cdr ppss-last)) (old-pos (car ppss-last)) (ppss nil) (pt-min (point-min))) (if (and old-pos (> old-pos pos)) (setq old-pos nil)) (condition-case nil (if (and old-pos (< (- pos old-pos) (let ... ...))) (progn (syntax-ppss--update-stats 0 old-pos pos) (parse-partial-sexp old-pos pos nil nil old-ppss)) (cond ((and ... old-ppss ... ... ...) (syntax-ppss--update-stats 1 pt-min pos) (setq ppss ...)) (t (let ... ... ... ... ... ... ...))) (setq syntax-ppss--updated-cache t) (setq ppss-last (cons pos ppss)) (setcar cell ppss-last) (setcdr cell ppss-cache) ppss) (args-out-of-range (parse-partial-sexp (point-min) pos))))) (save-
 current-buffer (set-buffer buffer) (set-syntax-table table)))
  (let ((table (syntax-table)) (buffer (current-buffer))) (unwind-protect (progn (set-syntax-table (or syntax-ppss-table (syntax-table))) (let* ((cell (syntax-ppss--data)) (ppss-last (car cell)) (ppss-cache (cdr cell)) (old-ppss (cdr ppss-last)) (old-pos (car ppss-last)) (ppss nil) (pt-min (point-min))) (if (and old-pos (> old-pos pos)) (setq old-pos nil)) (condition-case nil (if (and old-pos (< ... ...)) (progn (syntax-ppss--update-stats 0 old-pos pos) (parse-partial-sexp old-pos pos nil nil old-ppss)) (cond (... ... ...) (t ...)) (setq syntax-ppss--updated-cache t) (setq ppss-last (cons pos ppss)) (setcar cell ppss-last) (setcdr cell ppss-cache) ppss) (args-out-of-range (parse-partial-sexp (point-min) pos))))) (save-current-buffer (set-buffer buffer) (set-syntax-table table))))
  syntax-ppss()
  beginning-of-defun-raw(-1)
  beginning-of-defun(-1)
  (and (not (setq found (checkdoc--next-docstring))) (beginning-of-defun -1))
  (while (and (not (setq found (checkdoc--next-docstring))) (beginning-of-defun -1)))
  (let (found) (while (and (not (setq found (checkdoc--next-docstring))) (beginning-of-defun -1))) found)
  checkdoc-next-docstring()
  (and (not wrong) (checkdoc-next-docstring))
  (while (and (not wrong) (checkdoc-next-docstring)) (setq msg (checkdoc-this-string-valid take-notes)) (if msg (setq wrong (point))))
  (save-excursion (while (and (not wrong) (checkdoc-next-docstring)) (setq msg (checkdoc-this-string-valid take-notes)) (if msg (setq wrong (point)))))
  (let ((wrong nil) (msg nil) (checkdoc-spellcheck-documentation-flag (car (memq checkdoc-spellcheck-documentation-flag '(buffer t)))) (checkdoc-autofix-flag (if take-notes 'never checkdoc-autofix-flag)) (checkdoc-generate-compile-warnings-flag (or take-notes checkdoc-generate-compile-warnings-flag))) (save-excursion (while (and (not wrong) (checkdoc-next-docstring)) (setq msg (checkdoc-this-string-valid take-notes)) (if msg (setq wrong (point))))) (if wrong (progn (goto-char wrong) (if (not take-notes) (user-error "%s" (checkdoc-error-text msg))))) (checkdoc-show-diagnostics) (if (called-interactively-p 'interactive) (message "No style warnings.")))
  checkdoc-continue(t)
  (let ((p (point))) (goto-char (point-min)) (if (and take-notes (called-interactively-p 'interactive)) (checkdoc-start-section "checkdoc-start")) (checkdoc-continue take-notes) (goto-char p) nil)
  checkdoc-start(t)
  (or (and buffer-file-name (checkdoc-comments)) (checkdoc-start take-notes) (checkdoc-message-text) (checkdoc-rogue-spaces) (if checkdoc-package-keywords-flag (progn (checkdoc-package-keywords))) (not (called-interactively-p 'interactive)) (if take-notes (checkdoc-show-diagnostics)) (message "Checking buffer for style...Done."))
  (let ((checkdoc-spellcheck-documentation-flag (car (memq checkdoc-spellcheck-documentation-flag '(buffer t)))) (checkdoc-autofix-flag (if take-notes 'never checkdoc-autofix-flag)) (checkdoc-generate-compile-warnings-flag (or take-notes checkdoc-generate-compile-warnings-flag))) (if take-notes (checkdoc-start-section "checkdoc-current-buffer")) (or (and buffer-file-name (checkdoc-comments)) (checkdoc-start take-notes) (checkdoc-message-text) (checkdoc-rogue-spaces) (if checkdoc-package-keywords-flag (progn (checkdoc-package-keywords))) (not (called-interactively-p 'interactive)) (if take-notes (checkdoc-show-diagnostics)) (message "Checking buffer for style...Done.")))
  checkdoc-current-buffer(t)
  elisp-flymake-checkdoc(#f(compiled-function (&rest args) #<bytecode -0x7c81ca94217587e>))
  apply(elisp-flymake-checkdoc #f(compiled-function (&rest args) #<bytecode -0x7c81ca94217587e>) nil)
  flymake--run-backend(elisp-flymake-checkdoc nil)
  #f(compiled-function (backend) #<bytecode -0x1832fbc28e51265>)(elisp-flymake-checkdoc)
  run-hook-wrapped(#f(compiled-function (backend) #<bytecode -0x1832fbc28e51265>) elisp-flymake-checkdoc)
  flymake-start((on-display) nil)
--8<---------------cut here---------------end--------------->8---







  reply	other threads:[~2024-08-22 11:31 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 [this message]
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
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1y14oequz.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.