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: Sat, 23 Feb 2019 22:16:45 +0100 Message-ID: <11240364.O9o76ZdvQC@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="82397"; mail-complaints-to="usenet@blaine.gmane.org" To: 34686@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Feb 28 17:21:31 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 1gzOR7-000LH3-Gd for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Feb 2019 17:21:29 +0100 Original-Received: from localhost ([127.0.0.1]:42174 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzOR6-0007pA-EO for geb-bug-gnu-emacs@m.gmane.org; Thu, 28 Feb 2019 11:21:28 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47777) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzOQu-0007n8-2q for bug-gnu-emacs@gnu.org; Thu, 28 Feb 2019 11:21:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzOQr-00045K-Gi for bug-gnu-emacs@gnu.org; Thu, 28 Feb 2019 11:21:15 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:41872) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gzOQi-00041m-1G for bug-gnu-emacs@gnu.org; Thu, 28 Feb 2019 11:21:06 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gzOQh-0006B8-RF for bug-gnu-emacs@gnu.org; Thu, 28 Feb 2019 11:21:03 -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 16:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34686 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.155137085923718 (code B ref -1); Thu, 28 Feb 2019 16:21:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 28 Feb 2019 16:20:59 +0000 Original-Received: from localhost ([127.0.0.1]:55416 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzOQd-0006AU-BF for submit@debbugs.gnu.org; Thu, 28 Feb 2019 11:20:59 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:33338) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gzOQb-0006AF-Tg for submit@debbugs.gnu.org; Thu, 28 Feb 2019 11:20:58 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:60955) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gzOQK-0003ry-8i for submit@debbugs.gnu.org; Thu, 28 Feb 2019 11:20:42 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:47690) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gzOQI-0007Sn-SF for bug-gnu-emacs@gnu.org; Thu, 28 Feb 2019 11:20:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gzOQ8-0003kB-Sx for bug-gnu-emacs@gnu.org; Thu, 28 Feb 2019 11:20:32 -0500 Original-Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]:38872) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gzOPz-0003SP-01 for bug-gnu-emacs@gnu.org; Thu, 28 Feb 2019 11:20:23 -0500 Original-Received: by mail-wr1-x42a.google.com with SMTP id g12so10567584wrm.5 for ; Thu, 28 Feb 2019 08:20:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=+9nlU38RU2xO5N7Ptlx6Zebjdu+h4iCpMsgMHDiDKhA=; b=m135Abe1rok0lqxZbaE4YHPCocV8kilahAVCfMI1BlU2mjTKz+FMfrr6DU5CZUlYnX zkICUhTdLFssV+J/1Gsxwmczw2v8f+/460hwIm21OoCgn2Wt3Oy5PXiw4q0V1aTzNig9 Wx2pqKIU136coW0A0U0hUw7EiKZCfxOenzGbmqp52GYAdhdzwE6QzUeB1iEyn8vE9tEj eKEOBriKBBZb1bbWt7DgfUdDYRrCme6okH+TMbLstO8iw7Qi5HMd/eiLHqbtbdxlVCrI 57WdoyLfB5FWnheWbqMIBrB1WlujnT1rikMxHwUoA5MJaAohP1XMKCtG1M5lSG6wLPJP 7KMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=+9nlU38RU2xO5N7Ptlx6Zebjdu+h4iCpMsgMHDiDKhA=; b=YRzw7neZIFbO8zBebho8w0/PySEv1qGMilqW5un4Vz/UYsLTPzLyCjeAuu/q39eZy1 Q4EJe9gcnuwV1mTy9J5fFxPvtmtw9OS1jkEsayZUb3U//RffnyISkJJq8hGg5SQ19YFf ZMbA1SnFUBGiHKmOWQJlKgQIvMxgJuBlY+c1eUevDsNPPbVTEh9SCAIv02LiM5fhcndq FOUhJXJRYktL0FVsV62/BIrUIJtC3O1AZqPp2q2E5t5EGLa9A9qbAhQOSWR7MlHd6wHG eKczZLTWgcX9YIGGWs/AFHaO6YghPWo4NjprrTjd+nbwl0JXwiWvoJTlaui19DyoQH5E 8y/Q== X-Gm-Message-State: APjAAAUUxXBvsXGLOmF/eeBLjaEOmzqSpXGUUq11S7aZKfKZcZBVkVZ/ zTYnwLFdp4MO276UNea77Gilhfk2 X-Google-Smtp-Source: APXvYqzU+tAC2XOzZFl7JtAp8U3VyuqWzG5CW188PXLUriJPqPhw0dxgthbf503xwl5ZZCJ9NqqSYQ== X-Received: by 2002:adf:dd4f:: with SMTP id u15mr108508wrm.61.1551370801071; Thu, 28 Feb 2019 08:20:01 -0800 (PST) Original-Received: from gabor.localnet (254C45A6.nat.pool.telekom.hu. [37.76.69.166]) by smtp.gmail.com with ESMTPSA id i16sm15416163wru.16.2019.02.28.08.20.00 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 28 Feb 2019 08:20:00 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x 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:155897 Archived-At: Create in the current directory the following two files: =2D------------------------ 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)) =2D---------------------------------------------------------------------- =2D------------------------ test-unload.el ------------------------------ (defun test-function () "Test function, does nothing." nil) (provide 'test-unload) =2D---------------------------------------------------------------------- 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.) A split frame is shown with buffer *Backtrace* having the following=20 content: =2D------------------- buffer *Backtrace* ------------------------------- Debugger entered--Lisp error: (void-function test-function) test-function() run-hooks(test-hook) (progn (load-file "./test-unload.el") (add-hook 'test-hook (function=20 test-function) nil t) (unload-feature 'test-unload) (run-hooks 'test- hook)) (unwind-protect (progn (load-file "./test-unload.el") (add-hook 'test- hook (function test-function) nil t) (unload-feature 'test-unload) (run- hooks 'test-hook)) (and (buffer-name temp-buffer) (kill-buffer temp- buffer))) (save-current-buffer (set-buffer temp-buffer) (unwind-protect (progn=20 (load-file "./test-unload.el") (add-hook 'test-hook (function test- function) nil t) (unload-feature 'test-unload) (run-hooks 'test-hook))=20 (and (buffer-name temp-buffer) (kill-buffer temp-buffer)))) (let ((temp-buffer (generate-new-buffer " *temp*"))) (save-current- buffer (set-buffer temp-buffer) (unwind-protect (progn (load-file "./ test-unload.el") (add-hook 'test-hook (function test-function) nil t)=20 (unload-feature 'test-unload) (run-hooks 'test-hook)) (and (buffer-name=20 temp-buffer) (kill-buffer temp-buffer))))) eval-buffer(# nil "/run/shm/test.el" nil t) ; Reading=20 at buffer position 155 load-with-code-conversion("/run/shm/test.el" "/run/shm/test.el" nil t) load("/run/shm/test.el" nil t) command-line-1(("--eval" "(setq debug-on-error t)" "-l" "test.el")) command-line() normal-top-level() =2D---------------------------------------------------------------------- Best wishes, G=C3=A1bor Braun System information: In GNU Emacs 26.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.2) of 2018-12-26, modified by Debian built on x86-ubc-01 Windowing system distributor 'The X.Org Foundation', version=20 11.0.12003000 System Description: Debian GNU/Linux buster/sid Recent messages: =46or information about GNU Emacs and the GNU system, type C-h C-a. Loading /run/shm/test-unload.el (source)...done Entering debugger... Configured using: 'configure --build x86_64-linux-gnu --prefix=3D/usr --sharedstatedir=3D/var/lib --libexecdir=3D/usr/lib --localstatedir=3D/var/lib --infodir=3D/usr/share/info --mandir=3D/usr/share/man --enable-libsystemd --with-pop=3Dyes --enable-locallisppath=3D/etc/emacs:/usr/local/share/emacs/26.1/site- lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/ usr/share/emacs/site-lisp --with-sound=3Dalsa --without-gconf --with-mailutils --build x86_64-linux-gnu --prefix=3D/usr --sharedstatedir=3D/var/lib --libexecdir=3D/usr/lib --localstatedir=3D/var/lib --infodir=3D/usr/share/info --mandir=3D/usr/share/man --enable-libsystemd --with-pop=3Dyes --enable-locallisppath=3D/etc/emacs:/usr/local/share/emacs/26.1/site- lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/26.1/site-lisp:/ usr/share/emacs/site-lisp --with-sound=3Dalsa --without-gconf --with-mailutils --with-x=3Dyes --with-x-toolkit=3Dgtk3 --with-toolkit-scroll-bars 'CFLAGS=3D-g -O2 -fdebug-prefix-map=3D/build/emacs-3ThesY/emacs-26.1+1=3D. -fstack- protector-strong -Wformat -Werror=3Dformat-security -Wall' 'CPPFLAGS=3D-Wdate-time -D_FORTIFY_SOURCE=3D2' LDFLAGS=3D-Wl,-z,relro' Configured features: XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LIBSYSTEMD LCMS2 Important settings: value of $LANG: hu_HU.UTF-8 locale-coding-system: utf-8-unix Major mode: Debugger Minor modes in effect: tooltip-mode: t global-eldoc-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t buffer-read-only: t line-number-mode: t transient-mark-mode: t Load-path shadows: None found. =46eatures: (shadow sort mail-extr emacsbug message rmc puny seq dired dired-loaddefs format-spec rfc822 mml mml-sec password-cache epa derived epg epg-config gnus-util rmail rmail-loaddefs mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils help-mode easymenu cl-print debug loadhist byte-opt gv bytecomp byte-compile cl-loaddefs cl-lib cconv elec-pair time-date mule-util tooltip eldoc electric uniquify ediff-hook vc-hooks lisp-float-type mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode elisp-mode lisp-mode prog-mode register page menu-bar rfn-eshadow isearch timer select scroll-bar mouse jit-lock font-lock syntax facemenu font-core term/tty-colors frame cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev obarray minibuffer cl-preloaded nadvice loaddefs button faces cus-face macroexp files text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting move-toolbar gtk x-toolkit x multi-tty make-network-process emacs) Memory information: ((conses 16 99661 8330) (symbols 48 20573 1) (miscs 40 65 104) (strings 32 28942 1190) (string-bytes 1 759566) (vectors 16 14967) (vector-slots 8 500780 7422) (floats 8 55 154) (intervals 56 296 0) (buffers 992 14))