GNU bug report logs - #31586
27.0.50; `frame-title-format' doesn't save match data

Previous Next

Package: emacs;

Reported by: Philipp <p.stephani2 <at> gmail.com>

Date: Thu, 24 May 2018 21:57:04 UTC

Severity: wishlist

Merged with 33697

Found in versions 26.1, 27.0.50

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

Full log


Message #20 received at 31586 <at> debbugs.gnu.org (full text, mbox):

From: Drew Adams <drew.adams <at> oracle.com>
To: Stefan Monnier <monnier <at> IRO.UMontreal.CA>, Eli Zaretskii <eliz <at> gnu.org>
Cc: p.stephani2 <at> gmail.com, 31586 <at> debbugs.gnu.org
Subject: RE: bug#31586: 27.0.50; `frame-title-format' doesn't save match data
Date: Sun, 27 May 2018 18:40:43 -0700 (PDT)
> >> Elisp code
> >> should never presume that the match-data is preserved across something
> >> like sit-for, read-char, or any other function which can run process
> >> filters, redisplay, timers, or contains a yield-point.
> > Is this practical?  We have any number of hooks, advices, and other
> > means to make arbitrary Lisp run almost off any function call.  Given
> > that redisplay can be entered by such Lisp by calling 'redisplay' or
> > 'message' or one of the other functions you mentioned, your suggestion
> > would mean we need to save-match-data around any call to any
> > function.  That would make our code very cluttered, indeed.
> 
> That's how we've lived so far, except that the need for save-match-data
> is not around "any" call, but only around "any call except for <...>"
> where <...> is the set of "primitive enough" functions.  The main
> problem so far is that this set is not formally defined (and also that
> the byte-compiler doesn't warn you if you use a function outside of this
> set without wrapping with save-match-data), but other than that it works
> well in practice, because in 99% there is *very* little code executed
> between a regexp match and the use of the match-data.

Would it make sense to "formalize" this a bit, by having an
explicit such list of the functions (those "primitive enough"
to never, or perhaps hardly ever, need wrapping with `s-m-d')?

Even if such a list were not consulted by any code (and it
could be, presumably, for some control somewhere), it might
at least help developers and users by letting them know what
the story is.

Just a thought.




This bug report was last modified 3 years and 16 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.