all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Jonas Bernoulli <jonas@bernoul.li>
To: martin rudalics <rudalics@gmx.at>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: Let mode-line packages distinguish the selected-window
Date: Mon, 28 Oct 2019 11:32:56 +0100	[thread overview]
Message-ID: <87r22xw46f.fsf@bernoul.li> (raw)
In-Reply-To: <43be954b-fc69-166f-eb51-fcf2c93c6ee1@gmx.at>

> 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	other threads:[~2019-10-28 10:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-26 13:38 Let mode-line packages distinguish the selected-window Jonas Bernoulli
2019-10-26 14:01 ` Eli Zaretskii
2019-10-26 21:10   ` martin rudalics
2019-10-27  5:01     ` Eli Zaretskii
2019-10-27  7:48       ` martin rudalics
2019-10-27 21:13     ` Jonas Bernoulli
2019-10-28  9:40       ` martin rudalics
2019-10-28 10:32         ` Jonas Bernoulli [this message]
2019-10-29  9:27           ` martin rudalics
2019-10-29 12:24             ` Eli Zaretskii
2019-10-29 18:05               ` martin rudalics
2019-10-29 18:46                 ` Eli Zaretskii
2019-10-30  8:14                   ` martin rudalics
2019-10-30 16:10                     ` Eli Zaretskii
2019-10-28 15:55       ` Eli Zaretskii
2019-10-29 11:50         ` Jonas Bernoulli
2019-10-26 16:36 ` Stefan Monnier
2019-10-26 19:27   ` Jonas Bernoulli
2019-10-26 19:41     ` Eli Zaretskii
2019-10-26 20:36     ` Stefan Monnier
2019-10-27 18:08       ` Jonas Bernoulli
2019-10-27 21:55         ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r22xw46f.fsf@bernoul.li \
    --to=jonas@bernoul.li \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.