Disable Carbon Emacs scroll beep

2019-02-04 20:03发布

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?

5条回答
我只想做你的唯一
2楼-- · 2019-02-04 20:22

Between Stephen Hassard's answer and Kipton Barros' comment:

(setq ring-bell-function 'ignore)

seems to be the most concise, works on emacs 24.x, and answers the original question.

查看更多
够拽才男人
3楼-- · 2019-02-04 20:22

This seems to do the trick:

(setq ring-bell-function nil)
查看更多
再贱就再见
4楼-- · 2019-02-04 20:26

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.

查看更多
Melony?
5楼-- · 2019-02-04 20:35
(setq visible-bell t)

This makes emacs flash instead of beep.

查看更多
Juvenile、少年°
6楼-- · 2019-02-04 20:40

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

This page may provide hints:

http://www.emacswiki.org/emacs/AlarmBell

查看更多
登录 后发表回答