2

I want to open a buffer called Echo.md and switch-buffer (C-x b) does not auto-complete it when I type echo because of the case. But find-file does auto-complete from lower-case to upper-case. The documentation for either function does not mention case.

How can Emacs ignore case when switching buffers?

3

Customize option read-buffer-completion-ignore-case to non-nil.

C-h v read-buffer-completion-ignore-case tells you:

read-buffer-completion-ignore-case is a variable defined in C source code.

Its value is nil

Documentation:

Non-nil means completion ignores case when reading a buffer name.

You can customize this variable.

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


Please consider filing a bug report (enhancement request), asking for the doc of switch-to-buffer and similar commands to mention the option: M-x report-emacs-bug.

I agree that it's not obvious. I looked at the source code for that command and followed the trail backward through a few functions to finally stumble on the option. (Yes, I could have guessed there was such an option and tried apropos to find it.)

  • 1
    The documentation for switch-to-buffer says: "See `read-buffer' for features related to input and completion of buffer names." – rpluim Oct 21 at 7:56
  • This works, and extra credits for the apropos method to solve problems with a guess for the name of the solution. Given rpluim's comment, I won't file a bug report. – miguelmorin Oct 23 at 20:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.