Disable Carbon Emacs scroll beep

前端 未结 5 1320
一生所求
一生所求 2020-12-30 08:34

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

相关标签:
5条回答
  • 2020-12-30 08:43

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

    This page may provide hints:

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

    0 讨论(0)
  • 2020-12-30 08:48
    (setq visible-bell t)
    

    This makes emacs flash instead of beep.

    0 讨论(0)
  • 2020-12-30 08:52

    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.

    0 讨论(0)
  • 2020-12-30 09:03

    This seems to do the trick:

    (setq ring-bell-function nil)
    
    0 讨论(0)
  • 2020-12-30 09:04

    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.

    0 讨论(0)
提交回复
热议问题