From: Tassilo Horn <tsdh@gnu.org>
To: Tom Tromey <tom@tromey.com>
Cc: Basil Contovounesios <contovob@tcd.ie>,
Eli Zaretskii <eliz@gnu.org>,
61395@debbugs.gnu.org
Subject: bug#61395: 28.2; bug-reference warning seems incorrect
Date: Fri, 10 Feb 2023 18:21:09 +0100 [thread overview]
Message-ID: <87357dxvax.fsf@gnu.org> (raw)
In-Reply-To: <87h6vtjxjp.fsf@tromey.com>
Tom Tromey <tom@tromey.com> writes:
>> I'll have a look later today!
>
> It seems difficult to reproduce. I can't do it reliably.
>
> My co-worker Kévin suggested that perhaps the problem is here, in
> bug-reference-fontify:
>
> (while (and (< (point) end-line)
> (re-search-forward bug-reference-bug-regexp end-line 'move))
> (when (or (not bug-reference-prog-mode)
> ;; This tests for both comment and string syntax.
> (nth 8 (syntax-ppss)))
>
> ... with the question being whether the call to syntax-ppss needs to
> be wrapped in save-match-data.
Hm, I've tried somthing like
(while (re-search-forward "\\(NILP\\)\\(.*\\)$" nil t)
(syntax-ppss-flush-cache (point-min))
(let ((md (match-data)))
(syntax-ppss)
(unless (equal md (match-data))
(error "Match-data clobbered: %S %S" md (match-data)))))
many times in buffer.c but `syntax-ppss' doesn't seem to clobber
match-data.
If you can reproduce the issue, try changing
`bug-reference--overlay-bounds' so that the check
(member bug-reference-bug-regexp
bug-reference--nonconforming-regexps)
isn't performed inhibiting the warning for this regexp and add some more
info to the warning message like (match-string N) for N in 0..9. If the
match-data isn't about matches of `bug-reference-bug-regexp', we are on
the right track, i.e., someone clobbers our match data.
Bye,
Tassilo
next prev parent reply other threads:[~2023-02-10 17:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-09 19:08 bug#61395: 28.2; bug-reference warning seems incorrect Tom Tromey
2023-02-10 8:25 ` Eli Zaretskii
2023-02-10 15:02 ` Basil Contovounesios via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-10 15:54 ` Tassilo Horn
2023-02-10 16:27 ` Tom Tromey
2023-02-10 17:21 ` Tassilo Horn [this message]
2023-02-10 18:10 ` Tom Tromey
2023-02-10 18:15 ` Tassilo Horn
2023-02-10 18:32 ` Tom Tromey
2023-02-11 9:33 ` Kévin Le Gouguec
2023-02-11 15:56 ` Tom Tromey
2023-02-10 18:25 ` Tom Tromey
2023-02-10 16:41 ` Tom Tromey
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=87357dxvax.fsf@gnu.org \
--to=tsdh@gnu.org \
--cc=61395@debbugs.gnu.org \
--cc=contovob@tcd.ie \
--cc=eliz@gnu.org \
--cc=tom@tromey.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).