From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Braun =?UTF-8?Q?G=C3=A1bor?= Newsgroups: gmane.emacs.bugs Subject: bug#34686: 26.1; unload-feature doesn't remove functions locally from hooks Date: Thu, 28 Feb 2019 21:08:44 +0100 Message-ID: <2634596.5C4bGIA8oR@gabor> References: <11240364.O9o76ZdvQC@gabor> <1551386357.RvjfsdQ5jE@gabor> 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="39910"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 34686@debbugs.gnu.org To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 28 21:09:14 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 1gzRzW-000AH3-Gj for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Feb 2019 21:09:14 +0100 Original-Received: from localhost ([127.0.0.1]:45824 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzRzV-0006fQ-FS for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Feb 2019 15:09:13 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39836) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzRzP-0006fE-83 for bug-gnu-emacs@gnu.org; Thu, 28 Feb 2019 15:09:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzRzN-0003Jo-DV for bug-gnu-emacs@gnu.org; Thu, 28 Feb 2019 15:09:07 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:42007) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gzRzK-0003I9-1K for bug-gnu-emacs@gnu.org; Thu, 28 Feb 2019 15:09:04 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gzRzJ-0007Qs-Np for bug-gnu-emacs@gnu.org; Thu, 28 Feb 2019 15:09:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Braun =?UTF-8?Q?G=C3=A1bor?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Feb 2019 20:09: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.155138453628559 (code B ref 34686); Thu, 28 Feb 2019 20:09:01 +0000 Original-Received: (at 34686) by debbugs.gnu.org; 28 Feb 2019 20:08:56 +0000 Original-Received: from localhost ([127.0.0.1]:55551 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzRzD-0007QZ-Ox for submit@debbugs.gnu.org; Thu, 28 Feb 2019 15:08:55 -0500 Original-Received: from mail-wr1-f45.google.com ([209.85.221.45]:36735) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzRzA-0007QI-BY for 34686@debbugs.gnu.org; Thu, 28 Feb 2019 15:08:53 -0500 Original-Received: by mail-wr1-f45.google.com with SMTP id o17so23412201wrw.3 for <34686@debbugs.gnu.org>; Thu, 28 Feb 2019 12:08:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mImHIrKZbGtV1ab7Vqdi8vM1LkOvW+MZtQBKksgezSY=; b=f3KB2bv2RYV5YBn+5zlIeVJ46J1wZeUvaXA4Oa4PnmgwALLQNy6AbSIBv/A0AcoS10 55t2e6lVBRGNA8qUp+awlloVQF8JipO5vEmDkZRRQbJzlokadXkiBiVrZKSkqTz3x92n GHDkpzxt7EvGocPO50vZxd/FASZZfrN1hPSwIlWNr+b2zMnGrsjigHYuP4pgUD4sHH73 RLK0adaouh7F55h8goM5fYlv780qNz9r68wDNVwlqVZeIWEEIn2Q1TwkgZsgWkm0bOKE fl0wcGfTFJdIBQNMzUahvkIMf27xf+RoX5B6+TdiQebPamZ6khmWw1Z0cyx6C5Vshya1 qfkA== 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:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mImHIrKZbGtV1ab7Vqdi8vM1LkOvW+MZtQBKksgezSY=; b=gEWBgkwggSxkRFiCSnhILRY8HhrracdP2ASHArVyT81PSPT5hB102RY3DNdSt4F0ID UC0yZvMi7CXZZNJHzSf2/az5QV1/N11nEyIZN0iEk920vuqvdtARYPmujRNDmnq0M2yC Blb558KMSvZge4hFuylB1HY7bTEv1nFeLsJ6AfGv+M8lgewgC+gSQf6LK3hHJz5wYUOs fWKvdfYlaRmv724O8S6Ldy7VoRiIWbOrmRuBo0ecjkwCY3TRksMrD0lqsu7hxgaWyo5c OH3aXI+/DR3jydk+AKNBIogSImRJdg/dVUjis+MJYjESHryzFnsQWNpX9VfKFca6CBxZ Fn0A== X-Gm-Message-State: APjAAAViJa8QnuP96TEcKdTIaqcRMcgH0G6VKHEhaSLTkAWMmE4g1QYE qQkSn1WtAqX7i7Ej5/eE0G0= X-Google-Smtp-Source: APXvYqzq4gC4TRcvapmu0Bh5qDVCi/XsOPR0iipWqzyYq+0Dglx0hKyOp96SF/px9fNmMPXnjqSxTg== X-Received: by 2002:adf:d0c9:: with SMTP id z9mr807294wrh.132.1551384526601; Thu, 28 Feb 2019 12:08:46 -0800 (PST) Original-Received: from gabor.localnet (254C45A6.nat.pool.telekom.hu. [37.76.69.166]) by smtp.gmail.com with ESMTPSA id h9sm45153842wrv.11.2019.02.28.12.08.45 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Feb 2019 12:08:46 -0800 (PST) In-Reply-To: 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:155908 Archived-At: > > IMHO, the stated reason in the info manual (keep Emacs functioning) > > justifies removing functions from the hooks (both their global and=20 local > > values) which become undefined. >=20 > Yes, I=CA=BCd tend to agree. Would you have a patch to offer? What about the following? G=C3=A1bor =2D-- lisp/loadhist.el 2019-02-28 20:52:14.852487704 +0100 +++ lisp/loadhist.el 2019-02-28 20:51:40.008386599 +0100 @@ -295,7 +295,13 @@ (dolist (y unload-function-defs-list) (when (and (eq (car-safe y) 'defun) (not (get (cdr y) 'autoload))) =2D (remove-hook x (cdr y))))))) + (let ((f (cdr y))) + (remove-hook x f) + ;; Remove also from buffer-local value. + (save-current-buffer + (dolist (buf (buffer-list)) + (set-buffer buf) + (remove-hook x f t))))))))) ;; Remove any feature-symbols from auto-mode-alist as well. (dolist (y unload-function-defs-list) (when (and (eq (car-safe y) 'defun)