From unknown Tue Jun 17 01:43:12 2025 X-Loop: help-debbugs@gnu.org Subject: bug#40714: Reinitialising the major mode disables which-function-mode. Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 19 Apr 2020 11:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 40714 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 40714@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.15872947623585 (code B ref -1); Sun, 19 Apr 2020 11:13:01 +0000 Received: (at submit) by debbugs.gnu.org; 19 Apr 2020 11:12:42 +0000 Received: from localhost ([127.0.0.1]:44142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jQ7sQ-0000vj-Fj for submit@debbugs.gnu.org; Sun, 19 Apr 2020 07:12:42 -0400 Received: from lists.gnu.org ([209.51.188.17]:37243) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jQ7sP-0000vc-6z for submit@debbugs.gnu.org; Sun, 19 Apr 2020 07:12:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36148) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQ7sO-0000sH-So for bug-gnu-emacs@gnu.org; Sun, 19 Apr 2020 07:12:41 -0400 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQ7sO-0003JI-1Q for bug-gnu-emacs@gnu.org; Sun, 19 Apr 2020 07:12:40 -0400 Received: from colin.muc.de ([193.149.48.1]:45862 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from ) id 1jQ7sN-0003GT-Av for bug-gnu-emacs@gnu.org; Sun, 19 Apr 2020 07:12:39 -0400 Received: (qmail 87807 invoked by uid 3782); 19 Apr 2020 11:12:34 -0000 Received: from acm.muc.de (p4FE151BB.dip0.t-ipconnect.de [79.225.81.187]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Sun, 19 Apr 2020 13:12:33 +0200 Received: (qmail 22082 invoked by uid 1000); 19 Apr 2020 11:12:33 -0000 Date: Sun, 19 Apr 2020 11:12:33 +0000 Message-ID: <20200419111233.GA22022@ACM> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@muc.de; helo=mail.muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x or newer [fuzzy] X-Received-From: 193.149.48.1 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Emacs. In a typical buffer, say an emacs-lisp-mode buffer, with which-function-mode enabled and working, do M-x emacs-lisp-mode . which-function-mode is no longer working. ######################################################################### The cause of this is that the enablement of w-f-m is stored in a buffer local variable which-func-mode. This local variable gets killed on reinitialising the major mode. There is nothing to set it to non-nil again. When visiting a file, which-func-mode gets set in a file-find-hook function called which-func-ff-hook. Suggested fix: Move which-func-ff-hook to after-change-major-mode-hook (renaming it, of course). -- Alan Mackenzie (Nuremberg, Germany). From unknown Tue Jun 17 01:43:12 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Alan Mackenzie Subject: bug#40714: closed (Re: bug#40714: Acknowledgement (Reinitialising the major mode disables which-function-mode.)) Message-ID: References: <20200520180842.GA19724@ACM> <20200419111233.GA22022@ACM> X-Gnu-PR-Message: they-closed 40714 X-Gnu-PR-Package: emacs Reply-To: 40714@debbugs.gnu.org Date: Wed, 20 May 2020 18:09:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1589998142-17385-1" This is a multi-part message in MIME format... ------------=_1589998142-17385-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #40714: Reinitialising the major mode disables which-function-mode. which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 40714@debbugs.gnu.org. --=20 40714: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D40714 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1589998142-17385-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 40714-done) by debbugs.gnu.org; 20 May 2020 18:08:47 +0000 Received: from localhost ([127.0.0.1]:54226 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jbT94-0004Vv-PU for submit@debbugs.gnu.org; Wed, 20 May 2020 14:08:46 -0400 Received: from colin.muc.de ([193.149.48.1]:45036 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1jbT92-0004Vl-Eo for 40714-done@debbugs.gnu.org; Wed, 20 May 2020 14:08:44 -0400 Received: (qmail 6894 invoked by uid 3782); 20 May 2020 18:08:42 -0000 Received: from acm.muc.de (p4fe15b23.dip0.t-ipconnect.de [79.225.91.35]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Wed, 20 May 2020 20:08:42 +0200 Received: (qmail 19740 invoked by uid 1000); 20 May 2020 18:08:42 -0000 Date: Wed, 20 May 2020 18:08:42 +0000 To: 40714-done@debbugs.gnu.org Subject: Re: bug#40714: Acknowledgement (Reinitialising the major mode disables which-function-mode.) Message-ID: <20200520180842.GA19724@ACM> References: <20200419111233.GA22022@ACM> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 40714-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Bug fixed in master. -- Alan Mackenzie (Nuremberg, Germany). ------------=_1589998142-17385-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 19 Apr 2020 11:12:42 +0000 Received: from localhost ([127.0.0.1]:44142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jQ7sQ-0000vj-Fj for submit@debbugs.gnu.org; Sun, 19 Apr 2020 07:12:42 -0400 Received: from lists.gnu.org ([209.51.188.17]:37243) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jQ7sP-0000vc-6z for submit@debbugs.gnu.org; Sun, 19 Apr 2020 07:12:41 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36148) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQ7sO-0000sH-So for bug-gnu-emacs@gnu.org; Sun, 19 Apr 2020 07:12:41 -0400 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQ7sO-0003JI-1Q for bug-gnu-emacs@gnu.org; Sun, 19 Apr 2020 07:12:40 -0400 Received: from colin.muc.de ([193.149.48.1]:45862 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from ) id 1jQ7sN-0003GT-Av for bug-gnu-emacs@gnu.org; Sun, 19 Apr 2020 07:12:39 -0400 Received: (qmail 87807 invoked by uid 3782); 19 Apr 2020 11:12:34 -0000 Received: from acm.muc.de (p4FE151BB.dip0.t-ipconnect.de [79.225.81.187]) by localhost.muc.de (tmda-ofmipd) with ESMTP; Sun, 19 Apr 2020 13:12:33 +0200 Received: (qmail 22082 invoked by uid 1000); 19 Apr 2020 11:12:33 -0000 Date: Sun, 19 Apr 2020 11:12:33 +0000 To: bug-gnu-emacs@gnu.org Subject: Reinitialising the major mode disables which-function-mode. Message-ID: <20200419111233.GA22022@ACM> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Delivery-Agent: TMDA/1.1.12 (Macallan) From: Alan Mackenzie X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@muc.de; helo=mail.muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x or newer [fuzzy] X-Received-From: 193.149.48.1 X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Hello, Emacs. In a typical buffer, say an emacs-lisp-mode buffer, with which-function-mode enabled and working, do M-x emacs-lisp-mode . which-function-mode is no longer working. ######################################################################### The cause of this is that the enablement of w-f-m is stored in a buffer local variable which-func-mode. This local variable gets killed on reinitialising the major mode. There is nothing to set it to non-nil again. When visiting a file, which-func-mode gets set in a file-find-hook function called which-func-ff-hook. Suggested fix: Move which-func-ff-hook to after-change-major-mode-hook (renaming it, of course). -- Alan Mackenzie (Nuremberg, Germany). ------------=_1589998142-17385-1--