bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#32643: 26; minor-mode variables


From: Drew Adams
Subject: bug#32643: 26; minor-mode variables
Date: Sat, 8 Sep 2018 06:58:24 -0700 (PDT)

>   > Why should it not have a variable
>   > Why should `auto-fill-mode' be an exception?
> 
> Because it isn't straightforward to do that.
> 
> It may be possible with some work.
> Would you like to write the change?

Noam's message points out the use of :variable in defining this minor mode. I 
don't understand `define-minor-mode' and its :variable
enough to propose a simple fix. Maybe someone else does?

In this case, the PLACE value of `:variable PLACE' is this generalized
variable:

(auto-fill-function
  . (lambda (v) (setq auto-fill-function
       (if v normal-auto-fill-function))))

Is there a way, for example, to defvaralias `auto-fill-mode' to
`auto-fill-function' (or vice versa), so that that :variable value
would somehow have the effect of automatically keeping
`auto-fill-mode' updated to the same value? Or some other
wayt to easily accomplish the same thing?

If there is no straightforward way to get `auto-fill-mode' to
remain synced with `auto-fill-function', and if it's necessary
to have two separate variables, then OK, for this particular
variable.

As I said earlier, it's good that the doc string, at least, makes
clear that non-nil `auto-fill-function' means the mode is on.

The bug report is more general, asking generally about minor
modes that have no mode variable, and what reasons/criteria
there might be for such cases. This one apparently has a
reason - it is not just a "historical accident". Dunno whether
there are others that could just have their variables defined
with no complications.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]