diff options
author | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-05-13 04:39:32 +0000 |
---|---|---|
committer | Stefan Monnier <monnier@iro.umontreal.ca> | 2008-05-13 04:39:32 +0000 |
commit | 01bb4018866f2a6d3211a4b8e1ca38bc1f2c194b (patch) | |
tree | 1dc7e8c321b73e1d35ea79eb867603590d4e5a70 /src/dired.c | |
parent | 0d5c7113e3c6210399107795ea736b1e22f00c3d (diff) | |
download | emacs-01bb4018866f2a6d3211a4b8e1ca38bc1f2c194b.tar.gz |
(Qdefault_directory): New var.
(file_name_completion): Use it instead of Fexpand_file_name.
(syms_of_dired): Initialize it.
Diffstat (limited to 'src/dired.c')
-rw-r--r-- | src/dired.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/dired.c b/src/dired.c index f54418a0810..f25f24e8e47 100644 --- a/src/dired.c +++ b/src/dired.c @@ -457,6 +457,7 @@ These are all file names in directory DIRECTORY which begin with FILE. */) } static int file_name_completion_stat (); +Lisp_Object Qdefault_directory; Lisp_Object file_name_completion (file, dirname, all_flag, ver_flag, predicate) @@ -505,6 +506,7 @@ file_name_completion (file, dirname, all_flag, ver_flag, predicate) encoded_file = encoded_dir = Qnil; GCPRO5 (file, dirname, bestmatch, encoded_file, encoded_dir); dirname = Fexpand_file_name (dirname, Qnil); + specbind (Qdefault_directory, dirname); /* Do completion on the encoded file name because the other names in the directory are (we presume) @@ -667,22 +669,17 @@ file_name_completion (file, dirname, all_flag, ver_flag, predicate) /* This is a possible completion */ if (directoryp) - { - /* This completion is a directory; make it end with '/' */ - name = Ffile_name_as_directory (name); - } + /* This completion is a directory; make it end with '/'. */ + name = Ffile_name_as_directory (name); /* Test the predicate, if any. */ - if (!NILP (predicate)) { - Lisp_Object decoded; Lisp_Object val; struct gcpro gcpro1; GCPRO1 (name); - decoded = Fexpand_file_name (name, dirname); - val = call1 (predicate, decoded); + val = call1 (predicate, name); UNGCPRO; if (NILP (val)) @@ -1113,6 +1110,7 @@ syms_of_dired () Qfile_name_all_completions = intern ("file-name-all-completions"); Qfile_attributes = intern ("file-attributes"); Qfile_attributes_lessp = intern ("file-attributes-lessp"); + Qdefault_directory = intern ("default-directory"); staticpro (&Qdirectory_files); staticpro (&Qdirectory_files_and_attributes); @@ -1120,6 +1118,7 @@ syms_of_dired () staticpro (&Qfile_name_all_completions); staticpro (&Qfile_attributes); staticpro (&Qfile_attributes_lessp); + staticpro (&Qdefault_directory); defsubr (&Sdirectory_files); defsubr (&Sdirectory_files_and_attributes); |