From: "Juanma Barranquero" <lekktu@gmail.com>
To: "Emacs Devel" <emacs-devel@gnu.org>
Subject: Re: unload-feature questions and thoughts
Date: Wed, 10 Oct 2007 13:04:23 +0200 [thread overview]
Message-ID: <f7ccd24b0710100404ufd2c00v7147e1557d902e4d@mail.gmail.com> (raw)
In-Reply-To: <f7ccd24b0702050308i5e034e21p230d516fc3071b61@mail.gmail.com>
On 2/5/07, Juanma Barranquero <lekktu@gmail.com> wrote:
> I misread the code (I was much more centered in the part about undoing
> defun, provide, etc. and didn't take a closer look to the beginning of
> the function), but I think this piece of docstring is a bit confusing
>
> This function tries to undo modifications made by the package to
> hooks. Packages may define a hook FEATURE-unload-hook that is called
> instead of the normal heuristics for doing this. Such a hook should
> undo all the relevant global state changes that may have been made by
> loading the package or executing functions in it.
>
> because if you miss the "to hooks" (two words), as I did in several
> readings, it seems like it is saying that either you define
> FEATURE-unload-hook, or else it uses "the normal heuristics".
Eight months later, I had forgotten this thread and I *again* misread
both the code and the docstring. :(
So, could someone with good English skills please reword
unload-feature's docstring to clarify what it does and what purpose
FEATURE-unload-hook does serve?
Related to this: I'm still unsatisfied with FEATURE-unload-hook. It is
not useful enough when you want do undo other kind of changes. For
example, currently follow.el can not be correctly unloaded because it
uses tons of advices. It is possible to define a follow-unload-hook to
undo the advices, but then it has to take care of removing functions
from hooks, too.
Some packages with a global effect, like server.el or msb.el, run
(MODE -1) in the FEATURE-unload-hook to disable the hooks, and then do
the additional cleanup; but this is less practical for non-global
modes like follow-mode.
All in all, I think it'd be useful to have a FEATURE-unload-function
which would return t or nil to signal whether it has done everything,
or would like for unload-feature to continue with its normal
processing.
Juanma
next prev parent reply other threads:[~2007-10-10 11:04 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 [this message]
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
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
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=f7ccd24b0710100404ufd2c00v7147e1557d902e4d@mail.gmail.com \
--to=lekktu@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).