Subject: bug#26624: 26.0.50; Generalized variable `buffer-local-value' does't restore local flag

From: Lars Ingebrigtsen <[email-masked]>
Date: Mon, 22 Aug 2022 12:10:43 +0200

Michael Heerdegen <[email-masked]> writes:

>> (define-minor-mode electric-indent-local-mode
>>   "Toggle `electric-indent-mode' only in this buffer."
>>   :variable (buffer-local-value 'electric-indent-mode (current-buffer))
>>
>> Rewriting this to avoid this is slightly cumbersome, it turns out.
>
> Why not use the (GET . SET) syntax for :variable?

Let's see...  would this work?

:variable (electric-indent-mode .
           (lambda (val) (setq-local electric-indent-mode val)))