From: Alan Mackenzie <acm@muc.de>
To: Jens Schmidt <jschmidt4gnu@vodafonemail.de>,
Mats Lidell <mats.lidell@lidells.se>
Cc: Robert Weiner <rsw@gnu.org>,
Hank Greenburg <hank.greenburg@protonmail.com>,
61436-done@debbugs.gnu.org, acm@muc.de,
Eli Zaretskii <eliz@gnu.org>,
rswgnu@gmail.com
Subject: bug#61436: Emacs Freezing With Java Files
Date: Sat, 14 Oct 2023 19:41:41 +0000 [thread overview]
Message-ID: <ZSru9aiO614QDrR5@ACM> (raw)
In-Reply-To: <8734yew8yr.fsf@sappc2.fritz.box>
Hello, Jens and Mats.
On Fri, Oct 13, 2023 at 22:42:04 +0200, Jens Schmidt wrote:
> Hi Alan,
> Alan Mackenzie <acm@muc.de> 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).
next prev parent reply other threads:[~2023-10-14 19:41 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-11 18:16 bug#61436: Emacs Freezing With Java Files Hank Greenburg via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-12 0:24 ` Hank Greenburg via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-12 6:30 ` Eli Zaretskii
2023-02-12 16:52 ` Hank Greenburg via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-12 17:05 ` Eli Zaretskii
2023-02-12 17:11 ` Hank Greenburg via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-09 20:26 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-10 20:58 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-11 7:28 ` Mats Lidell via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-11 10:17 ` Robert Weiner
2023-10-11 19:38 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-11 20:07 ` Robert Weiner
2023-10-11 21:43 ` Mats Lidell via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-11 22:03 ` Alan Mackenzie
2023-10-12 19:58 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-13 12:41 ` Alan Mackenzie
2023-10-13 18:02 ` Mats Lidell via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-13 20:42 ` Jens Schmidt via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-14 19:41 ` Alan Mackenzie [this message]
2023-10-15 10:20 ` Robert Weiner
2023-10-16 14:05 ` Alan Mackenzie
2023-10-16 19:10 ` Robert Weiner
2023-10-21 22:14 ` Mats Lidell via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-22 14:15 ` Alan Mackenzie
2023-10-22 17:17 ` Mats Lidell via Bug reports for GNU Emacs, the Swiss army knife of text editors
[not found] ` <CA+OMD9hgM_NX7GmeW8ph5fBW6SkFGogf4W4JOO5o62H3X15WHw@mail.gmail.com>
2024-04-17 13:22 ` Alan Mackenzie
[not found] ` <Zh_JagP5xaaXJMOo@ACM>
2024-04-17 18:50 ` Alan Mackenzie
2024-04-17 22:24 ` Robert Weiner
2024-04-19 2:19 ` Robert Weiner
2024-04-19 4:40 ` Robert Weiner
2024-04-19 15:59 ` Alan Mackenzie
2024-04-19 2:58 ` Robert Weiner
2023-02-12 6:00 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZSru9aiO614QDrR5@ACM \
--to=acm@muc.de \
--cc=61436-done@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=hank.greenburg@protonmail.com \
--cc=jschmidt4gnu@vodafonemail.de \
--cc=mats.lidell@lidells.se \
--cc=rsw@gnu.org \
--cc=rswgnu@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).