emacs-devel
[Top][All Lists]
Advanced

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

Re: why do some programming modes have customize hooks and others do not


From: Nic Ferrier
Subject: Re: why do some programming modes have customize hooks and others do not?
Date: Mon, 20 Oct 2014 19:29:04 +0100

Artur Malabarba <address@hidden> writes:

>> If I use a hooked function to autoload my package, then using the
>> non-customize hook won't work. The user ends up having to require my
>> package in their .emacs.
>
> I don't understand. Why would the hooked function not load your
> package?

The scenario I'm thinking of is where a package adds itself to a hook to
get itself auto-initialized.

If the hook isn't saved (eg: by customize) then of course the contents
will be lost.

That's all I meant. Customizable hooks are good for packages to hook
into (with enough user consent) because they are persistent.


> Yes.
> Another possible solution to this conundrum would be for the customize
> interface itself to provide special treatment on hook variables.
>
> Customize can keep track of which functions were added through
> the interface.

That is a *really* good idea.


> Whenever the hook is customized, only those items are displayed
> on the interface (or maybe the other items are displayed but not editable).
> When the user makes some change and performs a save, Customize then
> saves only the user-added functions. The other ones are left in the
> hook, but they are not saved to “custom-file”.
>
> This would have almost no effect on the user and the authors, but
> would prevent packages from leaving garbage behind. It might be a
> little cumbersome to code, but I don't forsee any fundamental problems
> with it.
>
> Anyone?

It's a brilliant solution I think.

I'd be happy to implement it (when we have git).


Nic



reply via email to

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