GNU bug report logs - #78608
31.0.50; Todo mode bug revealed by setq-default change

Previous Next

Package: emacs;

Reported by: Stephen Berman <stephen.berman <at> gmx.net>

Date: Tue, 27 May 2025 15:55:02 UTC

Severity: normal

Found in version 31.0.50

Done: Stephen Berman <stephen.berman <at> gmx.net>

Full log


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

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Stephen Berman <stephen.berman <at> gmx.net>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 78608 <at> debbugs.gnu.org
Subject: Re: bug#78608: 31.0.50; Todo mode bug revealed by setq-default change
Date: Sat, 31 May 2025 12:50:57 -0400
> In short: with `setq-local' in master, if you do this:
>
>    (setq-local var (setq var val))
>
> within a `with-current-buffer' form, then `val' survives after exiting
> the form, but not if you do this:
>
>    (setq-local var val)
>
> In emacs-30, `val' does not survive in either case.  I think this
> difference is what Stefan was referring by "can occasionally affect code
> in surprising ways if the computation of the value refers to the
> variable."

In the original problem that prompted the fix to `setq-local`, I think
there was no `setq` involved, but "refers to the variable" is probably
too vague (and suggests that merely asking for the var's value could
also be affected, which I believe is not the case).  So maybe:

    ... can occasionally affect code in surprising ways if the
    computation of the value itself modifies the variable.

where "modifies" could be a `defvar`, `setq`, `let`, ...

> But Stefan, when you said you failed to "figure out what was the
> specific origin of the problem" in the todo-mode case, did you mean
> something else than using `setq' within `setq-local'?

No, the "`setq' within `setq-local'" is the part that I failed to figure
out, thanks.


        Stefan





This bug report was last modified 20 days ago.

Previous Next


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