Subject: Re: bug#78608: 31.0.50; Todo mode bug revealed by setq-default change

From: Eli Zaretskii <[email-masked]>
Date: Wed, 28 May 2025 21:28:22 +0300

> From: Stefan Monnier <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Wed, 28 May 2025 12:59:52 -0400
> 
> >>  * Incompatible Lisp Changes in Emacs 31.1
> >>  
> >> +** 'setq-local' computes the value before making the variable local.
> >> +The previous code made the variable buffer local before
> >> +computing the value to assign to it.
> >> +This bug fix is a subtle change to the semantics which should make
> >> +no difference to the vast majority of uses but can occasionally affect
> >> +code in surprising ways if the computation of the value refers to the
> >> +variable.
> >
> > I think this should describe the case upon which Stephen stumbled:
> > code which uses setq-local inside a let-binding (perhaps an implicit
> > one, such as the one the various with-SOMETHING macros do), and
> > expects the buffer-local value to stay after the let-binding is
> > exited.
> 
> Maybe you should write it, then because you seem to understand that case
> better than I (I did look at the code to try and figure out what was the
> specific origin of the problem but .. failed).  But note that it's only
> one case that can be affected, there are others.

Stephen, would you mind explaining in more detail what in that commit
caused the regression on the master branch?  I'd like us all to be on
the same page before we decide how (and whether) to document it.

Thanks.