Skip to content

Commit

Permalink
Don't dim last buffer when switching to minibuffer or echo area.
Browse files Browse the repository at this point in the history
  • Loading branch information
sandinmyjoints committed Sep 25, 2017
1 parent 90f6a6f commit 853523a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions auto-dim-other-buffers.el
Expand Up @@ -63,6 +63,11 @@
:type 'boolean
:group 'auto-dim-other-buffers)

(defcustom auto-dim-other-buffers-dim-on-switch-to-minibuffer t
"Whether to dim last buffer when switching to minibuffer or echo area."
:type 'boolean
:group 'auto-dim-other-buffers)

(defvar adob--last-buffer nil
"Selected buffer before command finished.")

Expand Down Expand Up @@ -98,6 +103,12 @@ Currently only mini buffer and echo areas are ignored."
;; dimmed. if it's just killed, don't try to set its face.
(and (buffer-live-p adob--last-buffer)
(not (adob--ignore-buffer adob--last-buffer))
;; By default, dim last buffer on switch to any other buffer. But if
;; option is nil, then don't dim last buffer on switch to minibuffer
;; or echo area.
(or auto-dim-other-buffers-dim-on-switch-to-minibuffer
(not (or (minibufferp (current-buffer))
(string-match "^ \\*Echo Area" (buffer-name (current-buffer))))))
(with-current-buffer adob--last-buffer
(adob--dim-buffer t)))
;; now, restore the selected buffer, and undim it.
Expand Down

0 comments on commit 853523a

Please sign in to comment.