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: Sun, 22 Oct 2023 14:15:08 +0000 Message-ID: References: <87r0m1t0el.fsf@sappc2.fritz.box> <875y3bbokx.fsf@sappc2.fritz.box> <8734yew8yr.fsf@sappc2.fritz.box> <878r7voc6k.fsf@lidells.se> 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="26549"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Robert Weiner , Hank Greenburg , 61436-done@debbugs.gnu.org, acm@muc.de, Eli Zaretskii , Robert Weiner , Jens Schmidt To: Mats Lidell Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Oct 22 16:15:52 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 1quZFA-0006nx-Pn for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 22 Oct 2023 16:15:52 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quZEt-0007Eg-IV; Sun, 22 Oct 2023 10:15:35 -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 1quZEr-0007Di-V7 for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2023 10:15:34 -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 1quZEr-0001CP-Mp for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2023 10:15:33 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1quZFJ-0004nz-RG for bug-gnu-emacs@gnu.org; Sun, 22 Oct 2023 10:16:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 22 Oct 2023 14:16: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.169798415318448 (code D ref 61436); Sun, 22 Oct 2023 14:16:01 +0000 Original-Received: (at 61436-done) by debbugs.gnu.org; 22 Oct 2023 14:15:53 +0000 Original-Received: from localhost ([127.0.0.1]:47883 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quZFA-0004nU-Bp for submit@debbugs.gnu.org; Sun, 22 Oct 2023 10:15:52 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:43817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quZF4-0004n6-Gv for 61436-done@debbugs.gnu.org; Sun, 22 Oct 2023 10:15:50 -0400 Original-Received: (qmail 67533 invoked by uid 3782); 22 Oct 2023 16:15:11 +0200 Original-Received: from acm.muc.de (p4fe15a7d.dip0.t-ipconnect.de [79.225.90.125]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 22 Oct 2023 16:15:10 +0200 Original-Received: (qmail 21494 invoked by uid 1000); 22 Oct 2023 14:15:08 -0000 Content-Disposition: inline In-Reply-To: <878r7voc6k.fsf@lidells.se> 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:272978 Archived-At: Hello, Mats. On Sun, Oct 22, 2023 at 00:14:43 +0200, Mats Lidell wrote: > Hi Alan, > Sorry for coming back late to this issue but today I tried to use the > suggested regexp and got into some problems doing that. Sorry about that. > > Alan Mackenzie writes: > > Here's the regexp. Would people please try it out and let me know how > > well it works. > > > > (defconst java-defun-prompt-regexp > > (let ((space* "[ \t\n\r\f]*") > > (space+ "[ \t\n\r\f]+") > > (modifier* > > (concat "\\(?:" > > (regexp-opt '("abstract" "const" "default" "final" "native" > > "private" "protected" "public" "static" > > "strictfp" "synchronized" "threadsafe" > > "transient" "volatile") > > 'words) ; Compatible with XEmacs > > space+ "\\)*")) > > (ids-with-dots "[_$a-zA-Z][_$.a-zA-Z0-9]*") > > (ids-with-dot-\[\] "[[_$a-zA-Z][][_$.a-zA-Z0-9]*") > > (paren-exp "([^);{}]*)") > > (generic-exp "<[^(){};]*>")) > > (concat "^[ \t]*" > > modifier* > > "\\(?:" generic-exp space* "\\)?" > > ids-with-dot-\[\] space+ ; first part of type > > "\\(?:" ids-with-dot-\[\] space+ "\\)?" ; optional second part of type. > > "\\(?:[_a-zA-Z][^][ \t:;.,{}()=<>]*" ; defun name > > "\\|" ids-with-dot* > > "\\)" space* > > paren-exp > > "\\(?:" space* "]\\)*" ; What's this for? > > "\\(?:" space* "\\" space* ids-with-dot-\[\]s* > > "\\(?:," space* ids-with-dot-\[\]s* "\\)*" > > "\\)?" > > space*))) > Can there be some typos in there or missing lines? I get a compiler warning > for space+ being used in the let, should it be a let*? ids-with-dots is > reported as not used. Can it be meant to be ids-with-dot*? > ids-with-dot-\[\]s* is undefined!? No, the regexp just wasn't tested right. I made the mistake in "testing" it of having all the things like space+ already defined as defconsts. So I failed to pick up the let which should have been let* and giving all the uses of the bound variables their actual names. :-( Can I ask you to delete that buggy version and try the following instead? Thanks! (defconst java-defun-prompt-regexp (let* ((space* "[ \t\n\r\f]*") (space+ "[ \t\n\r\f]+") (modifier* (concat "\\(?:" (regexp-opt '("abstract" "const" "default" "final" "native" "private" "protected" "public" "static" "strictfp" "synchronized" "threadsafe" "transient" "volatile") 'words) ; Compatible with XEmacs space+ "\\)*")) (ids-with-dots "[_$a-zA-Z][_$.a-zA-Z0-9]*") (ids-with-dot-\[\] "[[_$a-zA-Z][][_$.a-zA-Z0-9]*") (paren-exp "([^);{}]*)") (generic-exp "<[^(){};]*>")) (concat "^[ \t]*" modifier* "\\(?:" generic-exp space* "\\)?" ids-with-dot-\[\] space+ ; first part of type "\\(?:" ids-with-dot-\[\] space+ "\\)?" ; optional second part of type. "\\(?:[_a-zA-Z][^][ \t:;.,{}()=<>]*" ; defun name "\\|" ids-with-dots "\\)" space* paren-exp "\\(?:" space* "]\\)*" ; What's this for? "\\(?:" space* "\\" space* ids-with-dot-\[\] "\\(?:," space* ids-with-dot-\[\] "\\)*" "\\)?" space*))) > Yours > -- > %% Mats -- Alan Mackenzie (Nuremberg, Germany).