X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/4d0108a132788e0c3903eb4d5875321ed6e8eef1..f784272f7381dfd1fc1e6ba2c3c79cd1b7a9c5cd:/lisp/minibuffer.el diff --git a/lisp/minibuffer.el b/lisp/minibuffer.el index 538bd97425..bf18adf361 100644 --- a/lisp/minibuffer.el +++ b/lisp/minibuffer.el @@ -1241,16 +1241,12 @@ scroll the window of possible completions." (defun minibuffer-force-complete-and-exit () "Complete the minibuffer with first of the matches and exit." (interactive) - (if (and (eq (minibuffer-prompt-end) (point-max)) - minibuffer-default) - ;; Use the provided default if there's one (bug#17545). - (minibuffer-complete-and-exit) - (minibuffer-force-complete) - (completion--complete-and-exit - (minibuffer-prompt-end) (point-max) #'exit-minibuffer - ;; If the previous completion completed to an element which fails - ;; test-completion, then we shouldn't exit, but that should be rare. - (lambda () (minibuffer-message "Incomplete"))))) + (minibuffer-force-complete) + (completion--complete-and-exit + (minibuffer-prompt-end) (point-max) #'exit-minibuffer + ;; If the previous completion completed to an element which fails + ;; test-completion, then we shouldn't exit, but that should be rare. + (lambda () (minibuffer-message "Incomplete")))) (defun minibuffer-force-complete (&optional start end) "Complete the minibuffer to an exact match. @@ -2576,7 +2572,7 @@ and `read-file-name-function'." (defun read-file-name-default (prompt &optional dir default-filename mustmatch initial predicate) "Default method for reading file names. See `read-file-name' for the meaning of the arguments." - (unless dir (setq dir default-directory)) + (unless dir (setq dir (or default-directory "~/"))) (unless (file-name-absolute-p dir) (setq dir (expand-file-name dir))) (unless default-filename (setq default-filename (if initial (expand-file-name initial dir)