GNU bug report logs - #64047
30.0.50; global-display-line-numbers-mode has no easy way to set modes where it is enabled

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Tue, 13 Jun 2023 14:30:02 UTC

Severity: normal

Found in version 30.0.50

To reply to this bug, email your comments to 64047 AT debbugs.gnu.org.

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#64047; Package emacs. (Tue, 13 Jun 2023 14:30:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ihor Radchenko <yantar92 <at> posteo.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 13 Jun 2023 14:30:02 GMT) Full text and rfc822 format available.

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

From: Ihor Radchenko <yantar92 <at> posteo.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 30.0.50; global-display-line-numbers-mode has no easy way to set
 modes where it is enabled
Date: Tue, 13 Jun 2023 14:34:33 +0000
Hi,

global-display-line-numbers-mode is defined as

(define-globalized-minor-mode global-display-line-numbers-mode
  display-line-numbers-mode display-line-numbers--turn-on)

Which unconditionally enables it when `display-line-numbers--turn-on'
returns t.

Wouldn't it be nicer to have something like

(define-globalized-minor-mode global-display-line-numbers-mode
  display-line-numbers-mode display-line-numbers--turn-on
  :predicate #'display-line-numbers--turn-on)

that will also define `display-line-numbers-modes' variable that
controls where the global mode is enabled/disabled?

Maybe it should even be the default in `define-globalized-minor-mode'
when :predicate is not defined.

WDYT?

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




This bug report was last modified 325 days ago.

Previous Next


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