mina86 / auto-dim-other-buffers.el

Visually makes non-selected windows less prominent
GNU General Public License v3.0
92 stars 13 forks source link

Possible to never dim the which-key buffer? #25

Closed Dima-369 closed 3 years ago

Dima-369 commented 3 years ago

I am using https://github.com/justbur/emacs-which-key with this amazing package and have noticed that the which-key buffer is apparently always dimmed regardless of what configuration I use:

image

I tried variations of the code below but the *which-key* buffer or frame (or however Emacs calls that) is never messaged, so I guess the below can not be used to detect that buffer.

(defun adob--never-dim-p (buffer)
  (message (buffer-name buffer)
  (not (eq (buffer-name buffer) "*which-key*"))))

Do you know of an easy fix to this? Thank you :)


In the which-key documentation there is the option to display the window in the minibuffer: (which-key-setup-minibuffer) but it turns out that it is broken for me and the keys are only briefly shown and then the window clears. Really no clue why :(

Though in that case, the minibuffer is correctly not dimmed, but as mentioned I can't use that.

mina86 commented 3 years ago

adob--never-dim-p is not used in Emacs 27+ so changing it has no effect. I’ve pushed a new version which introduces auto-dim-other-buffers-never-dim-buffer-functions hook which can be used though. You can grab it directly from the repository or wait for MELPA to update the package.

Dima-369 commented 3 years ago

Thank you! The code below in the commit message works perfectly:

(defun mpn-never-dim-hidden (buf)
  (eq ?\s (aref (buffer-name buf) 0)))
(add-hook 'auto-dim-other-buffers-never-dim-buffer-functions #'mpn-never-dim-hidden)