summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2008-04-21 21:26:02 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2008-04-21 21:26:02 +0000
commit92ec67e363032b8a677246d7571ea6c297d59707 (patch)
treeb10e057fce56137018626960498b7c1d3a5f3456
parentc023a34f05a3cca887d0d3e21b27c7ad720ba795 (diff)
downloademacs-92ec67e363032b8a677246d7571ea6c297d59707.tar.gz
(Qdefault_directory): New variable.
(Fread_file_name): Use it to pass `dir' to the completion functions.
-rw-r--r--src/ChangeLog5
-rw-r--r--src/fileio.c8
2 files changed, 12 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index a402a195225..c9bff1a7e29 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2008-04-21 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * fileio.c (Qdefault_directory): New variable.
+ (Fread_file_name): Use it to pass `dir' to the completion functions.
+
2008-04-20 Chong Yidong <cyd@stupidchicken.com>
* xdisp.c (pos_visible_p): Check if iterator stops on a display string.
diff --git a/src/fileio.c b/src/fileio.c
index a63ac6dd748..738dd266780 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -6156,6 +6156,8 @@ before any other event (mouse or keypress) is handeled. */)
return Qnil;
}
+Lisp_Object Qdefault_directory;
+
DEFUN ("read-file-name", Fread_file_name, Sread_file_name, 1, 6, 0,
doc: /* Read file name, prompting with PROMPT and completing in directory DIR.
Value is not expanded---you must call `expand-file-name' yourself.
@@ -6279,6 +6281,8 @@ and `read-file-name-function'. */)
}
count = SPECPDL_INDEX ();
+ specbind (Qdefault_directory,
+ Ffile_name_as_directory (Fexpand_file_name (dir, Qnil)));
specbind (Qcompletion_ignore_case,
read_file_name_completion_ignore_case ? Qt : Qnil);
specbind (intern ("minibuffer-completing-file-name"), Qt);
@@ -6307,7 +6311,7 @@ and `read-file-name-function'. */)
else
#endif
val = Fcompleting_read (prompt, intern ("read-file-name-internal"),
- dir, mustmatch, insdef,
+ Qnil, mustmatch, insdef,
Qfile_name_history, default_filename, Qnil);
tem = Fsymbol_value (Qfile_name_history);
@@ -6484,6 +6488,8 @@ of file names regardless of the current language environment. */);
Qformat_decode = intern ("format-decode");
staticpro (&Qformat_decode);
+ Qdefault_directory = intern ("default-directory");
+ staticpro (&Qdefault_directory);
Qformat_annotate_function = intern ("format-annotate-function");
staticpro (&Qformat_annotate_function);
Qafter_insert_file_set_coding = intern ("after-insert-file-set-coding");