Improve env var handling in read-file-name
Fix various bugs, including bug#77718, by rewriting the way file
name completion handles environment variable expansion. Instead
of using completion-table-with-quoting to manipulate the string
being completed on, simply make the completion table itself
understand substitute-in-file-name.
Tests are updated: partial-completion now preserves unexpanded
environment variables. However, partial-completion no longer
works across environment variables containing delimiters; that's
an acceptable sacrifice.
* lisp/minibuffer.el (completion--sifn-boundaries): Add.
(completion--file-name-table): Rewrite to use
substitute-in-file-name explicitly. (bug#77718)
* test/lisp/minibuffer-tests.el (completion-table-test-quoting):
Update.
(cherry picked from commit
509cbe1c35b3dd005a53ac041f9c87ee53b8e115)