all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alan Mackenzie <acm@muc.de>
To: 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>, Robert Weiner <rswgnu@gmail.com>,
	Jens Schmidt <jschmidt4gnu@vodafonemail.de>
Subject: bug#61436: Emacs Freezing With Java Files
Date: Sun, 22 Oct 2023 14:15:08 +0000	[thread overview]
Message-ID: <ZTUubFvcv4LMfIW3@ACM> (raw)
In-Reply-To: <878r7voc6k.fsf@lidells.se>

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* "\\<throws\\>" 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* "\\<throws\\>" space* ids-with-dot-\[\]
                  "\\(?:," space* ids-with-dot-\[\] "\\)*"
            "\\)?"
            space*)))

> Yours
> -- 
> %% Mats

-- 
Alan Mackenzie (Nuremberg, Germany).





  reply	other threads:[~2023-10-22 14:15 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
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 [this message]
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZTUubFvcv4LMfIW3@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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.