From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Steven Degutis Newsgroups: gmane.emacs.help Subject: Re: `auto-dim-other-windows` -- scrutiny invited Date: Tue, 2 Apr 2013 17:48:26 -0500 Message-ID: References: <87vc84shhw.fsf@wanadoo.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8ff1c3f60ea10e04d9688938 X-Trace: ger.gmane.org 1364942929 3012 80.91.229.3 (2 Apr 2013 22:48:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 2 Apr 2013 22:48:49 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?ISO-8859-1?Q?=D3scar_Fuentes?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 03 00:49: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 1UNA0x-0000B3-L0 for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Apr 2013 00:49:15 +0200 Original-Received: from localhost ([::1]:56667 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNA0Z-0007PF-1G for geh-help-gnu-emacs@m.gmane.org; Tue, 02 Apr 2013 18:48:51 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:51542) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNA0D-0007MT-Oo for help-gnu-emacs@gnu.org; Tue, 02 Apr 2013 18:48:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNA0B-0002Vk-6l for help-gnu-emacs@gnu.org; Tue, 02 Apr 2013 18:48:29 -0400 Original-Received: from mail-pb0-f43.google.com ([209.85.160.43]:37831) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNA0A-0002Vf-Tt for help-gnu-emacs@gnu.org; Tue, 02 Apr 2013 18:48:27 -0400 Original-Received: by mail-pb0-f43.google.com with SMTP id md4so496602pbc.16 for ; Tue, 02 Apr 2013 15:48:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=EwsTQrqt6BcUtlYsa81tSCbWHHT8O3SwOxTsOrP5fvM=; b=OaiK5jpOZDqqEZQjLAF1jBo/GP2P6M9URzLOmKoX1JNgEJFJsczBbSdKSLpPKlhMSe Gctp1kvfcTFKIR6sAY1Jx5V6gUPJ7iUmyR6ybWZlbwZ+Eyj+irvN2b6yBwo6etbca0uE /2mxxOO7sEAFYs+F5/2/ZVfusR+muuhFZ+X4998uasB8AyDCptsjnALpj31KhtRtXA1S qkHFUgyPfdT84IAFCo8pwXpqNmNGY710ZjNVQUVjrMTliYyzQak7yuBr+ZhxUDXTpfx3 zrzl3LT5jRtzyDWuSpzO6HJDJlCC4mqSyoHNfJJpMfl1jgX9xn6gKp1b5YS218WsPt2H VzVA== X-Received: by 10.68.212.170 with SMTP id nl10mr26855701pbc.39.1364942906104; Tue, 02 Apr 2013 15:48:26 -0700 (PDT) Original-Received: by 10.70.30.35 with HTTP; Tue, 2 Apr 2013 15:48:26 -0700 (PDT) In-Reply-To: <87vc84shhw.fsf@wanadoo.es> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 209.85.160.43 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:89915 Archived-At: --e89a8ff1c3f60ea10e04d9688938 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks for the ideas. I've made an official github repo here: https://github.com/sdegutis/auto-dim-other-buffers.el/ The face is now customizable, with the black-background one being a dumb default. This way, everyone can choose for themselves what will look right, whether the background should get lighter or darker or maybe the text color should instead. -Steven On Tue, Apr 2, 2013 at 5:19 PM, =D3scar Fuentes wrote: > 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. > > > --e89a8ff1c3f60ea10e04d9688938 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
Thanks for the ideas.

I've ma= de an official github repo here:=A0https://github.com/sdegutis/auto-dim-other-buffe= rs.el/

The face is now customizable, with the blac= k-background one being a dumb default. This way, everyone can choose for th= emselves what will look right, whether the background should get lighter or= darker or maybe the text color should instead.

-Steven


On Tue, Apr 2, 2013 at 5:19 PM, =D3sc= ar Fuentes <ofv@wanadoo.es> wrote:
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.



--e89a8ff1c3f60ea10e04d9688938--