unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: E Sabof <esabof@gmail.com>
Cc: 14604@debbugs.gnu.org
Subject: bug#14604: 24.3.50.1; Possibly incorrect behaviour of frame-selected-window
Date: Thu, 13 Jun 2013 10:35:18 -0400	[thread overview]
Message-ID: <jwvd2rqf5nq.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CAEp6DyZCmQsH4CQAmiJNDUbpaKVX_RBtm=zWKP7Xarwsb8e_ig@mail.gmail.com>

> This works on 24.3, but on trunk all windows will be shown as "selected".
> (setq-default
>  mode-line-format
>  '(:eval (if (eq (frame-selected-window)
>                  (selected-window))
>              "selected"
>              "not-selected")))

Indeed this doesn't work any more.  This was one of the very few places
where (eq (frame-selected-window) (selected-window)) was nil, and this
"invariant" is presumed at various places in the C code, so it was
a bug.

BTW, this worked in Emacs<24.3 if you wanted to highlight every frame's
selected-window, but not if you wanted to highlight "the one and only
selected-window".  For single-frame settings, there's no difference,
of course.

There is no alternative, yet.  We should probably provide some ad-hoc
primitives (call them maybe display-selected-window and
display-frame-selected-window) which return something like "the window
that was selected when we entered redisplay".


        Stefan





  parent reply	other threads:[~2013-06-13 14:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-13 11:45 bug#14604: 24.3.50.1; Possibly incorrect behaviour of frame-selected-window E Sabof
2013-06-13 13:02 ` Eli Zaretskii
2013-06-13 13:47   ` E Sabof
2013-06-13 14:35 ` Stefan Monnier [this message]
2013-06-13 14:59   ` E Sabof
2013-06-13 16:04     ` Eli Zaretskii
2013-06-13 16:16       ` E Sabof
2013-10-30 17:50     ` Stefan Monnier
2013-10-30 19:23       ` E Sabof
2013-10-30 22:40         ` E Sabof
2013-10-30 23:30           ` Stefan Monnier
2013-11-01 21:13             ` E Sabof
2022-02-13  9:21 ` Lars Ingebrigtsen

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwvd2rqf5nq.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=14604@debbugs.gnu.org \
    --cc=esabof@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).