emacs minibuffer-complete-and-exit bug fix

For the impatient:
Bug fix patch against Emacs 22 (CVS 2005-12-27)

The minibuffer code in GNU Emacs 22 has a minor bug in minibuffer-complete-and-exit. If completion-ignore-case is t, and the minibuffer contains a valid completion in the wrong case, minibuffer-complete-and-exit doesn’t fix its case. It should.

This spreads to other code that uses the minibuffer. For example, read-buffer has an optional argument require-match. If t, an existing buffer name must be entered. The list of existing buffer names is used as completions. If you enter an existing buffer name in the wrong case, it’s not completed to the right case.

The same thing happens with read-file-name and mustmatch, as well as a few other minibuffer functions.

Here’s a test case. Run emacs -q, then evaluate these forms:

(setq completion-ignore-case t)
(read-buffer "buffer name: " nil t)

Enter *SCRAtch* at the prompt. It returns *SCRAtch*, but it should return *scratch*.

This bug occurs in Emacs 22.0.50.7 (CVS 2005-12-27) and before. This patch fixes it. Whee!!!

Leave a Reply

Your email address will not be published.