From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#34686: 26.1; unload-feature doesn't remove functions locally from hooks Date: Thu, 28 Feb 2019 20:03:44 +0100 Message-ID: References: <11240364.O9o76ZdvQC@gabor> <83ef7rkcy8.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="17478"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34686@debbugs.gnu.org, Braun =?UTF-8?Q?G=C3=A1bor?= To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 28 20:04:20 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gzQyh-0004Qd-8i for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Feb 2019 20:04:19 +0100 Original-Received: from localhost ([127.0.0.1]:45113 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzQyg-0006fG-7G for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Feb 2019 14:04:18 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56406) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzQyT-0006ds-SP for bug-gnu-emacs@gnu.org; Thu, 28 Feb 2019 14:04:06 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzQyT-0008Ea-1C for bug-gnu-emacs@gnu.org; Thu, 28 Feb 2019 14:04:05 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41980) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gzQyQ-0008Db-8h for bug-gnu-emacs@gnu.org; Thu, 28 Feb 2019 14:04:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gzQyP-0005m4-Vh for bug-gnu-emacs@gnu.org; Thu, 28 Feb 2019 14:04:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Feb 2019 19:04:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34686 X-GNU-PR-Package: emacs Original-Received: via spool by 34686-submit@debbugs.gnu.org id=B34686.155138063622183 (code B ref 34686); Thu, 28 Feb 2019 19:04:01 +0000 Original-Received: (at 34686) by debbugs.gnu.org; 28 Feb 2019 19:03:56 +0000 Original-Received: from localhost ([127.0.0.1]:55524 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzQyJ-0005lj-Ta for submit@debbugs.gnu.org; Thu, 28 Feb 2019 14:03:56 -0500 Original-Received: from mail-wr1-f47.google.com ([209.85.221.47]:34251) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzQyH-0005lU-7q for 34686@debbugs.gnu.org; Thu, 28 Feb 2019 14:03:54 -0500 Original-Received: by mail-wr1-f47.google.com with SMTP id f14so23218124wrg.1 for <34686@debbugs.gnu.org>; Thu, 28 Feb 2019 11:03:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-copies-to:gmane-reply-to-list :date:in-reply-to:message-id:mime-version:content-transfer-encoding; bh=Y5Z8lWa66SkxCUZxxrv625uLH4l1mb2/YrUk13P33UE=; b=WhqdkHv+Rdyzlyv3krLTrtHp/D2KlWhiCNv6GKFZ066J3ODEXzJN7pBQAwzRuJNEUT 9PYqWDEfZyya6dA5iMQ2bLUX1db1uP3p0R7YlO/rjsXoKKOiNLC+5vG91ZwGZxDq9LNj Gq04MEuvfTNwZgr0849CsSrG2M8BX97+FYMNoOrOAgzL7weT7mfSOdR/CYEMxkg2/5eS wJCkq0A5hDFwR00ipNnT42fIcQcaKpmwjTvYOjEH3tcG1++krOq9purpA9QhalPqHjvR o9uNAQv6OsSctwbfYmRa4KYmy/CO+aarvuEe0MXWd+aIWbx1OuzLkLtGJWJH3R2dIznL ceqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=Y5Z8lWa66SkxCUZxxrv625uLH4l1mb2/YrUk13P33UE=; b=euBh68vJSE41dhhGznJmX+B4w6Ghdq4G2rhWwsIz3Z2iEGVhLKMp8Rg5Lj4XL3WYyO LbSSroJhwN3kAfaZlqt8xdWxrVxqlZToXMbRGT1HAgr+EZWcG3zbCiBE/7x4w7WV9GyW 739QVsBp3Xe6JoBLIUUTEVEv34D7UPosNgD7GSLGoKH2LwRieZawQHPyGlecjsOFRsMN 9ii6vn++wqLzhhY8BOhskeS9ibu72OtPAkcN/zfDSd0ZIFkG6KjJmSgRJBtek6ce1kwL GWWjSsYqdrw1aY7uEK5124nQluRWvLDXfc3jWKta11rfMH8Thf2Nv4FbyYEX06ImZKOm 4yoA== X-Gm-Message-State: APjAAAXDRw76wFwYEHzdh4mxXEEO3NLkuwcJHrRD9a/fjZEv2HHiBojH NPco6FBRTU2c9Q1gPF+0cv9z6/y6QiI= X-Google-Smtp-Source: APXvYqykjyv0zgqPG7/56sMp1AcsibEFh+xMuAcC9SulGcAAN7vArPk8BTEJ6Z5Ot8HKKnHWPoCRaw== X-Received: by 2002:adf:efca:: with SMTP id i10mr615807wrp.265.1551380626650; Thu, 28 Feb 2019 11:03:46 -0800 (PST) Original-Received: from rpluim-mac ([2a01:e34:ecfc:a860:c3a:aa7:7f6a:ec3a]) by smtp.gmail.com with ESMTPSA id y13sm15658855wrw.31.2019.02.28.11.03.45 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 28 Feb 2019 11:03:45 -0800 (PST) Mail-Copies-To: never Gmane-Reply-To-List: yes In-Reply-To: <83ef7rkcy8.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 28 Feb 2019 20:03:27 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:155904 Archived-At: Eli Zaretskii 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 =E2=80=98auto-mode-alist=E2=80= =99[...] > > 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, =E2=80=98unload-feature=E2= =80=99 runs =E2=80=98remove-hook=E2=80=99 to remove functions in the library from = certain hooks. These hooks include variables whose names end in =E2=80=98-hoo= k=E2=80=99 (or the deprecated suffix =E2=80=98-hooks=E2=80=99), plus those listed= in =E2=80=98unload-feature-special-hooks=E2=80=99, as well as =E2=80=98au= to-mode-alist=E2=80=99. 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