From: Nic Ferrier <nferrier@ferrier.me.uk>
To: bruce.connor.am@gmail.com
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: why do some programming modes have customize hooks and others do not?
Date: Mon, 20 Oct 2014 19:29:04 +0100 [thread overview]
Message-ID: <87mw8q61e7.fsf@ferrier.me.uk> (raw)
In-Reply-To: <CAAdUY-Lm9WkSxwctsGRa3GuS5Ka3fX9JNH2QqBc1mG5AepW6nA@mail.gmail.com> (Artur Malabarba's message of "Mon, 20 Oct 2014 13:07:55 +0100")
Artur Malabarba <bruce.connor.am@gmail.com> 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
next prev parent reply other threads:[~2014-10-20 18:29 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-18 11:10 why do some programming modes have customize hooks and others do not? Nic Ferrier
2014-10-18 11:37 ` Bastien
2014-10-18 21:46 ` Stefan Monnier
2014-10-18 22:24 ` Nic Ferrier
2014-10-19 22:44 ` Rüdiger Sonderfeld
2014-10-20 2:15 ` Stefan Monnier
2014-10-20 8:17 ` Nic Ferrier
2014-10-20 10:38 ` Artur Malabarba
2014-10-20 10:54 ` Nic Ferrier
2014-10-20 12:07 ` Artur Malabarba
2014-10-20 16:47 ` Stefan Monnier
2014-10-20 18:29 ` Nic Ferrier [this message]
2014-10-20 16:02 ` Stefan Monnier
2014-10-20 19:11 ` Nic Ferrier
2014-10-20 20:39 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87mw8q61e7.fsf@ferrier.me.uk \
--to=nferrier@ferrier.me.uk \
--cc=bruce.connor.am@gmail.com \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).