From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.help Subject: Re: `auto-dim-other-windows` -- scrutiny invited Date: Wed, 03 Apr 2013 19:03:18 +0200 Message-ID: <87r4irr1gp.fsf@wanadoo.es> References: <87ehersl1c.fsf@wanadoo.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1365008635 23502 80.91.229.3 (3 Apr 2013 17:03:55 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Apr 2013 17:03:55 +0000 (UTC) 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:04:22 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 1UNR6h-0003so-DS for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Apr 2013 19:04:19 +0200 Original-Received: from localhost ([::1]:43878 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNR6I-000715-GK for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Apr 2013 13:03:54 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:39521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNR63-0006z7-45 for help-gnu-emacs@gnu.org; Wed, 03 Apr 2013 13:03:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNR60-000564-5w for help-gnu-emacs@gnu.org; Wed, 03 Apr 2013 13:03:39 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:50498) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNR5z-00055t-VT for help-gnu-emacs@gnu.org; Wed, 03 Apr 2013 13:03:36 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UNR6M-0003ZC-FR for help-gnu-emacs@gnu.org; Wed, 03 Apr 2013 19:03:58 +0200 Original-Received: from 255.red-83-32-114.dynamicip.rima-tde.net ([83.32.114.255]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 03 Apr 2013 19:03:58 +0200 Original-Received: from ofv by 255.red-83-32-114.dynamicip.rima-tde.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 03 Apr 2013 19:03:58 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 32 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 255.red-83-32-114.dynamicip.rima-tde.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) Cancel-Lock: sha1:QKp45Gu7ol3U5/3rHEnONfPdpRI= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:89952 Archived-At: Steven Degutis writes: > 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. I don't know if I'm qualified for this task, especially since I > barely know elisp. This is the task of a global minor mode. As you probably know, minor modes can be activated and deactivated at whim. On activation, the minor mode stores the default background and changes it for the "dimmed" one. Then applies an overlay to the buffer in the active window, assigning the `window' property. When the user deactivates the minor mode, the previous default background is recovered. There are details like what happens if the user changes the default background while the minor mode is activated and dealing with the fact that the default background is per-frame.