emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 7e8b1863af8: Add support for deriving major modes in which-func


From: Stefan Kangas
Subject: master 7e8b1863af8: Add support for deriving major modes in which-func
Date: Sat, 10 Feb 2024 06:10:22 -0500 (EST)

branch: master
commit 7e8b1863af8c820c2969c1a4666ae4451cbcea92
Author: Damien Cassou <damien@cassou.me>
Commit: Stefan Kangas <stefankangas@gmail.com>

    Add support for deriving major modes in which-func
    
    * lisp/progmodes/which-func.el (which-func-try-to-enable)
    (which-func-ff-hook): Use `derived-mode-p' to check if the current major
    mode is within `which-func-modes' or `which-func-non-auto-modes'.
    (Bug#68981)
---
 lisp/progmodes/which-func.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lisp/progmodes/which-func.el b/lisp/progmodes/which-func.el
index bd68672f905..631cb3b0aef 100644
--- a/lisp/progmodes/which-func.el
+++ b/lisp/progmodes/which-func.el
@@ -211,7 +211,7 @@ non-nil.")
   (when which-function-mode
     (unless (local-variable-p 'which-func-mode)
       (setq which-func-mode (or (eq which-func-modes t)
-                                (member major-mode which-func-modes)))
+                                (apply #'derived-mode-p which-func-modes)))
       (setq which-func--use-mode-line
             (member which-func-display '(mode mode-and-header)))
       (setq which-func--use-header-line
@@ -239,7 +239,7 @@ It creates the Imenu index for the buffer, if necessary."
 
   (condition-case err
       (if (and which-func-mode
-              (not (member major-mode which-func-non-auto-modes))
+              (not (apply #'derived-mode-p which-func-non-auto-modes))
               (or (null which-func-maxout)
                   (< buffer-saved-size which-func-maxout)
                   (= which-func-maxout 0)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]