diff options
Diffstat (limited to 'lisp/simple.el')
| -rw-r--r-- | lisp/simple.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lisp/simple.el b/lisp/simple.el index 39b2631d2b6..c0028a08233 100644 --- a/lisp/simple.el +++ b/lisp/simple.el | |||
| @@ -3959,7 +3959,14 @@ The completion list buffer is available as the value of `standard-output'.") | |||
| 3959 | 3959 | ||
| 3960 | (defun completion-setup-function () | 3960 | (defun completion-setup-function () |
| 3961 | (save-excursion | 3961 | (save-excursion |
| 3962 | (let ((mainbuf (current-buffer))) | 3962 | (let ((mainbuf (current-buffer)) |
| 3963 | (mbuf-contents (minibuffer-contents))) | ||
| 3964 | ;; When reading a file name in the minibuffer, | ||
| 3965 | ;; set default-directory in the minibuffer | ||
| 3966 | ;; so it will get copied into the completion list buffer. | ||
| 3967 | (if minibuffer-completing-file-name | ||
| 3968 | (with-current-buffer mainbuf | ||
| 3969 | (setq default-directory (file-name-directory mbuf-contents)))) | ||
| 3963 | (set-buffer standard-output) | 3970 | (set-buffer standard-output) |
| 3964 | (completion-list-mode) | 3971 | (completion-list-mode) |
| 3965 | (make-local-variable 'completion-reference-buffer) | 3972 | (make-local-variable 'completion-reference-buffer) |