From 0dee962ecc293c5c832f2922b1d57ba2fac6f9b3 Mon Sep 17 00:00:00 2001 From: Eshel Yaron Date: Mon, 17 Feb 2025 09:18:43 +0100 Subject: [PATCH] (minibuffer-current-input): Special case for directory names --- lisp/minibuffer.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 2ed4d3d03eb..969171022ed 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -4228,6 +4228,11 @@ possible completions." minibuffer-completion-table minibuffer-completion-predicate)))) (setq prf (funcall adjust-fn prf))) + (and minibuffer-completing-file-name + (string-empty-p str) (string-suffix-p "/" prf) + (let ((tmp prf)) + (setq prf (file-name-parent-directory prf) + str (file-relative-name tmp prf)))) (cons str prf))) (defun minibuffer--get-action (symbol) -- 2.39.5