From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii 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 19:10:28 +0300 Message-ID: <86ed6gsfm3.fsf@gnu.org> References: <868qwou8pv.fsf@gnu.org> <861q2gu56u.fsf@gnu.org> <86msl4slwv.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4141"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 72759@debbugs.gnu.org To: Eshel Yaron Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 22 18:13:39 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 1shARO-0000uv-Vq for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 22 Aug 2024 18:13:39 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1shAR5-0003kI-HO; Thu, 22 Aug 2024 12:13:19 -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 1shAR3-0003jY-5u for bug-gnu-emacs@gnu.org; Thu, 22 Aug 2024 12:13: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 1shAR2-000609-Sz for bug-gnu-emacs@gnu.org; Thu, 22 Aug 2024 12:13:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=References:In-Reply-To:From:Date:To:Subject; bh=e2Vr5AHpgIoj0Tu/QXVLGPzSWd+RCodSvxMbIBBE4xg=; b=BS7gKgxCltK1vLX18A6SgBJoAymitFNzQnxVPi7qaDgWr/ZP6AflVdf4Jz2DMdW7gFRv5CV1mgvo5bg6sZRAIzlwgr4YtqdSqK/2d/dgfGPs/H377hI64LHz55UdZKU3scCDd8xKqvDR/88gsYAOuQsZdDeBVrl5J0OK3ETGdr92pIizZfplTUlT4lMk26fD9bxo2eET5QODeNyMg4vBHqvKbDdU069DTy7QuayiWh7k3HqmcVTZtOdEkSTeK1dZsl6S+ctoZL+abjMgaSBDT669nDaXFZJnnhX47nf52PgO9tRucC3GLi9LlbtMAtYoXUMDm5g8i+vXc4PbYVTFzA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1shARm-0007IA-JE for bug-gnu-emacs@gnu.org; Thu, 22 Aug 2024 12:14:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 22 Aug 2024 16:14: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.172434322127992 (code B ref 72759); Thu, 22 Aug 2024 16:14:02 +0000 Original-Received: (at 72759) by debbugs.gnu.org; 22 Aug 2024 16:13:41 +0000 Original-Received: from localhost ([127.0.0.1]:38259 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1shARQ-0007HO-HS for submit@debbugs.gnu.org; Thu, 22 Aug 2024 12:13:40 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:53144) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1shARN-0007HA-IU for 72759@debbugs.gnu.org; Thu, 22 Aug 2024 12:13:39 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1shAOR-0005gQ-LM; Thu, 22 Aug 2024 12:10:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=e2Vr5AHpgIoj0Tu/QXVLGPzSWd+RCodSvxMbIBBE4xg=; b=JDmSp+91Q7kr uSP358NysYWwE3ez/i6r494MMAAFF9g3etvdF8HzT/zZpfZwXMRecPvL3v+gia4wcetjipRaNs1cD PZe8MPO6XmKzw9Bye+1YsdMcRxS3IZmhfcCfi1c8Kd40J4D5AFxjWa0LrAGy1Rh3XBT/JG+wEOUXg HosJUTmuQjNyYDnUsxGVYCiFuK5NbgdrF8YHz8qGPE7lwvwXPgskBEAzHuY1VOU3mFRAh5RKsdJUE o1tUAtW+qdDlMh3jPbZPKjS0jZ/XLr7q5eaR/kXYmQU0XKwJOBYNIQFI3dS6NdqLgTtTnUDSRS3DQ 3lP0DrzjXmPL2qFV64v3Hg==; In-Reply-To: (message from Eshel Yaron on Thu, 22 Aug 2024 17:49:22 +0200) 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:290545 Archived-At: > From: Eshel Yaron > Cc: 72759@debbugs.gnu.org > Date: Thu, 22 Aug 2024 17:49:22 +0200 > > After taking another look, ISTM that the problem is that checkdoc > assumes that beginning-of-defun either advances point or returns nil, > but since beginning-of-defun unconditionally moves to the beginning of > the line, it can in fact find a defun ahead of point (and thus return > non-nil) but then move back to the beginning of the line, so point is > unchanged. So the assumption in checkdoc doesn't always hold when > open-paren-in-column-0-is-defun-start is nil. This assumption should > still hold, however, for beginning-of-defun-raw, which doesn't go back > to the beginning of the line. > > This suggests the following change, which indeed seems to fix the hang: > > > diff --git a/lisp/emacs-lisp/checkdoc.el b/lisp/emacs-lisp/checkdoc.el > index 949ca6b74ad..65226d8ee44 100644 > --- a/lisp/emacs-lisp/checkdoc.el > +++ b/lisp/emacs-lisp/checkdoc.el > @@ -981,7 +981,7 @@ checkdoc-next-docstring > Return nil if there are no more doc strings." > (let (found) > (while (and (not (setq found (checkdoc--next-docstring))) > - (beginning-of-defun -1))) > + (beginning-of-defun-raw -1))) > found)) But the doc string of beginning-of-defun-raw says, inter alia: This is identical to function `beginning-of-defun', except that point does not move to the beginning of the line when `defun-prompt-regexp' is non-nil. ^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^ Does that mean defun-prompt-regexp was non-nil in your case? The default is nil.