[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Thought: Group Minor Modes Into Logical "Bundles"?
From: |
Kévin Le Gouguec |
Subject: |
Re: Thought: Group Minor Modes Into Logical "Bundles"? |
Date: |
Fri, 25 Nov 2022 09:51:09 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) |
Daniel Martín <mardani29@yahoo.es> writes:
> "T.V Raman" <raman@google.com> writes:
>
>> The minor mode indicators in the modeline are getting to be too many
>> -- and though :lighter for shorter indicators help, I'm still finding
>> them overly heavy to consume --- it's painful to listen to :-) though
>> I suspect they also place a level of cognitive load on users who can
>> that we might be able to reduce.
>>
>> For instance, in programming language modes, I suspect it's
>> increasingly common to have autofill, abbrev, -- perhaps company etc
>> turned on; would be nice if a user could:
>>
>> 1. Define a "logical bundle of minor modes " that are specific to
>> various tasks, and then have a modeline indicater for that "bundle"
>> defined -- so the Modeline would indicate "prog" for the user to
>> know and remember that a preferred set of programming affordances
>> are turned on. Thoghts?
>
> There is the Diminish package in GNU ELPA:
> https://elpa.gnu.org/packages/diminish.html I don't know if it already
> supports the "bundling" feature that you propose, or something
> equivalent.
AFAIK Diminish (and delight, and rich-minority, and maybe others) simply
let the user redefine (or disable) the lighter for individual minor
modes.
Off the top of my head, if I wanted to implement Raman's proposal today
(as I undertand it) through user code, I guess I'd replace
mode-line-modes in mode-line-format with an :eval form that hrm… runs
through a list of {PRED ↦ LIGHTER} functions, where each PRED is fed (or
looks up) the list of enabled minor modes, and outputs a short LIGHTER
for a logical bundle? E.g.
(defvar my/prog-minor-modes
'(auto-fill-function
abbrev-mode))
(defun my/prog-lighters ()
(and (derived-mode-p 'prog-mode)
(seq-every-p 'identity my/prog-minor-modes)
" prog"))
… and then append my/prog-lighters to another list variable that the
:eval form will go through… hm, it's clearly half-baked (e.g. if any of
the modes are disabled, then the lighter won't be shown, so should
my/prog-lighters fall back to listing all enabled modes? 🤷), and/or
over-engineered.
I'm mostly posting this to see if my understanding of Raman's proposal
is correct.