help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: `auto-dim-other-windows` -- scrutiny invited


From: Steven Degutis
Subject: Re: `auto-dim-other-windows` -- scrutiny invited
Date: Tue, 2 Apr 2013 17:48:26 -0500

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, Óscar Fuentes <ofv@wanadoo.es> wrote:
Steven Degutis <sbdegutis@gmail.com> 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.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]