[Top][All Lists]

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

Re: Customize and autoloaded libraries

From: Per Abrahamsen
Subject: Re: Customize and autoloaded libraries
Date: Tue, 04 Dec 2001 19:22:13 +0100
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i686-pc-linux-gnu)

"Stefan Monnier" <monnier+gnu/address@hidden> writes:

>> Richard Stallman <address@hidden> writes:
>> >     2. Invent a `defhook' declaration for hooks, which is like defcustom
>> >        but allows merging the same way as add-hook.  I wanted to do that
>> >        originally, but couldn't come up with a good design.
>> >
>> > I think this general idea is the best solution.  I am not sure we
>> > need to have a separate `defhook' function though.
>> We could have some ad-hoc code in defcustom that checked whether the
>> :type was set to "hook".
> Indeed. `defcustom' for a hook could append the current value
> (or nil if unbound) and the custom-set-value (instead of only using
> custom-set-value if the variable is not bound yet.
> Since you say that you couldn't come up with a good design, there
> must be a problem with this approach, tho.

As simple as a different default value for :initialize?

That idea is not my design, it is yours.  It should be much simpler
and safer than changing add-hook as I suggested, and it should have
the same benefit (allowing non-nil default values).

The UI would warn that the hook has been "changed outside customize",
which I assume is correct if we want the behaviour (of Lisp packages
setting user options) to continue to be deprecated.

If it works, I think it still would be a cleaner API if this was done
with a `defhook' declaration, rather than having :type specific code
in `defcustom'.

reply via email to

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