emacs-devel
[Top][All Lists]
Advanced

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

Re: doc elisp intro cross reference fixes


From: Stefan Monnier
Subject: Re: doc elisp intro cross reference fixes
Date: 30 Nov 2003 16:08:32 -0500
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

>>> Maybe one needs to think more radical thoughts: Where is the sense in
>>> allowing me to do (setq global-font-lock-mode t) even though it has no
>>> effect?
>> 
>> Do you really mean `setq' (i.e. something outside custom or even
>> outside set-variable) ?

> Yes.

I still have trouble believe it, since in the rest of the message I get the
impression that you consider set-variable and setq as being almost
the same.  `set-variable' is much closer to customize-variable (and we
pretty much agreed in this thread that it should be made closer by paying
attention to setter functions).

>> Furthermore, AFAIK, custom already does not need the variable: if you
>> provide a setter and a getter that don't use the variable, it won't
>> use the variable.  There might be a few places in custom where
>> this is not quite true but it should be easy to fix.

> Well, IIUC, M-x customize-variable RET global-font-lock-mode RET is
> how people frob that setting, isn't it?  And if the variable went
> away, people couldn't type that anymore.  That's what I meant with
> "need".

And what I said is that even if the variable went away they still could,
because custom does not have to pay any attention to the variable: it
just calls the getter and setter and looks at properties of the symbol.

> Now one thing that could be done is to change Emacs such that the
> setter function is called more often (eg, the setter function could be
> called by set-variable).  Then, tweaking the option via custom and
> tweaking the option another way works similarly -- by changing the
> variable.

Right, that's one of things we almost agreed on in this thread (I
personally don't care whether set-variable calls the setter or not,
but it needs to pay attention to it and either call it or tell the
user that maybe he's not doing what he thinks he is).

> But another thing that could be done is to change Emacs such that the
> variable isn't used as the custom interface anymore.

It's not use as such: only the symbol is used, not the variable (i.e.
not the variable slot of the symbol).

> Instead of "setting a variable" via custom, people would "turn on a hook"
> via custom.  Custom could write (foo-minor-mode 1) or (foo-minor-mode -1)
> into the .emacs file, depending on the setting.

Custom could already do that.  I happen to think it should, but I haven't
written the code to do it (it's a bit tricky since custom needs to
be able to recognize it as a setting so it knows the state saved in the
.emacs file).


        Stefan




reply via email to

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