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

> From: Braun Gábor <braungb88@gmail.com>
> Date: Sat, 23 Feb 2019 22:16:45 +0100
> 
> Create in the current directory the following two files:
> 
> ------------------------- test.el -------------------------------------
> (with-temp-buffer
>   (load-file "./test-unload.el")
>   (add-hook 'test-hook #'test-function nil t)
>   (unload-feature 'test-unload)
>   (run-hooks 'test-hook))
> -----------------------------------------------------------------------
> 
> ------------------------- test-unload.el ------------------------------
> (defun test-function () "Test function, does nothing." nil)
> (provide 'test-unload)
> -----------------------------------------------------------------------
> 
> Start Emacs via
> 
> emacs -Q --eval '(setq debug-on-error t)' -l test.el
> 
> 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.





  reply	other threads:[~2019-02-28 18: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 [this message]
2019-02-28 19:03   ` Robert Pluim
     [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=83ef7rkcy8.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=34686@debbugs.gnu.org \
    --cc=braungb88@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.