Those sounds all the way drive me crazy, but it is uncomfortable to switch off system sounds at all because I need them in other places same time. I didn't find any settings where I could manage the sounds.

  • 17
    I assume you mean the annoying bell sound in emacs. If that's the case, you can disable it by adding this in your .emacs : (setq ring-bell-function 'ignore) Commented Nov 25, 2016 at 21:01
  • @ChakravarthyRaghunandan sorry, but I didn't find this file, could you give a hint? Commented Nov 26, 2016 at 14:45
  • o my god YES, I found it because I forgot to setup the folder for search and it searched through all the disks. It helped, thanx a lot! Commented Nov 26, 2016 at 15:54
  • See also stackoverflow.com/questions/10545437/…
    – phils
    Commented Aug 13, 2023 at 1:33

4 Answers 4


Turn off the bell, use the visual bell instead, or replace bell-ringing by some other visual indication.

You can set ring-bell-function to a function such as ignore, to just turn off all indication.

Or you can customize option visible-bell, to use a frame flash instead of a sound.

Or you can use minor mode echo-bell-mode from library echo-bell.el to get just a brief visual indication in the echo area.

See also the Elisp manual, node Beeping.

  • 3
    but where to do it? I do not see any hint nor here neither by the link, I'm missing some base knowledge everybody knows Commented Nov 26, 2016 at 15:06
  • 2
    You can put variable settings in your init file (and see Find Init), and you can turn on a minor mode there. The Emacs manual (C-h r) is your friend. A little time spent there can really help you wrt base knowledge, and a lifetime spent there can be a great pastime. ;-)
    – Drew
    Commented Nov 26, 2016 at 15:32
  • I try to follow the instructions in @find file@, but I have no HOME enviroment vaiable (what makes sence, I have never set up HOME), and I also can't find init file by it's name by total commande's "find". Could it have a name like "ediff-init.el" or "viper-init.el"? Commented Nov 26, 2016 at 15:39
  • 12
    @AnnaLeonenko just put the following lines in your ~/.emacs file: (setq visible-bell t) and (setq ring-bell-function 'ignore). You will also need to restart your emacs or eval the file.
    – rph
    Commented Nov 5, 2018 at 2:29
  • 2
    I usually set things up with customize. I.e. you do 'M-x describe-variable ENTER ring-bell-function` then you can go to a menu where you can select silent. Commented Dec 9, 2019 at 17:36

If you compile Emacs yourself, and you don't want it to be capable of producing sound in general, then you can use:

./configure --without-sound

Instead of turning off sound, you can use a visible-bell,

this function temporarily inverts the mode-line/header-line

(defun my-mode-line-visual-bell ()
  (setq visible-bell nil)
  (setq ring-bell-function 'my-mode-line-visual-bell--flash))

(defun my-mode-line-visual-bell--flash ()
  (let ((frame (selected-frame)))
     0.1 nil
     #'(lambda (frame)
         (let ((inhibit-quit)
               (inhibit-redisplay t))
           (invert-face 'header-line frame)
           (invert-face 'header-line-highlight frame)
           (invert-face 'mode-line frame)
           (invert-face 'mode-line-inactive frame)))
    (let ((inhibit-quit)
          (inhibit-redisplay t))
      (invert-face 'header-line frame)
      (invert-face 'header-line-highlight frame)
      (invert-face 'mode-line frame)
      (invert-face 'mode-line-inactive frame))))

Add line below to your .emacs.d/init.cl file or any other startup file:

(set-message-beep 'silent)

For more information on this topic look at help docs for set-message-beep via command C-h f followed by set-message-beep

This question are addresses in Emacs W32 FAQ > Display Settings > Beep Sound

  • 2
    n.b. this function is implemented for the MS Windows build only.
    – phils
    Commented Aug 13, 2023 at 1:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.