GNU bug report logs -
#77446
ELPA diminish: support minor modes without lighters
Previous Next
To reply to this bug, email your comments to 77446 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-gnu-emacs <at> gnu.org
:
bug#77446
; Package
emacs
.
(Wed, 02 Apr 2025 02:00:14 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Michael Mauger <michael.mauger <at> protonmail.com>
:
New bug report received and forwarded. Copy sent to
bug-gnu-emacs <at> gnu.org
.
(Wed, 02 Apr 2025 02:00:15 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
As I cleaned up my `init.el' using `use-package' I discovered some edge cases in `diminish' that can be easily addressed.
1. Although the stated purpose from `diminish' is to shorten existing minor mode lighters, there can be the case made for adding a lighter when none is supplied by default. The patch to the `diminish' function creates a dummy empty string lighter when it is called without an existing lighter.
2. The patch to `diminish-undo' detects when a mode was not previously diminished and properly restores the original lighter.
3. The patch to `diminished-modes' corrects and simplifies the logic by calling the `format-mode-line' function to generate the lighter from the minor mode specifications. This eliminates kludgy code for simulating symbol evaluation but also handles other mode-line format specifications not previously handled.
I have signed copyright papers so there shouldn't be any concern there. I have tried to not use anything not present in Emacs 24.3 and updated the version number to 0.50 to reflect that there is a significant change since version 0.46; please correct either if necessary. The patch is attached.
--
MICHAEL <at> MAUGER.COM // FSF and SFConservancy member // GNU Emacs sql.el maintainer
[diminish.patch (text/x-patch, attachment)]
This bug report was last modified 6 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.