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: Wed, 05 Dec 2001 16:07:14 +0100
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i686-pc-linux-gnu)

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

> One thing bothers me here: it makes the defhook behave more
> like defconst than defvar.

Well, it will always add, never remove.

I think this makes it more important that it gets its own name, its
semantics is clearly distinct from defcustom/defvar (even with your
change).  It is not defconst either, it is its own thing.

> More specifically, if you do
>
>       (defhook foo-hook '(bar))
>       (remove-hook 'foo-hook 'bar)
>       (defhook foo-hook '(bar))
>
> foo-hook will contain bar even though you clearly wanted to remove it.

The intent is not clear to me, maybe we evaluate the defhook again
to put it back.

In any case, consider the more simple scenario:

        (remove-hook 'foo-hook 'bar)
        (defhook foo-hook '(bar))

If we accept hooks with non-nil standard values, and want to provide a
non-customize way to remove entries, remove-hook is the likely
candidate.

We could get this to work by modifying remove-hook to add the value to
a property (e.g. hook-removed), and let customize-initialize-hook skip
functions listed in that property.  add-hook should remove the
function from that list, if present.  add-hook and remove-hook should
continue to manipulate the actual value as they do now.

As a byproduct, this would make your scenario work like you want.



reply via email to

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