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 00:19:23 +0200 Message-ID: <87vc84shhw.fsf@wanadoo.es> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1364941189 19309 80.91.229.3 (2 Apr 2013 22:19:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Apr 2013 22:19:49 +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 00:20:17 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 1UN9Yv-00076d-2A for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Apr 2013 00:20:17 +0200 Original-Received: from localhost ([::1]:32899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN9YW-00012E-BV for geh-help-gnu-emacs@m.gmane.org; Tue, 02 Apr 2013 18:19:52 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN9YG-000115-Vf for help-gnu-emacs@gnu.org; Tue, 02 Apr 2013 18:19:38 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UN9YG-0001XU-0C for help-gnu-emacs@gnu.org; Tue, 02 Apr 2013 18:19:36 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:47241) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UN9YF-0001XF-QA for help-gnu-emacs@gnu.org; Tue, 02 Apr 2013 18:19:35 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1UN9Yb-0006wp-Mr for help-gnu-emacs@gnu.org; Wed, 03 Apr 2013 00:19:57 +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 00:19:57 +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 00:19:57 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 39 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:yL8O+OTB5A4WzUSKk3rMR3QEX6w= 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:89913 Archived-At: Steven Degutis writes: > (defun auto-dim-other-windows () > (make-face 'sd/dimmed-font) > (set-face-attribute 'sd/dimmed-font nil :background "black") > > (defun sd/prominantize-current-buffer (fn) > (buffer-face-set 'sd/dimmed-font) > (funcall fn) > (buffer-face-set nil)) > > (defmacro sd/advise-window-changing-fn (fn) > `(defadvice ,fn (around window-changing-fn-advice activate) > (sd/prominantize-current-buffer (lambda () ad-do-it)))) > > (sd/advise-window-changing-fn other-window) > (sd/advise-window-changing-fn other-frame) > (sd/advise-window-changing-fn next-buffer) > (sd/advise-window-changing-fn previous-buffer) > (sd/advise-window-changing-fn quit-window) > (sd/advise-window-changing-fn mouse-select-window)) Interesting idea. Some observations (in case you already are interested on bugs & enhancements): Newly created windows doesn't show the effect (to replicate just do M-x 2). It is necessary to have different buffers on each window and move the cursor form one to another one time to trigger the background change. When the other window contains several backgrounds, the effect is displeasing. Instead of picking a hard-coded background for the other windows, maybe the current default background should be probed and a transformation (darken, etc) applied to it. This would be most useful for users who change themes from time to time.