aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2020-01-16 10:18:15 -0500
committerStefan Monnier2020-01-16 10:18:39 -0500
commit52080b5778cbe535c331fa14539aecd88f2be0a0 (patch)
treefd146bb22dbbc14534b74b71699f69dabc1693da
parente4cec1fd106b9bb04583c043facc65531031db9c (diff)
downloademacs-52080b5778cbe535c331fa14539aecd88f2be0a0.tar.gz
emacs-52080b5778cbe535c331fa14539aecd88f2be0a0.zip
* lisp/minibuffer.el (read-file-name-default): Fix bug#39057
-rw-r--r--lisp/minibuffer.el9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el
index a8b2a984c52..4831bf72e9d 100644
--- a/lisp/minibuffer.el
+++ b/lisp/minibuffer.el
@@ -2737,8 +2737,13 @@ See `read-file-name' for the meaning of the arguments."
2737 (unless dir (setq dir (or default-directory "~/"))) 2737 (unless dir (setq dir (or default-directory "~/")))
2738 (unless (file-name-absolute-p dir) (setq dir (expand-file-name dir))) 2738 (unless (file-name-absolute-p dir) (setq dir (expand-file-name dir)))
2739 (unless default-filename 2739 (unless default-filename
2740 (setq default-filename (if initial (expand-file-name initial dir) 2740 (setq default-filename
2741 buffer-file-name))) 2741 (cond
2742 ((null initial) buffer-file-name)
2743 ;; Special-case "" because (expand-file-name "" "/tmp/") returns
2744 ;; "/tmp" rather than "/tmp/" (bug#39057).
2745 ((equal "" initial) dir)
2746 (t (expand-file-name initial dir)))))
2742 ;; If dir starts with user's homedir, change that to ~. 2747 ;; If dir starts with user's homedir, change that to ~.
2743 (setq dir (abbreviate-file-name dir)) 2748 (setq dir (abbreviate-file-name dir))
2744 ;; Likewise for default-filename. 2749 ;; Likewise for default-filename.