From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Robert Weiner Newsgroups: gmane.emacs.bugs Subject: bug#61436: Emacs Freezing With Java Files Date: Sun, 15 Oct 2023 06:20:15 -0400 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="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3775"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Robert Weiner , Hank Greenburg , Mats Lidell , 61436-done@debbugs.gnu.org, Eli Zaretskii , Jens Schmidt To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 15 12:21:58 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 1qryFy-0000if-HL for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 15 Oct 2023 12:21:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qryFg-0003mv-E2; Sun, 15 Oct 2023 06:21:40 -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 1qryFe-0003mc-O1 for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2023 06:21:38 -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 1qryFe-0000T0-Fu for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2023 06:21:38 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qryG1-000613-IO for bug-gnu-emacs@gnu.org; Sun, 15 Oct 2023 06:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Weiner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 15 Oct 2023 10:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61436 X-GNU-PR-Package: emacs Original-Received: via spool by 61436-done@debbugs.gnu.org id=D61436.169736527723058 (code D ref 61436); Sun, 15 Oct 2023 10:22:01 +0000 Original-Received: (at 61436-done) by debbugs.gnu.org; 15 Oct 2023 10:21:17 +0000 Original-Received: from localhost ([127.0.0.1]:51266 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qryFI-0005zp-JK for submit@debbugs.gnu.org; Sun, 15 Oct 2023 06:21:16 -0400 Original-Received: from mail-ot1-x331.google.com ([2607:f8b0:4864:20::331]:40181) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qryFE-0005zb-IX for 61436-done@debbugs.gnu.org; Sun, 15 Oct 2023 06:21:15 -0400 Original-Received: by mail-ot1-x331.google.com with SMTP id 46e09a7af769-6bf106fb6a0so770651a34.0 for <61436-done@debbugs.gnu.org>; Sun, 15 Oct 2023 03:20:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697365242; x=1697970042; darn=debbugs.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=DelfcIMYUymT/6tEdEh8PmsQsVh2bREoDMjsnJkezko=; b=EwPsDKonSJS8iR68sIhOz/NEGn7A2NI9Flc8OBLaM6ppZFUe7Xqv7iopNgX791ZUu0 Mk+kkHS9XkmWIyxJQ0BIy7rYxu38ka/V00gf3FQnyxc8WdrzC9t5bVeByUUYliygT7fy AC3nKgmWiO796cOnazc21vAdYAcC0JiJOz0egZ+NsYJTcZtnf1yX7oXt/kQB3oDGQDlH Msxc8FZsifMfx+NDT39N1UegG+zKgBKOs9H8XM+uMsPr/czjvnWCA4tPb/TWI1UBhaAu Dr9W02Dp9rwqm/MRkdao++hhFAHbXt2weJmT5/I1FE/AtAkayizyVZR0w3bcP1UWlzmv XHWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697365242; x=1697970042; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=DelfcIMYUymT/6tEdEh8PmsQsVh2bREoDMjsnJkezko=; b=FTD74SFz+Peac716XbAQ8M/kduFEWo81Fyb397fD8OnGzSx+teW2XNLUUfifWnP9F9 DqXkH4waEXjdZfgOOX9koBkbJoKN1i+2Mp2igduPvTZNauBjtmT80fMXFd11ZbaCcg3S fjlXhR3wu4W8qmb8cB2Bo5X8m6KfmOCs5zIwPUcgxB/3gYbw3qGVWEcfAAdh5DtVz7R3 lilDYSu93eA7NiCCX5LilrTggfZ6FIwpMq47mZQK/CgCRvUEvMkWrSBKNPTYSLUMxpmv H+qqU5OE0Y+gQ3M85DDndyTyPMNiJs0IJXDeO5MdaFC4vwIIITNze4sXV2mhSRepQ6tj lLMQ== X-Gm-Message-State: AOJu0YxpPj4gYn8FA+e9sVw92YdCYQvZhHccCXCIrZz05qrTlB4lDvsW jaWoaW5gVGUDoR1o2G0Mf4Hg4N8eG8zbFa7gpvY= X-Google-Smtp-Source: AGHT+IGaepYLYIA5gLwa8zoN2dSUpyrR+R/CN5tQBPFAw8eVPqrsnp7OngJ6iq/R0yuGZilGEbC/5O9BGcZYo+u0P0o= X-Received: by 2002:a4a:b588:0:b0:578:c2af:45b5 with SMTP id t8-20020a4ab588000000b00578c2af45b5mr28948807ooo.0.1697365242602; Sun, 15 Oct 2023 03:20:42 -0700 (PDT) In-Reply-To: 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:272499 Archived-At: Hi Alan: Would be great if you can improve those two regexps. The only requirement is that they be able to recognize all defuns in the two languages as best a regexp can, so that the whole defun can be selected based on finding the opening brace regardless of coding style. Thanks. -- Bob > On Oct 14, 2023, at 8:41 PM, Alan Mackenzie wrote: > > =EF=BB=BFHello, 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=3D5779 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).