unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: master 7e8b1863af8: Add support for deriving major modes in which-func
       [not found] ` <20240210111023.1468FC0EFEF@vcs2.savannah.gnu.org>
@ 2024-02-10 16:36   ` Philip Kaludercic
  0 siblings, 0 replies; only message in thread
From: Philip Kaludercic @ 2024-02-10 16:36 UTC (permalink / raw)
  To: emacs-devel; +Cc: Damien Cassou

Stefan Kangas <stefankangas@gmail.com> writes:

> 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)))

Isn't the `apply' here unnecessary, since the argument to
`derived-mode-p' can be a symbol or a list.  Invoking the function with
multiple arguments appears to be deprecated anyway.

>        (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)))
>
>

-- 
Philip Kaludercic



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-02-10 16:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <170756342270.29779.1651696549492519525@vcs2.savannah.gnu.org>
     [not found] ` <20240210111023.1468FC0EFEF@vcs2.savannah.gnu.org>
2024-02-10 16:36   ` master 7e8b1863af8: Add support for deriving major modes in which-func Philip Kaludercic

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).