diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 6 | ||||
| -rw-r--r-- | src/dired.c | 15 |
2 files changed, 13 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index afc440673c0..86bc2e171ae 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2008-05-13 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * dired.c (Qdefault_directory): New var. | ||
| 4 | (file_name_completion): Use it instead of Fexpand_file_name. | ||
| 5 | (syms_of_dired): Initialize it. | ||
| 6 | |||
| 1 | 2008-05-12 Stefan Monnier <monnier@iro.umontreal.ca> | 7 | 2008-05-12 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 8 | ||
| 3 | * fileio.c (double_dollars): Remove dead code. | 9 | * fileio.c (double_dollars): Remove dead code. |
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. */) | |||
| 457 | } | 457 | } |
| 458 | 458 | ||
| 459 | static int file_name_completion_stat (); | 459 | static int file_name_completion_stat (); |
| 460 | Lisp_Object Qdefault_directory; | ||
| 460 | 461 | ||
| 461 | Lisp_Object | 462 | Lisp_Object |
| 462 | file_name_completion (file, dirname, all_flag, ver_flag, predicate) | 463 | file_name_completion (file, dirname, all_flag, ver_flag, predicate) |
| @@ -505,6 +506,7 @@ file_name_completion (file, dirname, all_flag, ver_flag, predicate) | |||
| 505 | encoded_file = encoded_dir = Qnil; | 506 | encoded_file = encoded_dir = Qnil; |
| 506 | GCPRO5 (file, dirname, bestmatch, encoded_file, encoded_dir); | 507 | GCPRO5 (file, dirname, bestmatch, encoded_file, encoded_dir); |
| 507 | dirname = Fexpand_file_name (dirname, Qnil); | 508 | dirname = Fexpand_file_name (dirname, Qnil); |
| 509 | specbind (Qdefault_directory, dirname); | ||
| 508 | 510 | ||
| 509 | /* Do completion on the encoded file name | 511 | /* Do completion on the encoded file name |
| 510 | because the other names in the directory are (we presume) | 512 | because the other names in the directory are (we presume) |
| @@ -667,22 +669,17 @@ file_name_completion (file, dirname, all_flag, ver_flag, predicate) | |||
| 667 | 669 | ||
| 668 | /* This is a possible completion */ | 670 | /* This is a possible completion */ |
| 669 | if (directoryp) | 671 | if (directoryp) |
| 670 | { | 672 | /* This completion is a directory; make it end with '/'. */ |
| 671 | /* This completion is a directory; make it end with '/' */ | 673 | name = Ffile_name_as_directory (name); |
| 672 | name = Ffile_name_as_directory (name); | ||
| 673 | } | ||
| 674 | 674 | ||
| 675 | /* Test the predicate, if any. */ | 675 | /* Test the predicate, if any. */ |
| 676 | |||
| 677 | if (!NILP (predicate)) | 676 | if (!NILP (predicate)) |
| 678 | { | 677 | { |
| 679 | Lisp_Object decoded; | ||
| 680 | Lisp_Object val; | 678 | Lisp_Object val; |
| 681 | struct gcpro gcpro1; | 679 | struct gcpro gcpro1; |
| 682 | 680 | ||
| 683 | GCPRO1 (name); | 681 | GCPRO1 (name); |
| 684 | decoded = Fexpand_file_name (name, dirname); | 682 | val = call1 (predicate, name); |
| 685 | val = call1 (predicate, decoded); | ||
| 686 | UNGCPRO; | 683 | UNGCPRO; |
| 687 | 684 | ||
| 688 | if (NILP (val)) | 685 | if (NILP (val)) |
| @@ -1113,6 +1110,7 @@ syms_of_dired () | |||
| 1113 | Qfile_name_all_completions = intern ("file-name-all-completions"); | 1110 | Qfile_name_all_completions = intern ("file-name-all-completions"); |
| 1114 | Qfile_attributes = intern ("file-attributes"); | 1111 | Qfile_attributes = intern ("file-attributes"); |
| 1115 | Qfile_attributes_lessp = intern ("file-attributes-lessp"); | 1112 | Qfile_attributes_lessp = intern ("file-attributes-lessp"); |
| 1113 | Qdefault_directory = intern ("default-directory"); | ||
| 1116 | 1114 | ||
| 1117 | staticpro (&Qdirectory_files); | 1115 | staticpro (&Qdirectory_files); |
| 1118 | staticpro (&Qdirectory_files_and_attributes); | 1116 | staticpro (&Qdirectory_files_and_attributes); |
| @@ -1120,6 +1118,7 @@ syms_of_dired () | |||
| 1120 | staticpro (&Qfile_name_all_completions); | 1118 | staticpro (&Qfile_name_all_completions); |
| 1121 | staticpro (&Qfile_attributes); | 1119 | staticpro (&Qfile_attributes); |
| 1122 | staticpro (&Qfile_attributes_lessp); | 1120 | staticpro (&Qfile_attributes_lessp); |
| 1121 | staticpro (&Qdefault_directory); | ||
| 1123 | 1122 | ||
| 1124 | defsubr (&Sdirectory_files); | 1123 | defsubr (&Sdirectory_files); |
| 1125 | defsubr (&Sdirectory_files_and_attributes); | 1124 | defsubr (&Sdirectory_files_and_attributes); |