From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#40714: Reinitialising the major mode disables which-function-mode. 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 Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="80019"; mail-complaints-to="usenet@ciao.gmane.io" To: 40714@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 19 13:13:12 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jQ7st-000KjB-6J for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 19 Apr 2020 13:13:11 +0200 Original-Received: from localhost ([::1]:40382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQ7sr-0000uQ-RY for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 19 Apr 2020 07:13:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36266) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQ7sk-0000tH-To for bug-gnu-emacs@gnu.org; Sun, 19 Apr 2020 07:13:03 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQ7sk-0004Od-GP for bug-gnu-emacs@gnu.org; Sun, 19 Apr 2020 07:13:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60830) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jQ7sk-0004Mt-2y for bug-gnu-emacs@gnu.org; Sun, 19 Apr 2020 07:13:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jQ7sj-0000wQ-Te for bug-gnu-emacs@gnu.org; Sun, 19 Apr 2020 07:13:01 -0400 X-Loop: help-debbugs@gnu.org 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-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.15872947623585 (code B ref -1); Sun, 19 Apr 2020 11:13:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 19 Apr 2020 11:12:42 +0000 Original-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 Original-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 Original-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 Original-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 Original-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 Original-Received: (qmail 87807 invoked by uid 3782); 19 Apr 2020 11:12:34 -0000 Original-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 Original-Received: (qmail 22082 invoked by uid 1000); 19 Apr 2020 11:12:33 -0000 Content-Disposition: inline X-Delivery-Agent: TMDA/1.1.12 (Macallan) 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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:178626 Archived-At: 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).