#include "lisp.h"
#include "buffer.h"
#include "commands.h"
-
+#include "charset.h"
+#include "coding.h"
#include "regex.h"
/* Returns a search buffer, with a fastmap allocated and ready to go. */
#define min(a, b) ((a) < (b) ? (a) : (b))
-/* Encode the file name NAME using the specified coding system
- for file names, if any. */
-#define ENCODE_FILE(name) \
- (! NILP (Vfile_name_coding_system) \
- && XFASTINT (Vfile_name_coding_system) != 0 \
- ? Fencode_coding_string (name, Vfile_name_coding_system, Qt) \
- : name)
-
/* if system does not have symbolic links, it does not have lstat.
In that case, use ordinary stat instead. */
extern int completion_ignore_case;
extern Lisp_Object Vcompletion_regexp_list;
-extern Lisp_Object Vfile_name_coding_system;
+extern Lisp_Object Vfile_name_coding_system, Vdefault_file_name_coding_system;
Lisp_Object Vcompletion_ignored_extensions;
Lisp_Object Qcompletion_ignore_case;
}
else
name = make_string (dp->d_name, len);
- if (! NILP (Vfile_name_coding_system))
- name = Fdecode_coding_string (name, Vfile_name_coding_system,
- Qt);
+ name = DECODE_FILE (name);
list = Fcons (name, list);
}
}
name = make_string (dp->d_name, len);
if (all_flag)
{
- if (! NILP (Vfile_name_coding_system))
- name = Fdecode_coding_string (name,
- Vfile_name_coding_system, Qt);
+ name = DECODE_FILE (name);
bestmatch = Fcons (name, bestmatch);
}
else
if (all_flag || NILP (bestmatch))
{
- if (! NILP (Vfile_name_coding_system)
- && STRINGP (bestmatch))
- bestmatch = Fdecode_coding_string (bestmatch,
- Vfile_name_coding_system, Qt);
+ if (STRINGP (bestmatch))
+ bestmatch = DECODE_FILE (bestmatch);
return bestmatch;
}
if (matchcount == 1 && bestmatchsize == XSTRING (file)->size)
make_number (bestmatchsize));
/* Now that we got the right initial segment of BESTMATCH,
decode it from the coding system in use. */
- if (! NILP (Vfile_name_coding_system))
- bestmatch = Fdecode_coding_string (bestmatch,
- Vfile_name_coding_system, Qt);
+ bestmatch = DECODE_FILE (bestmatch);
return bestmatch;
quit: