禁用 Carbon Emacs 滚动蜂鸣声

发布于 2024-07-09 16:04:24 字数 149 浏览 8 评论 0原文

我一直在考虑在我的 Mac 上使用 Carbon Emacs,但我遇到的唯一障碍是当您尝试滚动到文档末尾时发出烦人的滚动蜂鸣声。 我在网上查看过,但似乎找不到应该添加到我的 .emacs 中的内容,以阻止它在滚动时发出蜂鸣声。 我不想让它完全静音,只是在滚动时。 有任何想法吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

土豪我们做朋友吧 2024-07-16 16:04:24
(setq visible-bell t)

这使得 emacs 闪烁而不是发出蜂鸣声。

(setq visible-bell t)

This makes emacs flash instead of beep.

把人绕傻吧 2024-07-16 16:04:24

使用 Emacs wiki AlarmBell 页面 中的提示,这对我来说是这样的:

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

如果你不这样做知道命令的名称,请按 Ch k,然后按您想要获取名称的键/操作。

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.

司马昭之心 2024-07-16 16:04:24

您必须自定义ring-bell-function

此页面可能提供提示:

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

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

This page may provide hints:

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

羁绊已千年 2024-07-16 16:04:24

在 Stephen Hassard 的回答和 Kipton Barros 的评论之间:

(setq ring-bell-function 'ignore)

似乎是最简洁的,适用于 emacs 24.x,并回答了原始问题。

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.

美人如玉 2024-07-16 16:04:24

这似乎可以解决问题:

(setq ring-bell-function nil)

This seems to do the trick:

(setq ring-bell-function nil)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文