aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKenichi Handa1998-03-03 07:18:46 +0000
committerKenichi Handa1998-03-03 07:18:46 +0000
commitbd33479f0a26736420e12d2b74b644f776765d40 (patch)
treed7930d7df6cd25ad1d844c74eca9db721ab66dcd /src
parent14dc6093870e0d04dca24a84d5c337b506981e08 (diff)
downloademacs-bd33479f0a26736420e12d2b74b644f776765d40.tar.gz
emacs-bd33479f0a26736420e12d2b74b644f776765d40.zip
Include charset.h and coding.h.
(ENCODE_FILE): This macro is moved to coding.h. (Vdefault_file_name_coding_system): Extern it. (Fdirectory_files): Use DECODE_FILE. (file_name_completion): Likewise.
Diffstat (limited to 'src')
-rw-r--r--src/dired.c31
1 files changed, 8 insertions, 23 deletions
diff --git a/src/dired.c b/src/dired.c
index 8cd4f5d86ee..076b42ee40c 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -78,7 +78,8 @@ extern struct direct *readdir ();
78#include "lisp.h" 78#include "lisp.h"
79#include "buffer.h" 79#include "buffer.h"
80#include "commands.h" 80#include "commands.h"
81 81#include "charset.h"
82#include "coding.h"
82#include "regex.h" 83#include "regex.h"
83 84
84/* Returns a search buffer, with a fastmap allocated and ready to go. */ 85/* Returns a search buffer, with a fastmap allocated and ready to go. */
@@ -86,14 +87,6 @@ extern struct re_pattern_buffer *compile_pattern ();
86 87
87#define min(a, b) ((a) < (b) ? (a) : (b)) 88#define min(a, b) ((a) < (b) ? (a) : (b))
88 89
89/* Encode the file name NAME using the specified coding system
90 for file names, if any. */
91#define ENCODE_FILE(name) \
92 (! NILP (Vfile_name_coding_system) \
93 && XFASTINT (Vfile_name_coding_system) != 0 \
94 ? Fencode_coding_string (name, Vfile_name_coding_system, Qt) \
95 : name)
96
97/* if system does not have symbolic links, it does not have lstat. 90/* if system does not have symbolic links, it does not have lstat.
98 In that case, use ordinary stat instead. */ 91 In that case, use ordinary stat instead. */
99 92
@@ -103,7 +96,7 @@ extern struct re_pattern_buffer *compile_pattern ();
103 96
104extern int completion_ignore_case; 97extern int completion_ignore_case;
105extern Lisp_Object Vcompletion_regexp_list; 98extern Lisp_Object Vcompletion_regexp_list;
106extern Lisp_Object Vfile_name_coding_system; 99extern Lisp_Object Vfile_name_coding_system, Vdefault_file_name_coding_system;
107 100
108Lisp_Object Vcompletion_ignored_extensions; 101Lisp_Object Vcompletion_ignored_extensions;
109Lisp_Object Qcompletion_ignore_case; 102Lisp_Object Qcompletion_ignore_case;
@@ -231,9 +224,7 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.\n\
231 } 224 }
232 else 225 else
233 name = make_string (dp->d_name, len); 226 name = make_string (dp->d_name, len);
234 if (! NILP (Vfile_name_coding_system)) 227 name = DECODE_FILE (name);
235 name = Fdecode_coding_string (name, Vfile_name_coding_system,
236 Qt);
237 list = Fcons (name, list); 228 list = Fcons (name, list);
238 } 229 }
239 } 230 }
@@ -462,9 +453,7 @@ file_name_completion (file, dirname, all_flag, ver_flag)
462 name = make_string (dp->d_name, len); 453 name = make_string (dp->d_name, len);
463 if (all_flag) 454 if (all_flag)
464 { 455 {
465 if (! NILP (Vfile_name_coding_system)) 456 name = DECODE_FILE (name);
466 name = Fdecode_coding_string (name,
467 Vfile_name_coding_system, Qt);
468 bestmatch = Fcons (name, bestmatch); 457 bestmatch = Fcons (name, bestmatch);
469 } 458 }
470 else 459 else
@@ -532,10 +521,8 @@ file_name_completion (file, dirname, all_flag, ver_flag)
532 521
533 if (all_flag || NILP (bestmatch)) 522 if (all_flag || NILP (bestmatch))
534 { 523 {
535 if (! NILP (Vfile_name_coding_system) 524 if (STRINGP (bestmatch))
536 && STRINGP (bestmatch)) 525 bestmatch = DECODE_FILE (bestmatch);
537 bestmatch = Fdecode_coding_string (bestmatch,
538 Vfile_name_coding_system, Qt);
539 return bestmatch; 526 return bestmatch;
540 } 527 }
541 if (matchcount == 1 && bestmatchsize == XSTRING (file)->size) 528 if (matchcount == 1 && bestmatchsize == XSTRING (file)->size)
@@ -544,9 +531,7 @@ file_name_completion (file, dirname, all_flag, ver_flag)
544 make_number (bestmatchsize)); 531 make_number (bestmatchsize));
545 /* Now that we got the right initial segment of BESTMATCH, 532 /* Now that we got the right initial segment of BESTMATCH,
546 decode it from the coding system in use. */ 533 decode it from the coding system in use. */
547 if (! NILP (Vfile_name_coding_system)) 534 bestmatch = DECODE_FILE (bestmatch);
548 bestmatch = Fdecode_coding_string (bestmatch,
549 Vfile_name_coding_system, Qt);
550 return bestmatch; 535 return bestmatch;
551 536
552 quit: 537 quit: