GNU bug report logs - #77446
ELPA diminish: support minor modes without lighters

Previous Next

Package: emacs;

Reported by: Michael Mauger <michael.mauger <at> protonmail.com>

Date: Wed, 2 Apr 2025 02:00:14 UTC

Severity: normal

Full log


View this message in rfc822 format

From: Michael Mauger <michael.mauger <at> protonmail.com>
To: 77446 <at> debbugs.gnu.org, martin.yrjola <at> gmail.com
Subject: bug#77446: ELPA diminish: support minor modes without lighters
Date: Tue, 01 Apr 2025 23:39:45 +0000
[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 79 days ago.

Previous Next


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