From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Heerdegen Newsgroups: gmane.emacs.help Subject: Re: `auto-dim-other-windows` -- scrutiny invited Date: Wed, 03 Apr 2013 19:20:07 +0200 Message-ID: <877gkjh6pk.fsf@web.de> References: <87ehersl1c.fsf@wanadoo.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1365009631 2957 80.91.229.3 (3 Apr 2013 17:20:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Apr 2013 17:20:31 +0000 (UTC) Cc: =?utf-8?Q?=C3=93scar?= Fuentes , help-gnu-emacs@gnu.org To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 03 19:20:59 2013 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1UNRMi-0008Sb-GN for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Apr 2013 19:20:52 +0200 Original-Received: from localhost ([::1]:54959 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNRMJ-0002KV-N3 for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Apr 2013 13:20:27 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44222) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNRM7-0002GF-Hb for help-gnu-emacs@gnu.org; Wed, 03 Apr 2013 13:20:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNRM3-0003EC-7Y for help-gnu-emacs@gnu.org; Wed, 03 Apr 2013 13:20:15 -0400 Original-Received: from mout.web.de ([212.227.15.4]:64639) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNRM2-0003Dz-Uo for help-gnu-emacs@gnu.org; Wed, 03 Apr 2013 13:20:11 -0400 Original-Received: from drachen.dragon ([92.74.136.91]) by smtp.web.de (mrweb001) with ESMTPSA (Nemesis) id 0MK2JZ-1UMc0b18ar-001RnF; Wed, 03 Apr 2013 19:20:08 +0200 Mail-Followup-To: help-gnu-emacs@gnu.org, =?utf-8?Q?=C3=93scar?= Fuentes , help-gnu-emacs@gnu.org In-Reply-To: (Steven Degutis's message of "Wed, 3 Apr 2013 11:03:28 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Provags-ID: V02:K0:2yOz/mhbdgP2atoZ9YRwUjex6v7QKGU0LNMK3EzvH39 pJech4y/Wd+GHY3gTAiJzgPw0RHPvsQtLOOgqzHSiJbdPutUMr LQWBdDf+US3NWyE4UsSre0h2YyCUKhe9/EtxbtsIkcgsnn42b9 ZSDm82eeesAajrCqXV03P5xG3dxSvinpKxKvPQP8Y8GxbLc9Le m98qkBWPMCQGhFq3CSqmzt48u/kdQLIq5TKVQMckmA= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4.x-2.6.x [generic] X-Received-From: 212.227.15.4 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:89955 Archived-At: Steven Degutis writes: > Hmm, it seems that using overlays could allow the dimming to be > per-window instead of per-buffer. > > But overlays have a few quirks. Yes. BTW, efficiency is not among them in our case. If you had hundreds or thousands of overlays in a buffer (e.g. one in every single line in a very large buffer), it is another thing. > First, they're still per-buffer. You can copy them around different > buffers, but each buffer has to have its own. So if we were going to > use them to dim other windows, every buffer would have to always have > an extra overlay in it. > > Second, while they do have a 'window' property that allows them to be > visible only when the buffer is in a given window, this is the > inverse of what we want. We would want them to be visible only when > the buffer is *not* in (selected-window). Right. It would complicate the code, no doubt. > There's a few ways these could be worked around. > > We could add overlays to every buffer, and whenever you change > windows, remove the overlay from the current buffer and add it back > to the previous buffer. But this is identical to what > `auto-dim-other-buffers` already does now, only harder to write. When > you remove it from the current buffer, you could have the same buffer > open in multiple windows, and in all of them it's gone. That's not exactly what I had in mind. For every not-selected window w_n, the displayed buffer b_n would get an overlay with the `window' overlay property being w_n. This implies that buffers can get more than one overlay (if visible in multiple windows). In the selected window, those overlays are not visible, because it is different from all windows specified in any `window' properties. So, this approach would work, but OTOH, some users also may like the current behavior. > Or, we could have it reversed. We could only have an overlay on the > current buffer at any given time, and give it the window of > (selected-window), and keep updating these any time you change > buffers or windows. This would successfully "differentiate" the > current window from every other window and allow you to style it > differently. But it has the problem of being the exact inverse of the > original goal, which is to dim other windows. It would be more like > `auto-prominentize-current-window`. > > The problem would then be that you now need to make the current > buffer look different than the default face. But by definition, the > default face is *exactly* what you want to be editing in. > > So one hacky way to solve this is to somehow "switch out" the default > face with the one you want to be considered "dimmed", and give the > current-window-overlay the face that was originally your "default > face". > > This seems like it *could* work, but it's terrifying. Absolutely > terrifying. Right. Apropos echo area: Note that the minibuffer-window is also a visible window - the window where the echo area or the minibuffer, respectively, is displayed. HTH, Michael.