all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Oleh Krehel <ohwoeowho@gmail.com>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: [PATCH] update the behavior of highlight-nonselected-windows
Date: Tue, 31 Mar 2015 08:52:14 -0400	[thread overview]
Message-ID: <jwvr3s58hi7.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <CAA01p3rX+SSAh=4gofj6D8uEDiiyVUwfMv2-v2m1AqsNwFhfCg@mail.gmail.com> (Oleh Krehel's message of "Tue, 31 Mar 2015 13:53:33 +0200")

> -          (mapc #'redisplay--update-region-highlight windows)
> +          (mapc #'redisplay--update-region-highlight
> +                (delq nil
> +                      (mapcar (lambda (w)
> +                                (unless (eq (window-buffer w)
> +                                            (current-buffer))
> +                                  w))
> +                              windows)))

I don't think depending on the value of `current-buffer' can be right.
More specifically, it will only do what (I think) you want in the case
where the buffer who's displayed in several windows (and has an active
region) happens to be the current buffer.

IIUC the problem that annoys you, it comes from the fact that the
region is defined to be "anything between point and mark" but point is
a per-window attribute while mark is a per-buffer attribute.

Maybe a way to solve this issue would be to keep track of the window in
which the mark was made active.  E.g. instead of setting mark-active to
t we'd set it to (selected-window).  And then we could change
redisplay--update-region-highlights to only highlight in the window
specified by mark-active.


        Stefan



  reply	other threads:[~2015-03-31 12:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-31 11:53 [PATCH] update the behavior of highlight-nonselected-windows Oleh Krehel
2015-03-31 12:52 ` Stefan Monnier [this message]
2015-03-31 12:59 ` Eli Zaretskii

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=jwvr3s58hi7.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=ohwoeowho@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 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.