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: Kai Grossjohann
Subject: Re: doc elisp intro cross reference fixes
Date: Mon, 01 Dec 2003 21:14:43 +0000
User-agent: Gnus/5.1003 (Gnus v5.10.3) Emacs/21.2 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>>> 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.

Sorry, I still said something misleading.  I didn't know that Custom
only looked at 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).

Yes, that's one way to do it.  Is it the only one?

>> 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).

But to the user, it looks like setting a variable:

M-x customize-variable RET scroll-step RET
M-x customize-variable RET global-font-lock-mode RET

The former is just a pretty interface to setting a variable, the
latter is a pretty interface to the global-font-lock-mode function.
The only way for a user to see that they are different is from the
name of the variable.

Maybe it's my view at things.  For me, Custom is a pretty interface
for things people do in their .emacs files.  And setq is one of them,
whereas add-hook and define-key are others.  It looks a lot like
customize-variable is the pretty interface to setq, whereas pretty
interfaces to add-hook and define-key are lacking.  And once you add
pretty interfaces to add-hook and define-key, you can also add a
pretty interface to turning on/off modes.

I even asked for being able to add comments to custom settings, since
";;" is also often used in my .emacs file ;-)


It's quite possible that this is a bad way at looking at it.  What's
the way you look at it?


>> Instead of "setting a variable" via custom, people would "turn on a hook"

Eek.  I meant "turn on a mode", not "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).

Cool.

Kai





reply via email to

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