emacs-devel
[Top][All Lists]
Advanced

[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 17:45:28 +0100
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i686-pc-linux-gnu)

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

> Instead of merging, maybe we could arrange for add-to-hook to cause
> the autoloading and processing of the defcustom, first thing.  That
> could avoid the need for any actual merging of values.  Ok?

If you mean `add-hook', I believe this solution is brilliant.  It will
also make it possible to have default values (other than nil) for
hooks, something you can't safely do today.

The downside is that simply putting an add-hook in your ".emacs" may
cause a package to become loaded (but using customize to add the hook
won't make the package loaded at start).

A variant would be to change add-hook so it added the hook to some
symbol property, and the actual value of the hook wasn't affected
under the hook was declared with defcustom, or ran with run-hooks (for
hooks ).

It would break code that use hooks but neither defcustom or run-hooks.



reply via email to

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