Take the 2-minute tour ×

I've been looking into adopting Carbon Emacs for use on my Mac, and the only stumbling block I've run into is the annoying scroll beep when you try to scroll past the end of the document. I've looked online but I can't seem to find what I should add to my .emacs that will stop it from beeping when scrolling. I don't want to silence it completely, just when scrolling. Any ideas?

share|improve this question
add comment

4 Answers

Using the hints from the Emacs wiki AlarmBell page, this does it for me:

(defun my-bell-function ()
  (unless (memq this-command
    	'(isearch-abort abort-recursive-edit exit-minibuffer
              keyboard-quit mwheel-scroll down up next-line previous-line
              backward-char forward-char))
(setq ring-bell-function 'my-bell-function)

If you don't know the name of a command, press C-h k then the key/action you would like to get the name of.

share|improve this answer
add comment
(setq visible-bell t)

This makes emacs flash instead of beep.

share|improve this answer
True, but this will silence everything, which the OP wanted to avoid. This is what I use though - the visual bell is just as helpful as an audible one, and doesn't interfere with music when I'm using headphones. I'd recommend it to 'nobody' anyway. –  jmanning2k Dec 8 '08 at 22:00
add comment

You will have to customize the ring-bell-function.

This page may provide hints:


share|improve this answer
Alas, that won't work. For example, the next-line function has a "ding" hard-coded into it. –  ShreevatsaR Nov 27 '08 at 19:30
Hmm. Couldn't you just redefine the next-line function in your .emacs then? –  Svante Nov 28 '08 at 1:27
You'll have to redefine not just next-line and previous-line, but also scroll-up, scroll-down, and a whole lot of functions; many of which are defined in "C source code" and whose source does not ship with Carbon Emacs. Someone correct me if I'm wrong. –  ShreevatsaR Nov 28 '08 at 7:18
add comment

This seems to do the trick:

(setq ring-bell-function nil)
share|improve this answer
Correction: nil should be replaced by 'ignore. This will disable all bell ringing. –  Kipton Barros Feb 11 '13 at 23:20
add comment

Your Answer


