unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#37943: assoc-default is wrongly flagged as side-effect-free.
@ 2019-10-27 12:24 Alan Mackenzie
  2019-10-28 15:24 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Mackenzie @ 2019-10-27 12:24 UTC (permalink / raw)
  To: 37943

Hello, Emacs.

Emacs 27.

In the source for assoc-default (in subr.el) appears

    (declare (side-effect-free t))

.  This is not true when the TEST argument to assoc-default itself
changes the match-data.

I suggest removing this declaration from the function rather than
amending the code with a save-match-data.  There are calls to
assoc-default in set-auto-mode where the caller relies on the match data
set by the function when TEST is string-match.  :-(

-- 
Alan Mackenzie (Nuremberg, Germany).





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-26  9:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-27 12:24 bug#37943: assoc-default is wrongly flagged as side-effect-free Alan Mackenzie
2019-10-28 15:24 ` Lars Ingebrigtsen
2020-08-25 23:32   ` Stefan Kangas
2020-08-26  9:28     ` Lars Ingebrigtsen

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).