]> git.eshelyaron.com Git - emacs.git/commit
Fix 'completion-ignore-case' with 'completion--file-name-table'
authorSpencer Baugh <sbaugh@janestreet.com>
Mon, 19 May 2025 15:35:38 +0000 (11:35 -0400)
committerEshel Yaron <me@eshelyaron.com>
Wed, 21 May 2025 06:39:10 +0000 (08:39 +0200)
commit7d7d346665024d4b3356a358ec933d74ab3175ae
treeb68bbffb6a14a28a2aa4188ba0e19f4ee64af2f9
parent4f5412ca4cce3e5a225f5e73879941d753f85973
Fix 'completion-ignore-case' with 'completion--file-name-table'

509cbe1c35b3d "Improve env var handling in read-file-name"
caused 'try-completion' and 'all-completion' operations with
'completion--file-name-table' to no longer update the case of
text which was already present in the input string.  That is,
completions would be returned ignoring case, but the completions
would have letter-casing which matched the input string rather
than matching the actual file names.
This was caused by unnecessarily replacing text in the returned
file name completions with text from the input string ORIG,
which in turn was caused by the desire to preserve text from
ORIG even after 'substitute-in-file-name' changed it.  Fix this
by detecting when ORIG was not substantially changed by
'substitute-in-file-name'; in that case, the returned file name
completions also don't need substantial changes.
* lisp/minibuffer.el (completion--file-name-table): Use text
from the completions, not the input string.  (Bug#78323)
* test/lisp/minibuffer-tests.el (completion-table-test-quoting):
Test with 'completion-ignore-case' as well.

(cherry picked from commit cd364a2119b81f58e0d8f6579809dceb86a8f63c)
lisp/minibuffer.el
test/lisp/minibuffer-tests.el