Quote filenames containing '~' in prompts
commita92a027d58cb4df5bb6c7e3c546a72183a192f45
authorNoam Postavsky <npostavs@gmail.com>
Fri, 28 Oct 2016 02:17:11 +0000 (27 22:17 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Mon, 12 Dec 2016 02:36:08 +0000 (11 21:36 -0500)
tree6de406718d319b0a8d514548852a48c7583bcd96
parent2783e0e3899cf92910e97dc8bfda3e47b3df1478
Quote filenames containing '~' in prompts

When in a directory named '~', the default value given by
`read-file-name' should be quoted by prepending '/:', in order to
prevent it from being interpreted as referring to the $HOME
directory (Bug#16984).

* lisp/minibuffer.el (minibuffer-maybe-quote-filename): New function.
(completion--sifn-requote, read-file-name-default): Use it instead of
`minibuffer--double-dollars'.
* test/lisp/files-tests.el (files-test-read-file-in-~): Test it.
lisp/minibuffer.el
test/lisp/files-tests.el