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?
+2
A:
You will have to customize the ring-bell-function
.
This page may provide hints:
Svante
2008-11-27 19:12:34
Alas, that won't work. For example, the next-line function has a "ding" hard-coded into it.
ShreevatsaR
2008-11-27 19:30:12
Hmm. Couldn't you just redefine the next-line function in your .emacs then?
Svante
2008-11-28 01:27:57
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
2008-11-28 07:18:25
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
2008-12-08 22:00:34
+4
A:
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))
(ding)))
(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.
nominolo
2009-04-08 20:22:27