From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <868qwou8pv.fsf@gnu.org> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31854"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 72759@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 22 13:32:38 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sh63S-00085d-06 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 22 Aug 2024 13:32:38 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sh638-0004MA-R5; Thu, 22 Aug 2024 07:32:18 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sh637-0004L5-3x for bug-gnu-emacs@gnu.org; Thu, 22 Aug 2024 07:32:17 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sh636-0004cJ-R6 for bug-gnu-emacs@gnu.org; Thu, 22 Aug 2024 07:32:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=ffx9tRjlaTy2biS7wozlJUhuCuP/UDeVyDLEqjBY8mQ=; b=UB+w9gem8zgzejHYeeclIZqBp+cgKW1WDZpF5NiMEryoMlre9Yu04AdGWcYdI3qMwBCptS1LEtGQDXi6X72+nj8fpaEajE8ImCi6y8RK+CAftrkO9GB8iOxhY5VffFF3O6+32gIcEzK4+ZWPeGQf9S5jJxU4mKCkbaUNYz14LXTiaMn5bgEIcHQXBGexfOeNFnJ3M6J2MXjboYGsOSN1bv0pN90qhITUj/vH+shz4/LZKeSimHRelzHhWJ+pwoI0bmTV06CT63QvBZ5nxlJIy8t9ZhXclLlfBc5r1f/XPOpN5rWc3RKVXyVSpAlSW6Egh86u8jCqwa4kMqqhCJZayg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sh63q-0007Kp-GO for bug-gnu-emacs@gnu.org; Thu, 22 Aug 2024 07:33:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Aug 2024 11:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72759 X-GNU-PR-Package: emacs Original-Received: via spool by 72759-submit@debbugs.gnu.org id=B72759.172432632928132 (code B ref 72759); Thu, 22 Aug 2024 11:33:02 +0000 Original-Received: (at 72759) by debbugs.gnu.org; 22 Aug 2024 11:32:09 +0000 Original-Received: from localhost ([127.0.0.1]:36902 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sh62y-0007Je-KU for submit@debbugs.gnu.org; Thu, 22 Aug 2024 07:32:09 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:42254 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sh62v-0007JU-C1 for 72759@debbugs.gnu.org; Thu, 22 Aug 2024 07:32:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1724326279; bh=nLNWcnBgjpFWOcoGGBGAY4TG1b2gj2BWkBN/cShBVh4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=nODBWNo/cxNfth7qrdC1Byeykai1H0ZxD1jVTXeS77M/tZYLeWXMYyYkHpBYU/19k ICup5mShlHnJHeffxwNevnKx/0LtKOE7q1cZHyPq0IuvB0Wn2ZEUSNF6ccstSMmuzT TZL10aHC7wpN5dHUUBJHqmq9dMklRwqt9uihmSecP5ZtLasNnObnxHoCAyU+jsiU52 ATHGfKC5NolfmIGpcNgnODwdYDh2Eyx+8kBUS7mg86Rds7hA6UJL4820mXWon99Kwb ZjYXC8ZZ+CkW1bFi3kTaaHz4sDmnBHxkfaixygp+oXR0Afy8m2U8bwvTp47vYp6sP1 5AdnH9NE0w3/A== In-Reply-To: <868qwou8pv.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 22 Aug 2024 13:56:28 +0300") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:290527 Archived-At: Eli Zaretskii 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" >> >> >> 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) #)) apply(elisp-flymake-checkdoc #f(compiled-function (&rest args) #) nil) flymake--run-backend(elisp-flymake-checkdoc nil) #f(compiled-function (backend) #)(elisp-flymake-checkdoc) run-hook-wrapped(#f(compiled-function (backend) #) elisp-flymake-checkdoc) flymake-start((on-display) nil) --8<---------------cut here---------------end--------------->8---