Eli Zaretskii writes: >> From: npostavs@users.sourceforge.net >> Cc: 16984@debbugs.gnu.org, Eli Zaretskii , jidanni@jidanni.org >> Date: Thu, 08 Dec 2016 09:39:35 -0500 >> >> (defun minibuffer-maybe-quote-filename (filename) >> "Protect FILENAME from `substitute-in-file-name', as needed. >> Useful to give the user default values that won't be substituted." >> (let ((local (file-remote-p filename 'localname))) >> (if (and (not (string-prefix-p "/:" local)) >> (file-name-absolute-p filename) >> (string-match-p "/~" local)) >> (tramp-quote-name filename) >> (minibuffer--double-dollars filename)))) > > Is the argument guaranteed to come from expand-file-name? If not, it > should also accept file names matching "\~" on MS platforms. I think it does, but I'm not entirely sure. Better safe than sorry?