themes
themes copied to clipboard
Visual bell doesn't work with solaire-mode
Theme(s)
All themes (base)
What were you expecting?
visual bell should work with solaire-mode
.
What actually happened?
visual bell doesn't work if solaire-mode
is enabled in the buffer.
Steps to reproduce
- Load one of doom themes.
- Eval
doom-themes-visual-bell-config
. - Press
C-g
. Visual bell (red flashing) appears. - Enable
solaire-mode
. - Press
C-g
. Nothing happens in the mode-line.
Operating system
All
Emacs version
29
Installed commit of doom-themes
20220619.2105
I can confirm it only occurs on 29. I found these comments
;; Since emacs 29, the mode-line face is the parent of the new face ;; mode-line-active and mode-line-inactive. For remapping purposes, the ;; mode-line-active face has to be used, see details at: ;; http://debbugs.gnu.org/cgi/bugreport.cgi?bug=53636
Not sure whether it's an issue of doom-themes
or solaire-mode
.
My workaround:
(defun doom-themes-visual-bell-fn ()
"Blink the mode-line red briefly. Set `ring-bell-function' to this to use it."
(let* ((buf (current-buffer))
(cookies `(,(face-remap-add-relative 'mode-line-active
'doom-themes-visual-bell)
,(face-remap-add-relative 'mode-line
'doom-themes-visual-bell))))
(force-mode-line-update)
(run-with-timer 0.15 nil
(lambda ()
(with-current-buffer buf
(mapc #'face-remap-remove-relative cookies)
(force-mode-line-update))))))
ping kindly...
Update the workaround:
(defun my-doom-themes-visual-bell-fn ()
"Blink the mode-line red briefly. Set `ring-bell-function' to this to use it."
(let ((buf (current-buffer))
(cookies (mapcar (lambda (face)
(face-remap-add-relative face 'doom-themes-visual-bell))
(if (facep 'mode-line-active)
'(mode-line-active solaire-mode-line-active-face)
'(mode-line solaire-mode-line-face)))))
(force-mode-line-update)
(run-with-timer 0.15 nil
(lambda ()
(with-current-buffer buf
(mapc #'face-remap-remove-relative cookies)
(force-mode-line-update))))))
(advice-add #'doom-themes-visual-bell-fn :override #'my-doom-themes-visual-bell-fn)