Lisp_Object Qwrite_region;
Lisp_Object Qverify_visited_file_modtime;
Lisp_Object Qset_visited_file_modtime;
+Lisp_Object Qsubstitute_in_file_name;
DEFUN ("find-file-name-handler", Ffind_file_name_handler, Sfind_file_name_handler, 2, 2, 0,
"Return FILENAME's handler function for OPERATION, if it has one.\n\
int total = 0;
int substituted = 0;
unsigned char *xnm;
+ Lisp_Object handler;
CHECK_STRING (string, 0);
+ /* If the file name has special constructs in it,
+ call the corresponding file handler. */
+ handler = Ffind_file_name_handler (string, Qsubstitute_in_file_name);
+ if (!NILP (handler))
+ return call2 (handler, Qsubstitute_in_file_name, string);
+
nm = XSTRING (string)->data;
#ifdef MSDOS
dostounix_filename (nm = strcpy (alloca (strlen (nm) + 1), nm));
{
Lisp_Object name, specdir, realdir, val, orig_string;
int changed;
- struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
+ struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
realdir = dir;
name = string;
specdir = Qnil;
changed = 0;
/* No need to protect ACTION--we only compare it with t and nil. */
- GCPRO4 (string, realdir, name, specdir);
+ GCPRO5 (string, realdir, name, specdir, orig_string);
if (XSTRING (string)->size == 0)
{
Qwrite_region = intern ("write-region");
Qverify_visited_file_modtime = intern ("verify-visited-file-modtime");
Qset_visited_file_modtime = intern ("set-visited-file-modtime");
+ Qsubstitute_in_file_name = intern ("substitute-in-file-name");
staticpro (&Qexpand_file_name);
staticpro (&Qdirectory_file_name);
staticpro (&Qinsert_file_contents);
staticpro (&Qwrite_region);
staticpro (&Qverify_visited_file_modtime);
+ staticpro (&Qsubstitute_in_file_name);
Qfile_name_history = intern ("file-name-history");
Fset (Qfile_name_history, Qnil);