7

When the minibuffer offers tab completion, how can I make that case-insensitive?

Preferably a global setting that makes any completion – a filename, a command, ido, etc. – obey that setting.

1 Answer 1

8

Sure. Set variable completion-ignore-case to t. Put this in your init file:

(setq completion-ignore-case  t)

C-h v completion-ignore-case:

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

Its value is nil

Documentation:

Non-nil means don't consider case significant in completion.

For file-name completion, read-file-name-completion-ignore-case controls the behavior, rather than this variable.

For buffer name completion, read-buffer-completion-ignore-case controls the behavior, rather than this variable.


Note that this is not a user option, and so is excluded from Customize. You can set it but you cannot set it using Customize. The most common use of it is to bind it (not assign it) in a given command. But nothing prevents you from assigning it, to affect the general behavior.

5
  • Can you update the answer to say which version of Emacs this appears in? Also, why this doesn't appear in the ‘completion’ group for Customize?
    – bignose
    Apr 28, 2017 at 5:14
  • It appears in every GNU Emacs version I'm aware of, going back at least as far as Emacs 20. Did you try C-h v completion-ignore-case? Does your Emacs version not find this variable? Are you using GNU Emacs or some other Emacs?
    – Drew
    Apr 28, 2017 at 14:44
  • It does not appear in M-x customize-group completion because it is not a user option. You can set it but you cannot set it using Customize. The most common use of it is to bind it (not assign it) in a given command. But nothing prevents you from assigning it, to affect the general behavior.
    – Drew
    Apr 28, 2017 at 14:46
  • @kdb: That sounds like a bug or misfeature in xref. If you think so then consider reporting it: M-x report-emacs-bug.
    – Drew
    Nov 4, 2021 at 17:37
  • @Drew It was a bug rather in my config, so I deleted the misleading comment. I had sabotaged myself by using (setq-local completion-ignore-case t), causing xref-find--definition's interactive form to set the buffer-local value, which then didn't propagate to completing-read.
    – kdb
    Nov 5, 2021 at 9:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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