emacs-devel
[Top][All Lists]
Advanced

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

Re: Let mode-line packages distinguish the selected-window


From: Jonas Bernoulli
Subject: Re: Let mode-line packages distinguish the selected-window
Date: Mon, 28 Oct 2019 11:32:56 +0100
User-agent: mu4e 1.1.0; emacs 27.0.50

> Running your example in an unmodified Emacs _without_ the hook you
> sketched above gets me _two active_ mode-lines here (on a windowing
> system that gives focus to a frame when the mouse enters it).  Running
> it with the hook gets me an active mode-line for the window of the
> focussed frame only.  I can't tell which of these is more distracting.

That's the behavior I see too and I am not sure which I prefer either.
It probably would make sense to officially support both variants, add
a control an option and make sure it is always respected (i.e. that
weird code like what I posted thoes not have an effect).

> Accessible only within the evaluation of 'mode-line-format'.

That's where its needed, yes.  If callable and called in other contexts
then the value can be undefined as far as I am concerned.

>> Now I am not saying this absolutely has to be done.  I am quite happy
>> with the above code.  But since I noticed this edge-case I though I
>> would point it out in case you decide that this is something we cannot
>> live with.
>
> So maybe we should just provide a function called 'mode-line-active-p'
> that returns non-nil when the window whose mode-line is just processed
> is considered active (whether that decision is right or wrong) and not
> talk about the selected window in the first place.

That would be perfect for packages such as moody and powerline, but of
course the code you posted might be useful in other contexts as well.

  Thanks!
  Jonas



reply via email to

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