M-x all-things-emacs

Quick Tip: visible-bell

February 6th, 2007 by Ryan McGeary · 8 Comments

This one is personal preference, but I find it annoying when emacs beeps on errors. I like knowing when something bad/unexpected happened, but the beep is too much when the sound is on and useless when muted. Add this to your .emacs to enable a visual alert cue that flashes the frame instead:

(setq visible-bell t)

Note: From what I can tell, this only works under a windowing system, so it won’t do much good if you run emacs in terminal mode.

Tags: quick · tips

8 responses so far ↓

  • 1 Todd Larason // Feb 6, 2007 at 7:02 am

    For reasons I still haven’t figured out, my X server locks up when emacs beeps, so it’s vital that emacs really doesn’t ever beep. Setting visible-bell doesn’t work well enough — it seems to get turned off under some circumstances (I haven’t figured that out yet, either).

    So, I’ve been using:

    (setq ring-bell-function (lambda () (message "*beep*")))

    that isn’t great, since I can miss beeps, but it works reliably. It would be nice if the visible-bell functionality were exposed more directly, but as far as I can tell it’s not, and I haven’t come up with an elisp version I’m happy with.

  • 2 Jason // Feb 8, 2007 at 1:53 pm

    For a visible bell in terminal mode, you can run emacs under screen, and tell screen to make the normal bell visible; this works for all your terminal programs, not just emacs.

  • 3 kmmbvnr // Mar 2, 2007 at 5:09 am

    Some alerts are useful in any case. You are not obliged to disable all of them.

    ;; Emacs does not beep or flash anymore, 
    ;; on hit C-g in the minibuffer or during 
    ;; an isearch.
    (setq ring-bell-function 
          (lambda ()
            (unless (memq this-command
                          '(isearch-abort abort-recursive-edit 
                                          exit-minibuffer
                                          keyboard-quit))
              (ding))))
  • 4 http://www.localprohandymen.org // Jul 2, 2015 at 2:52 am

    ... [Trackback]

    [...] There you will find 1315 more Infos: emacsblog.org/2007/02/06/quick-tip-visible-bell/ [...]

  • 5 http://fullcontracting.com // Jul 2, 2015 at 3:59 am

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/02/06/quick-tip-visible-bell/ [...]

  • 6 http://www.innercircletrading.com/ // Jul 2, 2015 at 10:53 am

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/02/06/quick-tip-visible-bell/ [...]

  • 7 Bonuses // Jul 2, 2015 at 4:58 pm

    ... [Trackback]

    [...] There you will find 69616 more Infos: emacsblog.org/2007/02/06/quick-tip-visible-bell/ [...]

  • 8 london rat catcher // Jul 4, 2015 at 12:25 am

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/02/06/quick-tip-visible-bell/ [...]