Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visual bell doesn't work with solaire-mode #733

Open
seagle0128 opened this issue Jun 20, 2022 · 4 comments
Open

Visual bell doesn't work with solaire-mode #733

seagle0128 opened this issue Jun 20, 2022 · 4 comments
Labels
is:bug Something isn't working as intended needs-triage Issue hasn't been assessed yet

Comments

@seagle0128
Copy link
Contributor

seagle0128 commented Jun 20, 2022

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

  1. Load one of doom themes.
  2. Eval doom-themes-visual-bell-config.
  3. Press C-g. Visual bell (red flashing) appears.
  4. Enable solaire-mode.
  5. Press C-g. Nothing happens in the mode-line.

Operating system

All

Emacs version

29

Installed commit of doom-themes

20220619.2105

@seagle0128 seagle0128 added is:bug Something isn't working as intended needs-triage Issue hasn't been assessed yet labels Jun 20, 2022
@hlissner hlissner added this to Triage Jun 20, 2022
@hlissner hlissner moved this to Unreviewed in Triage Jun 20, 2022
@seagle0128
Copy link
Contributor Author

seagle0128 commented Jun 25, 2022

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.

@seagle0128
Copy link
Contributor Author

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))))))

seagle0128 added a commit to seagle0128/.emacs.d that referenced this issue Jul 6, 2022
@seagle0128
Copy link
Contributor Author

ping kindly...

@seagle0128
Copy link
Contributor Author

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)

@hlissner hlissner removed this from Triage Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
is:bug Something isn't working as intended needs-triage Issue hasn't been assessed yet
Projects
None yet
Development

No branches or pull requests

1 participant