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?

Drew
  • 75,699
  • 9
  • 109
  • 225
miguelmorin
  • 1,751
  • 11
  • 33

1 Answers1

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.)

Drew
  • 75,699
  • 9
  • 109
  • 225
  • 1
    The documentation for `switch-to-buffer` says: "See `read-buffer' for features related to input and completion of buffer names." – rpluim Oct 21 '19 at 07: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 '19 at 20:58