From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#61436: Emacs Freezing With Java Files Date: Sat, 14 Oct 2023 19:41:41 +0000 Message-ID: References: <87bkd7fsp4.fsf@sappc2.fritz.box> <87il7ew5wx.fsf@sappc2.fritz.box> <87il7dbosk.fsf@lidells.se> <87r0m1t0el.fsf@sappc2.fritz.box> <875y3bbokx.fsf@sappc2.fritz.box> <8734yew8yr.fsf@sappc2.fritz.box> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9513"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Robert Weiner , Hank Greenburg , 61436-done@debbugs.gnu.org, acm@muc.de, Eli Zaretskii , rswgnu@gmail.com To: Jens Schmidt , Mats Lidell Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 14 21:43:18 2023 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 1qrkXd-0002Iv-5Y for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Oct 2023 21:43:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrkXC-0008Pi-Fq; Sat, 14 Oct 2023 15:42:50 -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 1qrkX1-0008OY-7U for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 15:42:44 -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 1qrkX0-000288-Js for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 15:42:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qrkXO-0007rV-2H for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 15:43:02 -0400 Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Oct 2023 19:43:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 61436 X-GNU-PR-Package: emacs Mail-Followup-To: 61436@debbugs.gnu.org, acm@muc.de, hank.greenburg@protonmail.com Original-Received: via spool by 61436-done@debbugs.gnu.org id=D61436.169731254430166 (code D ref 61436); Sat, 14 Oct 2023 19:43:01 +0000 Original-Received: (at 61436-done) by debbugs.gnu.org; 14 Oct 2023 19:42:24 +0000 Original-Received: from localhost ([127.0.0.1]:50581 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrkWl-0007qT-MM for submit@debbugs.gnu.org; Sat, 14 Oct 2023 15:42:24 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:50126) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrkWh-0007qE-Q8 for 61436-done@debbugs.gnu.org; Sat, 14 Oct 2023 15:42:22 -0400 Original-Received: (qmail 5221 invoked by uid 3782); 14 Oct 2023 21:41:50 +0200 Original-Received: from acm.muc.de (pd953a921.dip0.t-ipconnect.de [217.83.169.33]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 14 Oct 2023 21:41:48 +0200 Original-Received: (qmail 11201 invoked by uid 1000); 14 Oct 2023 19:41:41 -0000 Content-Disposition: inline In-Reply-To: <8734yew8yr.fsf@sappc2.fritz.box> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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:272466 Archived-At: Hello, Jens and Mats. On Fri, Oct 13, 2023 at 22:42:04 +0200, Jens Schmidt wrote: > Hi Alan, > Alan Mackenzie writes: > > To solve the bug, I'm amending the macro c-beginning-of-defun-1 so that > > it only stops at a debug-prompt-regexp position when it also found a {. > > Otherwise it will keep looping until it finds a better position or BOB. > Thanks. > > Then please confirm that the bug is indeed fixed. > For the fun of it I tried Hank's initial testcase as well, which is a > bit less straight-forward to set up. The freezes are indeed gone with > your patch. Thanks for the testing. Seeing as how both of you confirm the original bug is fixed with the patch, I'm closing it with this post. > But I noticed that which-function-mode, when rapidly moving through > the file, cannot always determine the current function name, then > displaying "[n/a]" in the mode line. > And indeed, when executing the simplified test case > ./src/emacs -Q -l ~/tmp/init.el +181 ~/tmp/P1.java > and then immediately hitting C-M-a, point jumps to the beginning of the > preceeding catch clause (point=5779 of 18142) instead of BOD. I can't reproduce this, even when setting defun-prompt-regexp to the original large regexp from hui-select.el. > This behavior is again tied to the `defun-prompt-regexp' used by > Hyperbole - without that regexp C-M-a jumps to the real BOD. Mats, I'm willing to work on that regular expression, and also the one for C++. As I mentioned earlier, I've got some tools which work on regexps, in particular pp-regexp, which prints a regexp more readably on several lines, and fix-re, which rewrites a regexp when it is ill-conditioned in certain ways. I foresee reverse engineering the regexps into more readable forms built up by concatenating basic blocks. For example for the java regexp I would define (defconst id "[a-zA-Z][][_$.a-zA-Z0-9]*") , and use this id in a largish concat form. I'm also willing to share pp-regexp and fix-re with you(r team), if that might help, on the understanding that neither is of release quality. -- Alan Mackenzie (Nuremberg, Germany).