GNU bug report logs -
#30978
25.3; Suggestion: define-minor-mode should define mode-lighter variable
Previous Next
Reported by: Howard Melman <hmelman <at> gmail.com>
Date: Wed, 28 Mar 2018 20:13:02 UTC
Severity: wishlist
Tags: moreinfo, wontfix
Found in version 25.3
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 30978 in the body.
You can then email your comments to 30978 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#30978
; Package
emacs
.
(Wed, 28 Mar 2018 20:13:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Howard Melman <hmelman <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 28 Mar 2018 20:13:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Some packages define a user option to let users configure
the lighter string used in the mode-line, but some just use
a hard coded string. Packages such as diminish, delight and
dim exist to help customize these.
The define-minor-mode macro creates keymaps and other things
to help mode authors follow conventions. If it created a
mode-lighter user option when passed in a string (and not a
symbol) then users would have an easier time configuring
their mode-line without having to find and install a package
to do so.
Howard
In GNU Emacs 25.3.3 (x86_64-apple-darwin13.4.0, Carbon Version 157 AppKit 1265.21)
of 2017-09-28 built on Atago.local
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#30978
; Package
emacs
.
(Sun, 14 Jul 2019 13:41:01 GMT)
Full text and
rfc822 format available.
Message #8 received at 30978 <at> debbugs.gnu.org (full text, mbox):
Howard Melman <hmelman <at> gmail.com> writes:
> Some packages define a user option to let users configure
> the lighter string used in the mode-line, but some just use
> a hard coded string. Packages such as diminish, delight and
> dim exist to help customize these.
>
> The define-minor-mode macro creates keymaps and other things
> to help mode authors follow conventions. If it created a
> mode-lighter user option when passed in a string (and not a
> symbol) then users would have an easier time configuring
> their mode-line without having to find and install a package
> to do so.
I think this makes sense -- define-minor-mode would define a
buffer-local variable, I guess, that the users could set to change the
lighter?
Like... `FOO-mode-lighter' or something? Any opinions?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#30978
; Package
emacs
.
(Sun, 23 Aug 2020 12:24:01 GMT)
Full text and
rfc822 format available.
Message #11 received at 30978 <at> debbugs.gnu.org (full text, mbox):
Stefan Kangas <stefan <at> marxist.se> writes:
>> I think this makes sense -- define-minor-mode would define a
>> buffer-local variable, I guess, that the users could set to change the
>> lighter?
>>
>> Like... `FOO-mode-lighter' or something? Any opinions?
>
> Yes, it sounds like a good idea.
>
> I'm not sure why you propose that it should be buffer-local though.
> Wouldn't one want to configure this globally by default?
Hm... yes, a global variable makes more sense. I was thinking that
somebody would want a different lighter in different buffers, but that
does sound rather unlikely.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#30978
; Package
emacs
.
(Fri, 25 Jun 2021 14:29:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 30978 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
>>> I think this makes sense -- define-minor-mode would define a
>>> buffer-local variable, I guess, that the users could set to change the
>>> lighter?
>>>
>>> Like... `FOO-mode-lighter' or something? Any opinions?
>>
>> Yes, it sounds like a good idea.
>>
>> I'm not sure why you propose that it should be buffer-local though.
>> Wouldn't one want to configure this globally by default?
>
> Hm... yes, a global variable makes more sense. I was thinking that
> somebody would want a different lighter in different buffers, but that
> does sound rather unlikely.
Does anybody else have an opinion here? The suggestion is to make
define-minor-mode define a `foo-mode-lighter' variable that users can
then change to easily change the lighters.
Or do we have a separate mechanism for this somewhere?
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#30978
; Package
emacs
.
(Fri, 25 Jun 2021 22:58:01 GMT)
Full text and
rfc822 format available.
Message #17 received at 30978 <at> debbugs.gnu.org (full text, mbox):
On 2021-06-26 02:27, Lars Ingebrigtsen wrote:
> Does anybody else have an opinion here? The suggestion is to make
> define-minor-mode define a `foo-mode-lighter' variable that users can
> then change to easily change the lighters.
It sounds like a good change.
> Or do we have a separate mechanism for this somewhere?
We do in GNU ELPA (see https://www.emacswiki.org/emacs/DelightedModes
regarding the one I wrote, delight.el), but that and similar libraries
mostly exist because there wasn't something as trivial as a variable
to set.
Delight also takes care of synchronising the label in `mode-line-menu'
(down-mouse-3 on `mode-line-modes'), as well as allowing custom names
for major modes via the same UI -- but providing an easy way to set
minor mode lighters was the actual reason for writing it.
-Phil
Added tag(s) moreinfo.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sat, 26 Jun 2021 12:52:01 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#30978
; Package
emacs
.
(Sun, 25 Jul 2021 08:00:02 GMT)
Full text and
rfc822 format available.
Message #22 received at 30978 <at> debbugs.gnu.org (full text, mbox):
Phil Sainty <psainty <at> orcon.net.nz> writes:
>> Does anybody else have an opinion here? The suggestion is to make
>> define-minor-mode define a `foo-mode-lighter' variable that users can
>> then change to easily change the lighters.
>
> It sounds like a good change.
I just can't make up my mind here. On the one hand, a
`foo-mode-lighter' variable would make things easy and regular. On the
other hand, it means creating a new user option for each minor mode
(i.e., a defcustom), and it means having these in `minor-mode-alist',
which means one additional variable lookup (per minor mode) when
creating the mode line.
>> Or do we have a separate mechanism for this somewhere?
>
> We do in GNU ELPA (see https://www.emacswiki.org/emacs/DelightedModes
> regarding the one I wrote, delight.el), but that and similar libraries
> mostly exist because there wasn't something as trivial as a variable
> to set.
>
> Delight also takes care of synchronising the label in `mode-line-menu'
> (down-mouse-3 on `mode-line-modes'), as well as allowing custom names
> for major modes via the same UI -- but providing an easy way to set
> minor mode lighters was the actual reason for writing it.
It sounds like delight is the right solution here -- it's a more
complete solution, and people who want this can just install your
package...
So... on the whole... I think we shouldn't add the -lighter
variables. So I'm closing this bug report.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Added tag(s) wontfix.
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sun, 25 Jul 2021 08:00:07 GMT)
Full text and
rfc822 format available.
bug closed, send any further explanations to
30978 <at> debbugs.gnu.org and Howard Melman <hmelman <at> gmail.com>
Request was from
Lars Ingebrigtsen <larsi <at> gnus.org>
to
control <at> debbugs.gnu.org
.
(Sun, 25 Jul 2021 08:00:07 GMT)
Full text and
rfc822 format available.
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#30978
; Package
emacs
.
(Sun, 25 Jul 2021 16:44:01 GMT)
Full text and
rfc822 format available.
Message #29 received at submit <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> Phil Sainty <psainty <at> orcon.net.nz> writes:
>
>>> Does anybody else have an opinion here? The suggestion is to make
>>> define-minor-mode define a `foo-mode-lighter' variable that users can
>>> then change to easily change the lighters.
>>
>> It sounds like a good change.
>
> I just can't make up my mind here. On the one hand, a
> `foo-mode-lighter' variable would make things easy and regular. On the
> other hand, it means creating a new user option for each minor mode
> (i.e., a defcustom), and it means having these in `minor-mode-alist',
> which means one additional variable lookup (per minor mode) when
> creating the mode line.
Thanks for considering this. If the performance impact of
having these variables in minor-mode-alist is significant,
then fine. Otherwise IMHO "easy and regular" clearly
outweighs having more defcustoms (which seems better to me
anyway, I could use completion to see all the lighter
strings).
>>> Or do we have a separate mechanism for this somewhere?
>>
>> We do in GNU ELPA (see https://www.emacswiki.org/emacs/DelightedModes
>> regarding the one I wrote, delight.el), but that and similar libraries
>> mostly exist because there wasn't something as trivial as a variable
>> to set.
>>
>> Delight also takes care of synchronising the label in `mode-line-menu'
>> (down-mouse-3 on `mode-line-modes'), as well as allowing custom names
>> for major modes via the same UI -- but providing an easy way to set
>> minor mode lighters was the actual reason for writing it.
>
> It sounds like delight is the right solution here -- it's a more
> complete solution, and people who want this can just install your
> package...
>
> So... on the whole... I think we shouldn't add the -lighter
> variables. So I'm closing this bug report.
I agree that packages like delight, dim and diminish (and I
just learned about blackout) mostly exist because there
wasn't a "trivial" or "easy and regular" way to do this and
don't see how they're "more complete" than the proposal..
If the packages are the way to go, maybe one could be
included in emacs? They've been around for several years
(diminish since '98).
As it stands now, a user that just wants to eliminate
something like " ElDoc" or " ws" from their modeline won't
find the answer in the documentation. If they look for a
package to do this even the package descriptions as they
appear in list-packages don't have a common keyword to
search for:
blackout Better mode lighter overriding
delight A dimmer switch for your lighter text
dim Change mode-line names of major/minor modes
diminish Diminished modes are minor modes with no modeline display
So they will have to do an internet search and then evaluate
which of 3 or 4 packages they want to use. It's certainly
not "easy or regular".
--
Howard
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#30978
; Package
emacs
.
(Wed, 28 Jul 2021 15:32:01 GMT)
Full text and
rfc822 format available.
Message #32 received at 30978 <at> debbugs.gnu.org (full text, mbox):
Howard Melman <hmelman <at> gmail.com> writes:
> I agree that packages like delight, dim and diminish (and I
> just learned about blackout) mostly exist because there
> wasn't a "trivial" or "easy and regular" way to do this and
> don't see how they're "more complete" than the proposal..
It's already pretty easy to just alter the lighters -- just say:
(setcar (cdr (assoc 'foo-mode minor-mode-alist)) "whatever")
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#30978
; Package
emacs
.
(Wed, 28 Jul 2021 19:11:01 GMT)
Full text and
rfc822 format available.
Message #35 received at submit <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> It's already pretty easy to just alter the lighters -- just say:
>
> (setcar (cdr (assoc 'foo-mode minor-mode-alist)) "whatever")
Maybe include an example of disabling a lighter in the elisp
manual (where minor-mode-alist is mentioned). E.g.,
(setcar (cdr (assoc 'eldoc-mode minor-mode-alist)) "")
I realize this is "pretty easy" lisp but it's not a simple
setq and I think non-lispers might want to do this.
--
Howard
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#30978
; Package
emacs
.
(Wed, 28 Jul 2021 20:01:02 GMT)
Full text and
rfc822 format available.
Message #38 received at 30978 <at> debbugs.gnu.org (full text, mbox):
Lars Ingebrigtsen <larsi <at> gnus.org> writes:
> It's already pretty easy to just alter the lighters -- just say:
>
> (setcar (cdr (assoc 'foo-mode minor-mode-alist)) "whatever")
Manipulating minor-mode-alist is not that hard indeed; there are some
sources of hassle though:
(1) figuring out the name of the mode variable (e.g. auto-fill-function,
defining-kbd-macro);
(2) some modes seem not to add their variables to minor-mode-alist for
some reason (e.g. caps-lock-mode on GNU ELPA), so this recipe does
not work (neither does delight); one needs to fallback to
add-to-list.
Nothing too herculean, but I'm sure some users would appreciate a
built-in function to figure out this stuff for them.
(And IIUC, solving this with a function, rather than automatically
creating variables for each minor mode, would address your concern about
bloat, since any added bloat would be opt-in)
Information forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#30978
; Package
emacs
.
(Thu, 29 Jul 2021 12:12:01 GMT)
Full text and
rfc822 format available.
Message #41 received at 30978 <at> debbugs.gnu.org (full text, mbox):
Howard Melman <hmelman <at> gmail.com> writes:
> Maybe include an example of disabling a lighter in the elisp
> manual (where minor-mode-alist is mentioned). E.g.,
>
> (setcar (cdr (assoc 'eldoc-mode minor-mode-alist)) "")
>
> I realize this is "pretty easy" lisp but it's not a simple
> setq and I think non-lispers might want to do this.
Kévin Le Gouguec <kevin.legouguec <at> gmail.com> writes:
> Manipulating minor-mode-alist is not that hard indeed; there are some
> sources of hassle though:
>
> (1) figuring out the name of the mode variable (e.g. auto-fill-function,
> defining-kbd-macro);
>
> (2) some modes seem not to add their variables to minor-mode-alist for
> some reason (e.g. caps-lock-mode on GNU ELPA), so this recipe does
> not work (neither does delight); one needs to fallback to
> add-to-list.
>
> Nothing too herculean, but I'm sure some users would appreciate a
> built-in function to figure out this stuff for them.
I did consider adding a new function like `set-minor-mode-lighter' that
would just alter `minor-mode-alist' like that setcar, but that has (at
least) two problems -- the one you mention in (1), and loading
precedence issues: If you alter the entry in `minor-mode-alist', and
then load the .el file with the `define-minor-mode', then it'll
overwrite your own setting.
So you have to say
(require 'foo)
(setcar ...)
in your .emacs to make it work reliably, so just adding a naive helper
function, or talking about this too much, is that helpful, because it'll
trip people up.
Adding a -lighter defcustom would indeed have none of these problems,
but I'm just not sure that people would use it enough to justify the
(minor) performance impact, as well as the defcustom explosion. Which
is why I think that using a package like delight is the right solution
here for those that want to change the lighters. Probably.
--
(domestic pets only, the antidote for overdose, milk.)
bloggy blog: http://lars.ingebrigtsen.no
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Fri, 27 Aug 2021 11:24:06 GMT)
Full text and
rfc822 format available.
This bug report was last modified 3 years and 299 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.