]> git.eshelyaron.com Git - emacs.git/commitdiff
(minibuffer-current-input): Special case for directory names
authorEshel Yaron <me@eshelyaron.com>
Mon, 17 Feb 2025 08:18:43 +0000 (09:18 +0100)
committerEshel Yaron <me@eshelyaron.com>
Mon, 17 Feb 2025 08:18:43 +0000 (09:18 +0100)
lisp/minibuffer.el

index 2ed4d3d03eb92c36fda51708f6a0574d7011507c..969171022edf76a3e3f611a8c8f794ebc95c5076 100644 (file)
@@ -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)