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: Wed, 17 Apr 2024 18:24:21 -0400 Message-ID: <916B3411-8FE7-4008-B60F-FE8078E9F796@gmail.com> References: Mime-Version: 1.0 (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="36466"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Hank Greenburg , Jens Schmidt , Eli Zaretskii , Mats Lidell , 61436@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Apr 18 00:25:08 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 1rxDiG-0009Fc-7m for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 18 Apr 2024 00:25:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rxDi0-0003kL-M2; Wed, 17 Apr 2024 18:24:52 -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 1rxDhz-0003kD-Qx for bug-gnu-emacs@gnu.org; Wed, 17 Apr 2024 18:24:51 -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 1rxDhz-00079F-HZ for bug-gnu-emacs@gnu.org; Wed, 17 Apr 2024 18:24:51 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rxDiC-0007By-0D for bug-gnu-emacs@gnu.org; Wed, 17 Apr 2024 18:25:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Weiner Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Apr 2024 22:25:03 +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-submit@debbugs.gnu.org id=B61436.171339270027601 (code B ref 61436); Wed, 17 Apr 2024 22:25:03 +0000 Original-Received: (at 61436) by debbugs.gnu.org; 17 Apr 2024 22:25:00 +0000 Original-Received: from localhost ([127.0.0.1]:48555 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxDi6-0007B7-MS for submit@debbugs.gnu.org; Wed, 17 Apr 2024 18:25:00 -0400 Original-Received: from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829]:41962) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rxDi0-00079R-42 for 61436@debbugs.gnu.org; Wed, 17 Apr 2024 18:24:55 -0400 Original-Received: by mail-qt1-x829.google.com with SMTP id d75a77b69052e-437618fb928so382451cf.3 for <61436@debbugs.gnu.org>; Wed, 17 Apr 2024 15:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1713392673; x=1713997473; darn=debbugs.gnu.org; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:from:to:cc:subject:date:message-id :reply-to; bh=OzGHsK6aiGbHZBa/4X2yRcDC0yMYh70NtCkPRnan4U4=; b=W5obFmMlNLme7kC8TH+wWDyJPGLBoinNJSlr/Ih750Zs0Nb3crNONdWAWCI8MEdQk3 0UC7qumLT3Hptkk+ieHSAxV8KyeW4izhosYSqy9L2RgyM3rDpn2z6VeB7IB2gUU+jDZm u10L2tNKlrd5zAbOVawFCI0j4ym+gacJi2q4Rd4gyxLRTmH+WqdOFUB5mqYnUJrEAbMf jZ6OFTc1TT9fgXSQkqzynjMs1bq2avS6/hfChK8ssdK+x7+AwY8Spzekua8ye3QuYbDK WAEEA6R+CJEFh6QtqSN5fs7fhuMSO0m0qIwn7/Lvoo2R5xP0o9EZ75+xEfmd/YhUCU37 5q4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713392673; x=1713997473; h=to:in-reply-to:cc:references:message-id:date:subject:mime-version :from:content-transfer-encoding:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=OzGHsK6aiGbHZBa/4X2yRcDC0yMYh70NtCkPRnan4U4=; b=Cfvdvc0Dt3q4bhulobWHSz9hYZAxH3l2aBPXDvy+KoVOsqm5kwldg3GG/eqMZZX3us VqbJhwf5t82oBE0QqF7INbouYNhu6Fo0GXN7nkHv/aqw5Hd6TYI2rbv0fRqASvLDZsoC m8tIuL5Zzk+Wj2/IN5PUfmRxOyRy6ythuMYFWrGxC+JICkUJMtMcsjv6TUVio++glHCN XHeReT9WwR832AjxOJgffy0UGkL74gq4wf5QRQJ3hrMxaR4rl1xxqBL7FaKnEBz0yZ45 uw3o4alzILLGGJIVnYfecAfW3PPFbUHkuYOteWA6dnkVAjnq4k5tZqQaZR6Hf+Du6xVN 1Zmw== X-Forwarded-Encrypted: i=1; AJvYcCVWEnx0OOEnN4N3nLGWeKSxskFh3pO7AFIloyDGrwclJwbYGHm3uG2LavEPga/YskfuLdZOgtHiYYCF5Z/Q/TumNveT6hU= X-Gm-Message-State: AOJu0YzdvCiO9FaV3YTS/BxE3GRQFZlNGTzPeR0kpP3+MhR5a+7M2RsV LGVRZdNzNcLtBiXQU6YRPr6ka0FVfZsraSo/tnMLV0zqnuokHutd X-Google-Smtp-Source: AGHT+IHUQJb81kYIN/2+Yw+jTDqutIUVyE002te3zmvZfzNOZG0O0xAivWKl2L88UhPRwveH9QQoLg== X-Received: by 2002:ad4:5c8f:0:b0:69b:ce6:271b with SMTP id o15-20020ad45c8f000000b0069b0ce6271bmr878279qvh.2.1713392673071; Wed, 17 Apr 2024 15:24:33 -0700 (PDT) Original-Received: from smtpclient.apple (ool-2f1480e0.dyn.optonline.net. [47.20.128.224]) by smtp.gmail.com with ESMTPSA id m14-20020a0c9d0e000000b00698e65cdfefsm67828qvf.87.2024.04.17.15.24.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 17 Apr 2024 15:24:32 -0700 (PDT) In-Reply-To: X-Mailer: iPhone Mail (21E236) 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:283526 Archived-At: Great, will do, thanks, Alan. -- Bob > On Apr 17, 2024, at 2:50=E2=80=AFPM, Alan Mackenzie wrote: >=20 > =EF=BB=BFHello again, Bob. >=20 >> On Wed, Apr 17, 2024 at 13:06:50 +0000, Alan Mackenzie wrote: >>> On Tue, Apr 16, 2024 at 21:35:59 -0400, Robert Weiner wrote: >>> Hi Alan: >>> I just re-read this whole thread and realized you resolved the problem= >>> for the Java defun-prompt-regexp but not the C++ >>> defun-prompt-regexp=C3=82 in Hyperbole's=C3=82 hui-select.el:L404 (pro= bably were >>> just tired after all of that). >>> Today, someone else reported that the C++ regexp=C3=82 was hanging the= ir >>> Emacs.=C3=82 Do you think you could pick this back up and rework the C= ++ >>> regexp=C3=82 as you did the Java one?=C3=82 It would be a big help; o= therwise, I >>> think we'll just have to disable that functionality in Hyperbole. >>> Best regards, >>> Bob >>> On Sun, Oct 22, 2023 at 1:18=C3=A2=C2=AFPM Mats Lidell >>> <[1]mats.lidell@lidells.se> wrote: >=20 >> Yes, I'll happily finish off that C++ regexp. I made considerable >> progress with it back in October, getting smething basically working but >> with some rough edges. One problem is that the regexp was ~1600 >> characters long. I don't know if this might make the program slow - >> possibly not. >=20 >> I've found the .el file I was working in, and located my notes from >> October. It's going to take longer than a day or two, but hopefully >> less than a week or two. >=20 > It was rather easier than I'd anticipated. There is my first attempt > below. It should find most C++ defun starts, but not all. In particlar > it won't recognise one with nested parens or nested template delimiters; > regexps cannot handle arbitrary nesting,and it didn't seem worth the > trouble to code in a small bounded degree of nesting, though this surely > could be done if I'm wrong, here. >=20 > The regexp is not small. At the latest count it was 2,223 characters > long. I hope this won't affect performance too much. >=20 > Please try out this regexp, and let me know how well it's working. > Thanks! >=20 >> [ .... ] >=20 >=20 >=20 > (defconst c++-defun-prompt-regexp > (let* > ((space* "[ \t\n\r\f]*") > (space+ "[ \t\n\r\f]+") > (ad-hoc-requires-clause > (concat "\\(?:requires" space* "[][()<> \t\n\r\f_$a-zA-Z0-9&|\"'+=3D.,*= :~-]+" space* "\\)?")) > (id (concat "[_$~a-zA-Z][_$a-zA-Z0-9]*") > ;; (concat "\\(\\(~" space* "\\)?" "\\([_$a-zA-Z][_$a-zA-Z0-9]*\\)\\= )") > ) > (template-brackets "\\(?:<[^;{}]*>\\)") > (id-<> (concat id "\\(?:" space* template-brackets "\\)?")) > (id-:: (concat id-<> "\\(?:" space* "::" space* id-<> "\\)*")) > (paren-exp "([^{};]*)") > (template-exp\? (concat "\\(?:template" space* template-brackets spa= ce* "\\)?")) > (type-prefix-modifier* (concat "\\(?:\\(?:" > "\\(?:\\ "\\|" > (regexp-opt '("auto" "const" "explicit" "extern" > "friend" "inline" "mutable" > "noexcept" "overload" > "register" "static" "typedef" > "virtual" "volatile") > 'words) > "\\)" > space+ > "\\)*")) > (type-exp (concat > "\\(?:\\(?:" template-brackets space* "\\)?" > type-prefix-modifier* > "\\(?:\\(?:decltype" space* paren-exp space* "\\)" > "\\|" > "\\(?:" > "\\(?:class\\|enum\\|struct\\|typename\\|union\\)" > "\\(?:" space* "\\.\\.\\.\\)?\\)" > space+ id space* > "\\(?::" id-:: space* "\\)?" > "\\|" > id-:: space* > "\\)" > "\\)\\{1,2\\}")) > (type-mid-modifier* (concat "\\(?:" > (regexp-opt > '("auto" "consteval" "constexpr" > "constinit" "explicit" > "extern" "friend" "inline" > "mutable" "noexcept" "register" > "static" "template" > "thread_local" "throw" > "virtual" "volatile") > 'words) > space+ "\\)*")) > (operator-exp (concat "\\(?:operator\\>" space* > "\\(?:[][a-z_+*/%^?&|!~<>,:=3D-]+" > "\\|()\\|\"\"" > "\\)" space* > "\\)")) >=20 > (name-exp ; matches foo or (* foo), etc. > (concat "\\(?:(" space* "[*&]+" space* id-:: space* "[][()]*" ")" > "\\|\\(?:[*&]+" space* "\\)?" id-:: > "\\)" space*)) > (type-suffix-modifier* (concat "\\(?:" > (regexp-opt > '("auto" "const" "noexcept" > "requires" "throw" "volatile") > 'words) > space+ "\\)*")) > (post-paren-modifier* (concat "\\(?:" > (regexp-opt > '("const" "final" "override" > "mutable") > 'words) > space* "\\)*"))) >=20 > (concat template-exp\? > "\\(?:" ad-hoc-requires-clause "\\)?" > type-exp > type-mid-modifier* > "\\(?:" operator-exp "\\|" name-exp "\\)" > type-suffix-modifier* > paren-exp space* > "\\(?:->" space* type-exp "\\)?" > post-paren-modifier* > "{")) >=20 >=20 > -- > Alan Mackenzie (Nuremberg, Germany).