【问题标题】:Emacs: disable beep when trying to move beyond the end of the documentEmacs:尝试超出文档末尾时禁用哔声
【发布时间】:2012-07-26 23:55:22
【问题描述】:

当试图将光标移动到文档的开头或结尾之外时,有没有办法在 Emacs 中禁用哔声?我通常不会介意,但触控板上滚动的动量使得每当我滚动到文档的顶部或底部时它都会发出十几次哔哔声。

如果可能的话,我宁愿不要为其他事情禁用铃声。

【问题讨论】:

标签: emacs scroll beep


【解决方案1】:

(setq ring-bell-function 'ignore)

在您的.emacs 中。这将完全禁用铃声,这可能不是您想要的。

【讨论】:

  • 这完全禁用了铃声,这并不是问题所要问的,但恰好正是我想要的。谢谢!
【解决方案2】:

当滚动到限制时(将以下内容添加到您的 .emacs 或其他 init 文件中),我可以很好地禁用铃只是

(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

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2012-05-19
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-08-02
  • 2011-07-22
  • 1970-01-01
相关资源
最近更新 更多