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

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

bug#1305: All code that currently beeps should use visual bell instead


From: Dmitry Gutov
Subject: bug#1305: All code that currently beeps should use visual bell instead
Date: Sun, 18 Apr 2021 18:26:10 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 18.04.2021 15:36, Lars Ingebrigtsen wrote:
So you could say that there's some precedence for using
just the echo area as the only notification mechanism (beyond apparently
all the popular Emacs distributions doing exactly that).

Not really all of them. Here's what the distributions do:

Prelude and Spacemacs:

  (setq ring-bell-function 'ignore)

better-defaults:

  (setq visible-bell t)

Doom:

  (setq ring-bell-function #'doom-themes-visual-bell-fn
        visible-bell t)

  (defface doom-visual-bell '((t (:inherit error)))
    "Face to use for the mode-line when `doom-themes-visual-bell-config'
  is used."
    :group 'doom-themes)

  ;;;###autoload
  (defun doom-themes-visual-bell-fn ()
    "Blink the mode-line red briefly. Set `ring-bell-function' to this
  to use it."
(let ((doom-themes--bell-cookie (face-remap-add-relative 'mode-line 'doom-visual-bell)))
      (force-mode-line-update)
      (run-with-timer 0.15 nil
                      (lambda (cookie buf)
                        (with-current-buffer buf
                          (face-remap-remove-relative cookie)
                          (force-mode-line-update)))
                      doom-themes--bell-cookie
                      (current-buffer))))





reply via email to

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