如何让emacs快速打开新缓冲区?

时间:2010-03-03 17:09:13

标签: emacs buffer

我以前能够使用命令C-x b <non existent buffer name>

快速在Emacs中打开一个新的缓冲区

不知怎的,我在我的Emacs版本(23.1)中打破了这个。当我尝试这样做时,我在命令缓冲区中收到消息[No match]

有谁知道我可能做了什么来打破这个功能,或者我有可能想到能够做到这一点?

4 个答案:

答案 0 :(得分:9)

confirm-nonexistent-file-or-buffer设为nil

confirm-nonexistent-file-or-buffer is a variable defined in `files.el'.
Its value is after-completion

Documentation:
Whether confirmation is requested before visiting a new file or buffer.
If nil, confirmation is not requested.
If the value is `after-completion', confirmation is only
 requested if the user called `minibuffer-complete' right before
 `minibuffer-complete-and-exit'.
Any other non-nil value means to request confirmation.

This affects commands like `switch-to-buffer' and `find-file'.

You can customize this variable.

This variable was introduced, or its default value was changed, in
version 23.1 of Emacs.

答案 1 :(得分:7)

如果您启用了ido-mode,您仍然可以切换到您熟悉的行为。当我知道我将创建一个新的命名缓冲区时,我经常这样做。

C-x b C-b

答案 2 :(得分:3)

C-j 而不是按两次输入,这将绕过确认并立即打开新缓冲区。这可以使用或不使用ido-mode。如果将confirm-nonexistent-file-or-buffer设置为nil,请按Enter键,效果相同。

答案 3 :(得分:2)

您可能启用了ido-mode。您需要按ENTER确认缓冲区的创建。