changeset 49336:d4e6f40cba36

(completion-setup-function): Set default-directory in the minibuffer, so it'll be copied into the completion list buffer.
author Richard M. Stallman <rms@gnu.org>
date Mon, 20 Jan 2003 09:02:28 +0000
parents 17b694d6fb86
children 1e7e9b379d7b
files lisp/simple.el
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/simple.el	Mon Jan 20 09:00:48 2003 +0000
+++ b/lisp/simple.el	Mon Jan 20 09:02:28 2003 +0000
@@ -3959,7 +3959,14 @@
 
 (defun completion-setup-function ()
   (save-excursion
-    (let ((mainbuf (current-buffer)))
+    (let ((mainbuf (current-buffer))
+	  (mbuf-contents (minibuffer-contents)))
+      ;; When reading a file name in the minibuffer,
+      ;; set default-directory in the minibuffer
+      ;; so it will get copied into the completion list buffer.
+      (if minibuffer-completing-file-name
+	  (with-current-buffer mainbuf
+	    (setq default-directory (file-name-directory mbuf-contents))))
       (set-buffer standard-output)
       (completion-list-mode)
       (make-local-variable 'completion-reference-buffer)