unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#64048: 30.0.50; global-display-line-numbers-mode has no easy way to set modes where it is enabled
@ 2023-06-13 14:33 Ihor Radchenko
  2023-06-13 15:50 ` Eli Zaretskii
  0 siblings, 1 reply; 15+ messages in thread
From: Ihor Radchenko @ 2023-06-13 14:33 UTC (permalink / raw)
  To: 64048

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>





^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-06-17 19:18 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-13 14:33 bug#64048: 30.0.50; global-display-line-numbers-mode has no easy way to set modes where it is enabled Ihor Radchenko
2023-06-13 15:50 ` Eli Zaretskii
2023-06-13 16:09   ` Ihor Radchenko
2023-06-13 16:49     ` Eli Zaretskii
2023-06-13 17:21       ` Ihor Radchenko
2023-06-13 18:19         ` Eli Zaretskii
2023-06-13 19:36           ` Ihor Radchenko
2023-06-14 11:58             ` Eli Zaretskii
2023-06-14 12:48               ` Ihor Radchenko
2023-06-17  7:46                 ` Eli Zaretskii
2023-06-17 18:30                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-06-17 18:58                     ` Eli Zaretskii
2023-06-17 19:06                       ` Ihor Radchenko
2023-06-17 19:04                     ` Ihor Radchenko
2023-06-17 19:18                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

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