From: Philip Kaludercic <philipk@posteo.net>
To: emacs-devel@gnu.org
Cc: Damien Cassou <damien@cassou.me>
Subject: Re: master 7e8b1863af8: Add support for deriving major modes in which-func
Date: Sat, 10 Feb 2024 16:36:17 +0000 [thread overview]
Message-ID: <8734u046pq.fsf@posteo.net> (raw)
In-Reply-To: <20240210111023.1468FC0EFEF@vcs2.savannah.gnu.org> (Stefan Kangas's message of "Sat, 10 Feb 2024 06:10:22 -0500 (EST)")
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
parent reply other threads:[~2024-02-10 16:36 UTC|newest]
Thread overview: expand[flat|nested] mbox.gz Atom feed
[parent not found: <20240210111023.1468FC0EFEF@vcs2.savannah.gnu.org>]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8734u046pq.fsf@posteo.net \
--to=philipk@posteo.net \
--cc=damien@cassou.me \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).