diff options
| author | Richard M. Stallman | 2003-01-20 09:03:09 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2003-01-20 09:03:09 +0000 |
| commit | c2639ed073fca89eb89e485cc8a4e20c1cb87afa (patch) | |
| tree | 17101635eabe9be7bcc5194697e6598024d1e24d /lisp/simple.el | |
| parent | 2afd5e90eb946a0e70547e56a4c705d7d0d4cb7f (diff) | |
| download | emacs-c2639ed073fca89eb89e485cc8a4e20c1cb87afa.tar.gz emacs-c2639ed073fca89eb89e485cc8a4e20c1cb87afa.zip | |
(completion-setup-function): Set default-directory
in the minibuffer, so it'll be copied into the completion list buffer.
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) |