[Top][All Lists]

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

RE: toggling a minor mode should not tell Customize that the value has b

From: Drew Adams
Subject: RE: toggling a minor mode should not tell Customize that the value has been set
Date: Sun, 6 Jan 2008 00:01:12 -0800

> > `define-minor-mode' adds this code to the definition of every
> > minor mode:
> > (if (called-interactively-p)
> >     (progn
> >       ,(if globalp `(customize-mark-as-set ',mode)) ; <=== WHY?
> Because M-x foo-mode RET on such global minor-modes isn't much different
> from M-x customize-variable RET foo-mode RET .... -> Set for
> current session.

"isn't much different"  How so? What do you mean by that?

Obviously, if the code calls `customize-mark-as-set' then they are similar.
But _why_ should they be treated similarly? That is the question.

Logically and a priori, it isn't much the _same_, I'd say.

> > What was the rationale behind this behavior? Why should toggling
> The rationale is that Custom does not like it when Elisp code modifies
> a defcustom behind its back.

Modifies a defcustom? What does that mean?

Changing the value of a variable that happens to be defined by defcustom is
not the same thing as setting it by Customize or for Customize. And it
shouldn't be the same thing.

Why should toggling a minor mode be tantamount to customizing its variable?

And if it should for some reason, then why distinguish between global and
local modes in this regard?

> If we don't do it, then Custom will simply tell you that the variable
> was set outside of Custom and that saving the var may hence not have
> the expected effect.

But that's what happened: the value was changed outside Customize.

If you ask Customize for what was changed outside Customize, this variable
should show up. But if you ask Customize for what was customized but not
saved (`customize-customized'), this should not show up.

At least that's the way it seems to me. You haven't given any argument to
the contrary that might change my mind. Why should toggling a mode variable
be considered the same as customizing it?

> > A user should be able to use `customize-customized' (including
> > perhaps in `kill-emacs-query-functions') to see what s?he has
> > customized and might want to save.
> Exactly, after trying our M-x iswtchb-mode RET she may very much like to
> see that iswitchb-mode is now eabled and that she could save it so that
> it's enabled next time around.

"May?" This design is based only on that _possibility_?

Why assume that about what the user wants? Why not let the user decide? If
that is what s?he wants, s?he can simply use Customize to set anything that
s?he might later want to save.

It think it is far more likely that someone will toggle a mode on and off
occasionally, without that action implying that s?he would want to save its
last value.

A toggle is, well, a toggle - something designed to be turned on and off -
and often more than once. If a mode variable were simply a boolean
preference that one sets once and for all, then there would be no need for a
command to toggle it.

I expect that we will see more and more use of global minor modes (as well
as local ones) in the future, and I think (at least until I see a good
argument to the contrary) that this automatic customizing behavior is
obstructive - simply not TRT.

WDOT? Does this sound like a good idea to you? To me it seems very wrong.

reply via email to

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