[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] update the behavior of highlight-nonselected-windows
From: |
Stefan Monnier |
Subject: |
Re: [PATCH] update the behavior of highlight-nonselected-windows |
Date: |
Tue, 31 Mar 2015 08:52:14 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
> - (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