From: Juri Linkov Date: Wed, 1 Jun 2022 19:12:12 +0000 (+0300) Subject: * lisp/simple.el (completion-setup-function): Use file-name-directory. X-Git-Tag: emacs-29.0.90~1910^2~295^2~3 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3fd58ad37e12845fab905c00e87ae1d49755504a;p=emacs.git * lisp/simple.el (completion-setup-function): Use file-name-directory. Replace file-name-as-directory with file-name-directory, because file-name-as-directory returns a nonexistent dir e.g. "/dir/prefix/" when completing "/dir/prefix". OTOH, file-name-directory returns "/dir/" in such cases (bug#55743). --- diff --git a/lisp/simple.el b/lisp/simple.el index 24c61b5bee0..a22df8025b3 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -9802,7 +9802,7 @@ Called from `temp-buffer-show-hook'." ;; - With fancy completion styles, the code below will not always ;; find the right base directory. (if minibuffer-completing-file-name - (file-name-as-directory + (file-name-directory (expand-file-name (buffer-substring (minibuffer-prompt-end) (point))))))) (with-current-buffer standard-output