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: Wed, 3 Apr 2013 09:44:07 -0500 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d042dfd57e735fa04d975e299 X-Trace: ger.gmane.org 1365000277 12518 80.91.229.3 (3 Apr 2013 14:44:37 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 3 Apr 2013 14:44:37 +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 16:45:05 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 1UNOvw-0008Fe-TG for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Apr 2013 16:45:05 +0200 Original-Received: from localhost ([::1]:40175 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNOvX-0002EF-JO for geh-help-gnu-emacs@m.gmane.org; Wed, 03 Apr 2013 10:44:39 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:56434) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNOv8-0002Ch-Lc for help-gnu-emacs@gnu.org; Wed, 03 Apr 2013 10:44:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UNOv3-0003N3-24 for help-gnu-emacs@gnu.org; Wed, 03 Apr 2013 10:44:14 -0400 Original-Received: from mail-pb0-f43.google.com ([209.85.160.43]:43735) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UNOv2-0003Lp-Rz for help-gnu-emacs@gnu.org; Wed, 03 Apr 2013 10:44:08 -0400 Original-Received: by mail-pb0-f43.google.com with SMTP id md4so893373pbc.30 for ; Wed, 03 Apr 2013 07:44:08 -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:content-type; bh=jez/+yBsjqp7YklsKE7uhEZw7BqwgJI086xpzAmaX/Y=; b=jpb5LY/Kg638/aO6MMLLii+cKuZgGvLRa7AkCpJk+rQhOxQQdfLW2p44iLIUycVhM9 Zg6GZmJnbmktff7UnazDnr90wfNyH4WG4ywA/oUaHXJYuSdXRFGPYjG8lpLWwzGL3Kq/ LKvzVd0OWQNH1f/V+ivfVyHQ8ggQC5OCm71iJmlEU+yuGlynRugPf+jdUq9QhViH4k3y oyBtSUblr0MSXjjXssSH7a/b0gNfdAQvmAQURhwvpUvshCWqBgAv3eWbYZeM0+v0KzXZ QomOnYlZunew7pXybkCS0D4zV586d0nzqrfTvSNtMiFUL5gysm+4kauGi/LYcdhYVJpo +gYw== X-Received: by 10.66.76.135 with SMTP id k7mr3462727paw.180.1365000248042; Wed, 03 Apr 2013 07:44:08 -0700 (PDT) Original-Received: by 10.70.6.100 with HTTP; Wed, 3 Apr 2013 07:44:07 -0700 (PDT) In-Reply-To: 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:89934 Archived-At: --f46d042dfd57e735fa04d975e299 Content-Type: text/plain; charset=ISO-8859-1 It's now called `auto-dim-other-buffers` and it just got a whole lot more efficient and faster: https://github.com/sdegutis/auto-dim-other-buffers.el There's one bug left that I don't know how to fix: for some reason, anything echoed in the echo area is dimmed. Not really sure why or even how. Why didn't anything like this exist all this time? I've checked stackoverflow for something like this months ago and the "chosen answer" was to just use a more distinct modeline. But this is much better. -Steven On Tue, Apr 2, 2013 at 4:06 PM, Steven Degutis wrote: > (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)) > > -Steven > --f46d042dfd57e735fa04d975e299 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
It's now called `auto-dim-other-buffers` and it just g= ot a whole lot more efficient and faster:=A0https://github.com/sdegutis/auto-dim-oth= er-buffers.el

There's one bug left that I don't know how to fix: f= or some reason, anything echoed in the echo area is dimmed. Not really sure= why or even how.

Why didn't anything like this = exist all this time? I've checked stackoverflow for something like this= months ago and the "chosen answer" was to just use a more distin= ct modeline. But this is much better.

-Steven


On Tue, Apr 2, 2013 at 4:06 PM,= Steven Degutis <sbdegutis@gmail.com> wrote:
=A0 =A0 (defun au= to-dim-other-windows ()
=A0 =A0 =A0 (make-face 'sd/dimmed= -font)
=A0 =A0 =A0 (set-face-attribute 'sd/dimmed-font nil :background &q= uot;black")
=A0 =A0=A0
=A0 =A0 =A0 (defun sd/prominantize-current-buffer (fn)
=A0 = =A0 =A0 =A0 (buffer-face-set 'sd/dimmed-font)
=A0 =A0 =A0 =A0= (funcall fn)
=A0 =A0 =A0 =A0 (buffer-face-set nil))
= =A0 =A0=A0
=A0 =A0 =A0 (defmacro sd/advise-window-changing-fn (fn= )
=A0 =A0 =A0 =A0 `(defadvice ,fn (around window-changing-fn-advice acti= vate)
=A0 =A0 =A0 =A0 =A0 =A0(sd/prominantize-current-buffer (lam= bda () ad-do-it))))
=A0 =A0=A0
=A0 =A0 =A0 (sd/advise-w= indow-changing-fn other-window)
=A0 =A0 =A0 (sd/advise-window-changing-fn other-frame)
=A0 =A0 =A0 (sd/advise-window-changing-fn next-buffer)
=A0 =A0 = =A0 (sd/advise-window-changing-fn previous-buffer)
=A0 =A0 =A0 (s= d/advise-window-changing-fn quit-window)
=A0 =A0 =A0 (sd/advise-window-changing-fn mouse-select-window))
<= span class=3D"HOEnZb">

=
-Steven

--f46d042dfd57e735fa04d975e299--