emacs-devel
[Top][All Lists]
Advanced

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

RE: `customize-customized' and mode variable of a minor mode


From: Drew Adams
Subject: RE: `customize-customized' and mode variable of a minor mode
Date: Fri, 6 Apr 2007 14:14:45 -0700

> > Toggling a mode changes the value of the mode variable. Why would a user
> > want to save that new value? You might toggle a (global) minor
> > mode several times during an Emacs session. Turning the mode on and
> > off doesn't imply that you want to change the saved value. I don't see
> > a use case for that.
>
> If the global minor mode is at the state currently saved by Custom it
> will not show up in customize-customized.

True, and if it happens to be in the opposite state, then it will show up.

> I often put toggling of global minor modes in the menus.

So do I.

> It seems conventient to me to be able to save the state of those
> minor modes through customize-customized then.

I can see the use case you describe. I guess it depends on the use pattern
and the nature of the global minor mode. At least some mode toggling is not
tentative configuring, and at least some people might not want some mode
changes to be candidates for saving.

There may be no good way to satisfy all use scenarios and user preferences
for this. Another user option perhaps?

A mode variable does two things: 1) its saved value records your preference
for mode initialization, and 2) its current value reflects the state of the
mode (on or off). We could separate these two roles, using two different
variables: one, which is not customizable, to reflect the current state, and
another, which is customizable, to record the initial value.

But then `customize-customized' would not recognize the current mode state
and ask if you want to save it, so that wouldn't satisfy the use case you
mention.

Perhaps it comes down more to how `customize-customized' is invoked. If a
user specifically asks to see all changes, with an eye to saving some to
configure Emacs, then mode variables should be included. If a user uses
`customize-customized' in `kill-emacs-query-functions', then maybe mode
variables should be excluded. In this latter use, `customize-customized' is
invoked just as a safety measure, a la modified buffers in
`save-buffers-kill-emacs'.






reply via email to

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