help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: use-package


From: Drew Adams
Subject: RE: use-package
Date: Fri, 13 May 2016 08:38:52 -0700 (PDT)

> It is certainly the case that the lighters are sometimes useful. But
> if by sometimes, we mean "occasionally" then it's an open question
> how sensible it is showing all of this information.

Sensible, here as elsewhere, is in the mind of the user.

Users should have an easy way to specify what behavior they want
for a given lighter.  Most modes etc. should _provide_ a lighter,
thus giving the user the possibility of choosing.  But again,
users do need an easy way to pick and choose.  It is typically
enough that a mode provide an option to show the lighter or not.
The mode designer decides on the default value of the option.
A user can override that default choice. 

> I agree that setting defaults is difficult, but "show everything
> in case it is useful", is to my mind not sensible.

Nothing is useful at that black-&-white level of oversimplification.

For most modes I think there probably is some use in providing a
lighter.  But yes, users need to be able to choose, for any given
lighter.  They can choose a lighter only if it exists to be chosen.

And yes, of course, developers of some modes will decide that a
lighter is not at all useful.

> Consider, the current information about lighters in the manual.
> "Minor Mode Conventions" says nothing; in fact, the only place
> I can find anything is in the documentation about
> `define-minor-mode' which says:
> 
>      The string LIGHTER says what to display in the mode line when the
>      mode is enabled; if it is ‘nil’, the mode is not displayed in the
>      mode line.
> 
> So no information about why should and should not appear.

What would you expect it to say?  Any consideration of whether to
provide a lighter requires some knowledge of the _particular_ mode.
It is up to the mode designer to judge whether it makes any sense
to provide a lighter.  It should be up to a user to decide whether
to show a provided lighter.

> One thing that would be nice would be some way of surveying Emacs users.
> Perhaps an ELPA package that we could update occasionally, and each
> update would be a new survey. Still, a separate issue.

A separate issue, yes.  But as it relates to this discussion, my
voice is against asking for some summary yes/no from users.  The
utility of a particular lighter is 100% dependent on the particular
mode.  And its utility to a particular user depends on that user
and possibly on different use contexts.

I would not want to see a rule established based on some survey.

> I would suggest something more radical.
> 
> We replace the current list of lighters with a single item, which
> when clicked on gives a menu of minor modes.

A lighter is meant to provide immediate information, directly and
continually, without having to ask for it (e.g. access a menu).
We already have menus that provide access to minor-mode info.

So I strongly disagree with your suggestion.  Among other things,
I have lighters that indicate more than two states (mode on/off).
And I would encourage this for other modes that might, in effect,
have multiple states.  It puts the lie to the idea that lighters
are not very useful in general.

For example, the Icicles the lighter, `Icy', changes to indicate
whether completion is available for the current minibuffer
reading and, if so, what kind of completion: lax/strict,
multi-command, multi-completion (those are not mutually exclusive).

Display of the lighter is optional, controlled by option
`icicle-highlight-lighter-flag’ (on by default).

During input reading without completion, the lighter is not
highlighted - it just tells you that Icicle mode is on.  It is
highlighted red (by default) during completion.

`+' is appended to it (`Icy+') during multi-command completion
(meaning you can act on multiple candidates)  `||' is appended
if completion candidates are multi-completions (meaning that
you can match parts of a multi-part candidate, separately or
together).

The lighter is boxed (overline+underline) for strict completion.
If the list of candidates shown in `*Completions*' is currently 
truncated then the lighter is suffixed by `...'.  The lighter
text is `Icy' for case-sensitive completion and `ICY' when
case-insensitive.

https://www.emacswiki.org/emacs/Icicles_-_Nutshell_View#CompletionStatusIndicators

This lighter thus communicates a fair amount of info using
only a few characters.  This is no doubt not common, but I'd
bet that some other modes also could usefully provide more
info in a lighter than just on/off.

I do the same thing for Isearch (not really a mode, but it
does use a lighter).  With Isearch+, the lighter is `Isearch'
for case-sensitive search and `ISEARCH' for case-insensitive.
The lighter also indicates, by using faces, whether search
has wrapped or overwrapped.  By default, for wrapped the
lighter has a blue overline, and for overwrapped it has a
deep-pink overline and wavy underline.

https://www.emacswiki.org/emacs/IsearchPlus

> Advice in the manual would be: "Don't do this, unless you
> have a very good reason".

I disagree.  Most modes probably should provide a lighter.

But whether the lighter for a given mode is very, slightly,
or not at all useful to a particular user in a particular
context is for that user to decide.  And context, including
how many modes/lighters are currently available, can be
important.

> Rich-minority and diminish are papering over the cracks.
> Too much is happening in mode line.

Again, a user judgment.  It sounds like too much, for you,
was happening in your mode line.  Emacs is rich in use
cases and users.  Your mode line might bother me too - or
it might not.

> Adding configuration options is, I feel, dumping
> the responsibility onto the user.

Making a blanket, one-size-fits-all judgment for everyone
takes choice away from users.  Advice from the manual that
most modes should not use a lighter ("Don't do this, unless
you have a very good reason") would mean that users would
generally not have a choice: no lighter => no choice.

> Think we can get this done in time for Emacs-25.1?

I hope we never "get this done".  Just one opinion.

It sounds like you and your mode line have not really
gotten along very well, and you've looked for a way to
master it.  That does not imply that mode developers
should in general not provide lighters or that users
generally find them useful and annoying.

You know, there are packages that give Emacs a spartan,
minimal look & feel - no title bar, menu bar, tool bar,
fringes, mode line,...  That's great - for those users
who want such a look & feel.

I'm all for such a possibility.  What I am not for is
Emacs imposing or recommending this or that look & feel
in some blanket way.

Let a hundred flowers bloom.  Vive the mode line.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]