Hi Stefan! Stefan Monnier writes: >> emacs -Q on the tip of the emacs-29 branch (after commit 77f5d4d523a), run... >> >> (let ((default-directory "~/")) >> (read-directory-name "Clone into new or empty directory: " nil nil >> (lambda (dir) (or (not (file-exists-p dir)) >> (directory-empty-p dir))))) >> >> ...then type "/tmp/" (the whole minibuffer now reads "~//tmp") then RET. >> >> Expected: Completion does not exit, instead saying "[No match]". > > Ah, that good old problem about whether PRED should apply to the > quoted > or to the unquoted string 🙁 > > I think here the bug is in `read-directory-name` (and > `read-file-name`) > since their PRED arg is expected to apply to the (unquoted) file name > itself (i.e. the thing that would be returned by the function), rather > than to the quoted representation used in the minibuffer. > > They should wrap PRED so as to pass the arg through > `substitute-in-file-name` (or otherwise arrange to make sure PRED is > called with an unquoted file name). Thank you for the clear instructions! Does the attached patch do the right thing? If so, may it be applied to emacs-29? Joseph