Subject: bug#79412: 30.2; `define-globalized-minor-mode' does not respect `:variable'

From: Eli Zaretskii <[email-masked]>
Date: Sat, 13 Sep 2025 19:18:44 +0300

> From: Stefan Monnier <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Sat, 13 Sep 2025 12:14:53 -0400
> 
> > So you mean this:
> >
> > diff --git a/lisp/emacs-lisp/easy-mmode.el b/lisp/emacs-lisp/easy-mmode.el
> > index ca92130..de77eb3 100644
> > --- a/lisp/emacs-lisp/easy-mmode.el
> > +++ b/lisp/emacs-lisp/easy-mmode.el
> > @@ -570,7 +570,7 @@ define-globalized-minor-mode
> >  	 (dolist (buf (buffer-list))
> >  	   (with-current-buffer buf
> >               (if ,global-mode (funcall ,turn-on-function)
> > -               (when ,mode (,mode -1)))))
> > +               (when ,mode (,MODE-variable -1)))))
> >           ,@body)
> >  
> >         ,(when predicate
> 
> No, like
> 
>     (when ,MODE-variable (,mode -1))

And what about this one:

	 ;; Go through existing buffers.
	 (dolist (buf (buffer-list))
	   (with-current-buffer buf
             (if ,global-mode (funcall ,turn-on-function)
               (when ,mode (,MODE-variable -1)))))
         ,@body)