From 3fd58ad37e12845fab905c00e87ae1d49755504a Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 1 Jun 2022 22:12:12 +0300 Subject: [PATCH] * 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). --- lisp/simple.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.39.2