35

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.

ideasman42
  • 8,375
  • 1
  • 28
  • 105
Anna Leonenko
  • 453
  • 1
  • 4
  • 7

4 Answers4

34

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.

Drew
  • 75,699
  • 9
  • 109
  • 225
  • 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 – Anna Leonenko Nov 26 '16 at 15:06
  • 2
    You can put variable settings in your [init file](http://www.gnu.org/software/emacs/manual/html_node/emacs/Init-File.html) (and see [Find Init](http://www.gnu.org/software/emacs/manual/html_node/emacs/Find-Init.html)), 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 Nov 26 '16 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"? – Anna Leonenko Nov 26 '16 at 15:39
  • ok, I'm in helh menue or somethig got there by C-h r, but where there to find anything relates to my problem? – Anna Leonenko Nov 26 '16 at 15:44
  • should I write this init file from the scratch? – Anna Leonenko Nov 26 '16 at 15:46
  • `C-h r` takes you to the *Emacs* manual. To use the manual, you would do well to first do **`C-h i`** and choose the ***Info*** manual - that will tell you *how to use the manuals* from within Emacs. – Drew Nov 26 '16 at 15:56
  • You can use **`C-x C-f ~/.emacs`** to create an init file. But first read about the init file a bit. – Drew Nov 26 '16 at 15:57
  • 10
    @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 Nov 05 '18 at 02:29
  • 1
    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. – Christian Herenz Dec 09 '19 at 17:36
3

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
phils
  • 48,657
  • 3
  • 76
  • 115
1

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)))
    (run-with-timer
     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)))
     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))))
ideasman42
  • 8,375
  • 1
  • 28
  • 105
1

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