Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emacs: disable beep when trying to move beyond the end of the document

Tags:

Is there a way to disable the beep in Emacs when trying to move the cursor beyond the beginning or end of a document? I normally wouldn't mind, but the momentum scrolling on my trackpad makes it so that it beeps a dozen times whenever I scroll to the top or bottom of a document.

I'd rather not disable the bell for other things, if that's possible.

like image 267
asmeurer Avatar asked Jul 26 '12 23:07

asmeurer


2 Answers

Put

(setq ring-bell-function 'ignore) 

in your .emacs. This will disable the bell entirely, which might not be what you want.

like image 196
pmr Avatar answered Oct 21 '22 15:10

pmr


This works pretty well for me to disable the bell just when scrolling to limits (add the following to your .emacs or other init file) :

(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) 

Source

like image 22
Keith Flower Avatar answered Oct 21 '22 17:10

Keith Flower