12

I used to be able to open a new buffer in Emacs quickly using the command C-x b <non existent buffer name>

Somehow I've broken this in my version of Emacs (23.1). When ever I try to do this now I get the message [No match] in the command buffer.

Does anyone know what I might have done to break this functionality, or is it possible that I imagined being able to do this?

APerson
  • 8,140
  • 8
  • 35
  • 49
chollida
  • 7,834
  • 11
  • 55
  • 85
  • 3
    I'd suggest mentioning the result of C-h k C-x b (i.e. what is bound to the C-x b shortcut). – Bahbar Mar 03 '10 at 22:20

4 Answers4

9

Set confirm-nonexistent-file-or-buffer to 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.
scottfrazer
  • 17,079
  • 4
  • 51
  • 49
  • I've added this to my .emacs but no dice. `;; Don't prompt for non existent name when creating temp buffers (setq confirm-nonexistent-file-or-buffer nil)` Can you spot anything that I've done that isn't correct? – chollida Mar 03 '10 at 20:54
  • It works as advertised here. Do you have ido enabled as others have suggested? – scottfrazer Mar 04 '10 at 04:07
7

If you have enabled ido-mode, you can still switch to the behavior you're familiar with. I do this frequently when I know I'll be creating a new named buffer.

C-x b C-b

Derek Slager
  • 13,619
  • 3
  • 34
  • 34
3

You press C-j instead of hitting enter twice, which will bypass the confirmation and immediately open the new buffer. This works with or without ido-mode. This will have the same effect has pressing enter with confirm-nonexistent-file-or-buffer set to nil.

pheaver
  • 1,813
  • 1
  • 14
  • 23
2

You probably enabled ido-mode. You need to press ENTER to confirm the creation of the buffer.

paprika
  • 2,424
  • 26
  • 46