GNU bug report logs - #68981
[PATCH] Add support for deriving major modes in which-func

Previous Next

Package: emacs;

Reported by: Damien Cassou <damien <at> cassou.me>

Date: Wed, 7 Feb 2024 19:53:01 UTC

Severity: normal

Tags: patch

Fixed in version 30.1

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 68981 in the body.
You can then email your comments to 68981 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#68981; Package emacs. (Wed, 07 Feb 2024 19:53:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Damien Cassou <damien <at> cassou.me>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 07 Feb 2024 19:53:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Damien Cassou <damien <at> cassou.me>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] Add support for deriving major modes in which-func
Date: Wed, 07 Feb 2024 20:51:31 +0100
[Message part 1 (text/plain, inline)]
Tags: patch

Hi,

I wanted to configure which-func to activate only for programmation
modes so I wrote:

(use-package which-func
  :init
  (progn
    (setq which-func-modes '(prog-mode)))
  :config
  (progn
    (which-function-mode)))

But this doesn't work because which-func only checks for exact major
modes, not derived ones: because emacs-lisp-mode is not in
`which-func-modes`, I won't get which-func to activate in
emacs-lisp-mode even though I want it.

I wrote the attached patch so which-func uses `derived-mode-p'. This
solves my issue.

-- 
Damien Cassou

"Success is the ability to go from one failure to another without
losing enthusiasm." --Winston Churchill
[0001-Add-support-for-deriving-major-modes-in-which-func.patch (text/patch, attachment)]

Reply sent to Stefan Kangas <stefankangas <at> gmail.com>:
You have taken responsibility. (Sat, 10 Feb 2024 11:11:02 GMT) Full text and rfc822 format available.

Notification sent to Damien Cassou <damien <at> cassou.me>:
bug acknowledged by developer. (Sat, 10 Feb 2024 11:11:03 GMT) Full text and rfc822 format available.

Message #10 received at 68981-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefankangas <at> gmail.com>
To: Damien Cassou <damien <at> cassou.me>, 68981-done <at> debbugs.gnu.org
Subject: Re: bug#68981: [PATCH] Add support for deriving major modes in
 which-func
Date: Sat, 10 Feb 2024 05:10:29 -0600
Version: 30.1

Damien Cassou <damien <at> cassou.me> writes:

> I wanted to configure which-func to activate only for programmation
> modes so I wrote:
>
> (use-package which-func
>   :init
>   (progn
>     (setq which-func-modes '(prog-mode)))
>   :config
>   (progn
>     (which-function-mode)))
>
> But this doesn't work because which-func only checks for exact major
> modes, not derived ones: because emacs-lisp-mode is not in
> `which-func-modes`, I won't get which-func to activate in
> emacs-lisp-mode even though I want it.
>
> I wrote the attached patch so which-func uses `derived-mode-p'. This
> solves my issue.

Thanks, pushed to master as commit 657d2c11337.  Closing.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sat, 09 Mar 2024 12:24:06 GMT) Full text and rfc822 format available.

This bug report was last modified 1 year and 160 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.