all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 34686@debbugs.gnu.org, "Braun Gábor" <braungb88@gmail.com>
Subject: bug#34686: 26.1; unload-feature doesn't remove functions locally from hooks
Date: Thu, 28 Feb 2019 20:03:44 +0100	[thread overview]
Message-ID: <m24l8n3fcf.fsf@gmail.com> (raw)
In-Reply-To: <83ef7rkcy8.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 28 Feb 2019 20:03:27 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> Expectation: Emacs starts up with no error.
>> (`unload-feature' should remove `test-function' from `test-hook' as
>> documented, so `(run-hooks 'test-hook)' should be a no-op.)
>
> Where do you see it documented that the hook should be removed?  All I
> see is this:
>
>   Standard unloading activities include restoring old autoloads for
>   functions defined by the library, undoing any additions that the
>   library has made to hook variables or to ‘auto-mode-alist’[...]
>
> This says that hooks are removed if they were added by the library
> being unloaded.  But in your example, the hook was not added by
> test-unload.el, it was added by test.el, a different library.

In "(elisp) Unloading" it says:

     Before restoring the previous definitions, ‘unload-feature’ runs
     ‘remove-hook’ to remove functions in the library from certain
     hooks.  These hooks include variables whose names end in ‘-hook’
     (or the deprecated suffix ‘-hooks’), plus those listed in
     ‘unload-feature-special-hooks’, as well as ‘auto-mode-alist’.  This
     is to prevent Emacs from ceasing to function because important
     hooks refer to functions that are no longer defined.

and a quick look at the code confirms that it at least *tries* to do
that.

Robert





  reply	other threads:[~2019-02-28 19:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-23 21:16 bug#34686: 26.1; unload-feature doesn't remove functions locally from hooks Braun Gábor
2019-02-28 18:03 ` Eli Zaretskii
2019-02-28 19:03   ` Robert Pluim [this message]
     [not found]     ` <1551386357.RvjfsdQ5jE@gabor>
2019-02-28 19:38       ` Robert Pluim
2019-02-28 20:08         ` Braun Gábor

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=m24l8n3fcf.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=34686@debbugs.gnu.org \
    --cc=braungb88@gmail.com \
    --cc=eliz@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 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.