ido-create-new-buffer 为什么没有效果

  1. 启动emacs emacs -q

  2. 启动 M-x ido-mode

  3. 设置(setq ido-create-new-buffer 'always)

ido-create-new-buffer is a variable defined in ‘ido.el’. Its value is ‘always’

Original value was prompt


Specify whether a new buffer is created if no buffer matches substring. Choices are ‘always’ to create new buffers unconditionally, ‘prompt’ to ask user whether to create buffer, or ‘never’ to never create new buffer.


  1. 当我C-x b skr, 显示Buffer: skr[Not Match]
  2. 按下RET的时候,显示Buffer: skr[Confirm]
  3. 再次按下RET创建skrbuffer

效果和(setq ido-create-new-buffer 'prompt)一样啊…


不熟悉 Ido,看源代码貌似还有设置选项 confirm-nonexistent-file-or-buffer,不然 ido-create-new-buffer 似乎怎么都没效果,简单试了下以下设置,然后 C-x b foo RET 就能创建新的 Buffer,无需确认。

(setq confirm-nonexistent-file-or-buffer nil)
(setq ido-create-new-buffer 'always)
2 个赞