GNU bug report logs - #40481
26.3; whitespace-enable-predicate: consider using derived-mode-p

Previous Next

Package: emacs;

Reported by: Jack Kelly <jack <at> jackkelly.name>

Date: Tue, 7 Apr 2020 09:27:01 UTC

Severity: wishlist

Tags: fixed

Found in version 26.3

Fixed in version 28.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

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 40481 in the body.
You can then email your comments to 40481 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#40481; Package emacs. (Tue, 07 Apr 2020 09:27:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jack Kelly <jack <at> jackkelly.name>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 07 Apr 2020 09:27:01 GMT) Full text and rfc822 format available.

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

From: Jack Kelly <jack <at> jackkelly.name>
To: bug-gnu-emacs <at> gnu.org
Subject: 26.3; whitespace-enable-predicate: consider using derived-mode-p
Date: Tue, 07 Apr 2020 19:25:56 +1000
I use whitespace-global-mode to turn on whitespace highlighting in most
buffers. In my version of emacs, modes can be blacklisted by setting
`whitespace-global-modes' to e.g., `(not foo-mode bar-mode)'.

This is implemented by `whitespace-enable-predicate', which calls
`(not (memq major-mode (cdr whitespace-global-modes)))`.

I am a heavy user of magit, and find whitespace highlighting distracting
when using it. Magit implements a lot of modes, all inheriting from a
common `magit-mode'. I would like to blacklist all such modes from
`whitespace-mode', which I have currently done with the following
advice:

(add-function :filter-return whitespace-enable-predicate
   (lambda (ret) (and ret (not (derived-mode-p 'magit-mode)))))

It would be quite convenient if `whitespace-enable-predicate' called
`derived-mode-p' instead of `memq major-mode'.




Severity set to 'wishlist' from 'normal' Request was from Noam Postavsky <npostavs <at> gmail.com> to control <at> debbugs.gnu.org. (Wed, 15 Apr 2020 15:24:01 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40481; Package emacs. (Thu, 28 Jan 2021 07:41:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Jack Kelly <jack <at> jackkelly.name>
Cc: 40481 <at> debbugs.gnu.org
Subject: Re: bug#40481: 26.3; whitespace-enable-predicate: consider using
 derived-mode-p
Date: Thu, 28 Jan 2021 08:40:46 +0100
Jack Kelly <jack <at> jackkelly.name> writes:

> It would be quite convenient if `whitespace-enable-predicate' called
> `derived-mode-p' instead of `memq major-mode'.

Makes sense.  I've now made this change in Emacs 28 (and noted it in
NEWS).

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) fixed. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 28 Jan 2021 07:42:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 28.1, send any further explanations to 40481 <at> debbugs.gnu.org and Jack Kelly <jack <at> jackkelly.name> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 28 Jan 2021 07:42:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 25 Feb 2021 12:24:13 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 53 days ago.

Previous Next


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