From: "Davis Herring" <herring@lanl.gov>
To: "Juanma Barranquero" <lekktu@gmail.com>
Cc: Emacs Devel <emacs-devel@gnu.org>
Subject: Re: unload-feature questions and thoughts
Date: Wed, 10 Oct 2007 10:56:11 -0700 (PDT) [thread overview]
Message-ID: <55585.128.165.123.18.1192038971.squirrel@webmail.lanl.gov> (raw)
In-Reply-To: <f7ccd24b0710101007w4823378blf3a264013a6f4258@mail.gmail.com>
> Yes, that's what I've been proposing. It should have to be a new hook
> for compatibility, I think.
I'm not sure the compatibility is worth the complexity. The current
behavior is so badly documented and random (auto-mode-alist being treated
as a hook) that I would just call it a bug fix. To check this, I went
through all the unload hooks in the sources:
delsel.el seems to think that its pre-command-hook entry will get cleared
for it, and the `remove-hook's it already does wouldn't hurt anything with
the change.
Regardless of the change, server.el needs to clear its `kill-emacs-hook'
entry (loadhist.el wouldn't, even without `server-unload-hook', because
`server-mode' is autoloaded). It also needs to kill its C-x # binding,
suggesting that loadhist.el should perhaps sweep keymaps. With the
change, server.el wouldn't have to do any of its extant `remove-hook's,
but they too would do no harm.
shadowfile.el needs to kill its C-x 4 s binding (again, should sweep
keymaps). Its `remove-hook's would also be harmlessly redundant.
strokes.el wouldn't have to get rid of its `kill-emacs-query-functions'
entry itself.
whitespace.el has to have its unload function, because the functions it
adds to hooks are autoloaded.
emacs-lisp/cl.el and emacs-lisp/elp.el have meaningful unload functions too.
eshell/*.el make their unload functions customizable for some reason.
eshell/esh-mode.el and eshell/esh-module.el are particularly odd: the
former has a default value of nil, so it just suppresses loadhist.el's
hook/a-m-a action, and the latter recursively unloads features -- it
should document that those features cannot `require' 'esh-module because
`unload-feature' would then refuse to unload it because of them even
though they would get unloaded too.
gnus/gnus-registry.el and gnus/spam-stat.el each have an interactive
unload hook that isn't necessary as an unload hook; it should be renamed
to "...-uninstall-hooks" to match its counterpart.
url/url-vars.el has a similarly needless unload hook.
So I think that the evidence is for the intuitively obvious statement that
no one knows how to use the hook. I found no examples where the normal
heuristics would break anything, although neither did I find any examples
where the unload-hook actually broke things by suppressing the "normal
heuristics". So I think treating it as a bug is probably the right thing
to do for simplicity: just do the heuristics regardless, and let the rare
hooks that really need to suppress them kill the variable bound for that
purpose.
Davis
--
This product is sold by volume, not by mass. If it appears too dense or
too sparse, it is because mass-energy conversion has occurred during
shipping.
next prev parent reply other threads:[~2007-10-10 17:56 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-04 18:03 unload-feature questions and thoughts Juanma Barranquero
2007-02-04 18:32 ` David Kastrup
2007-02-04 19:07 ` Juanma Barranquero
2007-02-04 19:14 ` David Kastrup
2007-02-05 0:10 ` Juanma Barranquero
2007-02-05 7:21 ` David Kastrup
2007-02-05 9:21 ` Juanma Barranquero
2007-02-05 9:32 ` David Kastrup
2007-02-05 11:08 ` Juanma Barranquero
2007-02-05 11:16 ` David Kastrup
2007-02-05 11:40 ` Juanma Barranquero
2007-02-06 0:16 ` Richard Stallman
2007-10-10 11:04 ` Juanma Barranquero
2007-10-10 14:52 ` Davis Herring
2007-10-10 16:08 ` Juanma Barranquero
2007-10-10 17:03 ` Davis Herring
2007-10-10 17:07 ` Juanma Barranquero
2007-10-10 17:56 ` Davis Herring [this message]
2007-10-11 5:20 ` Richard Stallman
2007-10-11 6:39 ` David Kastrup
2007-10-11 15:16 ` Juanma Barranquero
2007-10-12 15:59 ` Richard Stallman
2007-10-12 17:01 ` Juanma Barranquero
2007-10-13 6:41 ` Richard Stallman
2007-10-13 10:03 ` Juanma Barranquero
2007-10-14 16:28 ` Richard Stallman
2007-10-14 22:34 ` Juanma Barranquero
2007-10-15 16:03 ` Richard Stallman
2007-10-15 16:22 ` Juanma Barranquero
2007-10-16 4:10 ` Richard Stallman
2007-10-16 8:15 ` Juanma Barranquero
2007-10-17 5:02 ` Richard Stallman
2007-10-17 23:39 ` Juanma Barranquero
2007-10-23 19:27 ` Davis Herring
2007-10-24 8:32 ` Richard Stallman
2007-10-11 16:41 ` Davis Herring
2007-10-12 2:46 ` Richard Stallman
2007-10-25 21:24 ` David Kastrup
2007-10-28 13:51 ` Richard Stallman
2007-10-10 21:03 ` Richard Stallman
2007-10-10 21:42 ` Juanma Barranquero
2007-02-05 19:10 ` Richard Stallman
2007-02-05 23:27 ` Juanma Barranquero
2007-02-06 17:09 ` Richard Stallman
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55585.128.165.123.18.1192038971.squirrel@webmail.lanl.gov \
--to=herring@lanl.gov \
--cc=emacs-devel@gnu.org \
--cc=lekktu@gmail.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.