如何防止迷你缓冲区显示 Emacs 中以前的命令?

发布于 2024-09-05 02:45:07 字数 513 浏览 4 评论 0原文

我什至不确定这是以前的命令还是未完成的命令或其他什么,但我确实知道我真的不喜欢它。

我的问题是,一些命令(或消息,或其他什么)被困在迷你缓冲区中,这样当我键入新命令时,它很快就会出现在那里,然后迷你缓冲区又回到了顽固的命令。有些命令似乎是被选择的,在使用大量命令后,其他东西会卡在那里,但总是显示一些我不想看到的东西。我多次尝试输入 Cg 看它是否会退出,但这不起作用。

这是我现在拥有的图片:

alt text

我做什么并不重要,那一点

标签:hl-line

不会离开。当输入新命令时,它确实会暂时离开,但会返回。我不喜欢它,它很混乱,我更愿意看到最后使用的命令。

我确实检查了迷你缓冲区的自定义选项(在我的图片中可以看到它的底部),但我没有发现任何似乎是我正在寻找的东西。

有什么想法吗?

I am not even sure this is a previous command or a non-finished command or whatever, but I do know I really don't like it.

My problem is that some commands (or messages, or whatever) get stuck in the mini-buffer so that when I type a new command it appears there really quickly, and then the mini-buffer is back to the stubborn command. Some commands seem to be chosen, and after using lots of commands something else gets stuck there, but there is always something being shown that I don't want to see. I tried typing C-g lots of times to see if it would quit, but that does not work.

This is a picture of what I have now:

alt text

It does not matter what I do, that bit

Label: hl-line

will not leave. It does leave momentarily when a new command is typed, but it goes back. I don't like it, it is confusing, and I would much rather see there the last used command.

I did check the customisation options for the mini-buffer (the bottom part of it can be seen in my picture), but I found nothing that seemed to be what I was looking for.

Any ideas?

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

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

发布评论

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

评论(2

美羊羊 2024-09-12 02:45:07

您遇到这种情况很可能是因为您启动了一个命令并使用鼠标在不同的窗口中选择了某些内容。如果是这种情况,您可以让 Emacs 在您执行此类操作时自动中止该命令。

这是您要添加到 .emacs 中的代码:

(defun stop-using-minibuffer ()
  "kill the minibuffer"
  (when (and (>= (recursion-depth) 1) (active-minibuffer-window))
    (abort-recursive-edit)))

(add-hook 'mouse-leave-buffer-hook 'stop-using-minibuffer)

注意:我从我的 有关该主题的博客文章

还有一个解决此问题的超级用户问题,我的答案提供了一个命令 跳回迷你缓冲区

Chances are you're getting into the situation because you started a command and used your mouse to select something in a different window. If that's the case, you can have Emacs automatically abort the command when you do such an action.

This is the code you'd add to your .emacs:

(defun stop-using-minibuffer ()
  "kill the minibuffer"
  (when (and (>= (recursion-depth) 1) (active-minibuffer-window))
    (abort-recursive-edit)))

(add-hook 'mouse-leave-buffer-hook 'stop-using-minibuffer)

Note: I grabbed this from my blog post on the topic.

And there is also a super user question that addresses this issue, and my answer there provides a command to jump back to the minibuffer.

ら栖息 2024-09-12 02:45:07

迷你缓冲区失去焦点。尝试 Cx o (Control+xo) 重新获得焦点。要取消命令,请在迷你缓冲区中获得焦点时按 Cg。

The mini-buffer has lost focus. Try C-x o (Control+x o) to regain focus. To cancel the command press C-g when you have focus in the mini-buffer.

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