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 14:37:01 +0200 Message-ID: References: <868qwou8pv.fsf@gnu.org> <861q2gu56u.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="17702"; 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 14:37:41 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 1sh74O-0004Qc-1f for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 22 Aug 2024 14:37:40 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sh745-00081J-QF; Thu, 22 Aug 2024 08:37:22 -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 1sh741-00080K-Jf for bug-gnu-emacs@gnu.org; Thu, 22 Aug 2024 08:37:18 -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 1sh741-0007N0-A1 for bug-gnu-emacs@gnu.org; Thu, 22 Aug 2024 08:37:17 -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=wlfWTs954RaS78Cjl41QM1Z4iLj1WXFRJos17RtxMfs=; b=eacNRKRgUmR9S16ddwStwBmGlz9QfeAkyOYB8KFDbD9xmnmFA/veWyIfcIIGPw84d5CYbNgPLXrzEk6mjOAjc/yOQi3MVb4RrxiJuqAi/gqZD8OhHjXAxTiTylMq5WYYireoXaNn5i6uSgbt8/Hwyr/iq/2TDrrkEOO7PRFpmNSWoxr6S6ot/QJ5Ds+KnJwK9jYl+MkTJPWxXMgpgXXPrOtPHP6BlTaOZTKsS9JWDgLPAaYd2Q8czrau8Irki/853lQ16AIp/9cUxrNfo/IMykg4KVuRi5xQbual9B9zeE6PBWFHWs5hpjWu2/UOiuzbBHG2dQ048lHu79g1+bXDLg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sh74k-0000mz-8i for bug-gnu-emacs@gnu.org; Thu, 22 Aug 2024 08:38: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 12:38: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.17243302743014 (code B ref 72759); Thu, 22 Aug 2024 12:38:02 +0000 Original-Received: (at 72759) by debbugs.gnu.org; 22 Aug 2024 12:37:54 +0000 Original-Received: from localhost ([127.0.0.1]:37022 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sh74b-0000mV-Pc for submit@debbugs.gnu.org; Thu, 22 Aug 2024 08:37:54 -0400 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:47132 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sh74Y-0000mL-4q for 72759@debbugs.gnu.org; Thu, 22 Aug 2024 08:37:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1724330223; bh=u43MQqqprJdm6fTLJg/cOAmc/DjZ6R7lhEv+H9vglMU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=bhXDvAK9IGH4uGG1shqtYSV1NhFEQ4qGZeZtWOXrhOj249gvT7wXp9QYXKalkrttU 4mNeJvw7d4VVqMjRuW3F43AYO4JVtIjx/cTu5X7AhcUzWwYIZVQMkD5UIAHd4gEJYk 4FnDbVxk6wtDWIDgUqAnct1UmsdcCd8MqlOtUhGGDoq8VuLaeN4ceh2fWLceglCsK4 nB9p2EzOPhfuiIlIxxNv7BwcFZt7yZqYMPNxQZyhuf+0rHVf0lDXn/EChvvY9P3R6b C64qUgyT6e5U0sPeQRibu/IXnZaJieWVFcHsqr6Somsb7qSUyE+w2bq92IzMo+C1HN JFjN6WFGiBi8g== In-Reply-To: <861q2gu56u.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 22 Aug 2024 15:12:41 +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:290532 Archived-At: Eli Zaretskii writes: >> From: Eshel Yaron >> Cc: 72759@debbugs.gnu.org >> Date: Thu, 22 Aug 2024 13:31:16 +0200 >> >> 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. > > 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