]> git.eshelyaron.com Git - emacs.git/commitdiff
* process.c (Fstart_process):
authorStefan Monnier <monnier@iro.umontreal.ca>
Wed, 6 Feb 2008 03:16:10 +0000 (03:16 +0000)
committerStefan Monnier <monnier@iro.umontreal.ca>
Wed, 6 Feb 2008 03:16:10 +0000 (03:16 +0000)
* callproc.c (Fcall_process): Handle the case where
Funhandled_file_name_directory returns nil.

doc/lispref/files.texi
src/ChangeLog
src/callproc.c
src/fileio.c
src/process.c

index a77f5387a285d413c44bd0a5159649dd7245fc58..640d4acdd15b4dff0908318f6b9cc74d5c75fc15 100644 (file)
@@ -2800,10 +2800,12 @@ making connections when they don't exist.
 @end defun
 
 @defun unhandled-file-name-directory filename
-This function returns the name of a directory that is not magic.  It
-uses the directory part of @var{filename} if that is not magic.  For a
-magic file name, it invokes the file name handler, which therefore
-decides what value to return.
+This function returns the name of a directory that is not magic.
+It uses the directory part of @var{filename} if that is not magic.
+For a magic file name, it invokes the file name handler, which
+therefore decides what value to return.  If @var{filename} is not
+accessible from a local process, then the file name handler should
+indicate it by returning nil.
 
 This is useful for running a subprocess; every subprocess must have a
 non-magic directory to serve as its current directory, and this function
index 88ed0a7f4c9f7141469020020d9437bba1205769..b06d4d455250609df49c329bb3c13b4ac5aa24a3 100644 (file)
@@ -1,5 +1,9 @@
 2008-02-06  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * process.c (Fstart_process):
+       * callproc.c (Fcall_process): Handle the case where
+       Funhandled_file_name_directory returns nil.
+
        * font.h (enum lgstring_indices, enum lglyph_indices): New enums.
        (LGSTRING_SLOT, LGSTRING_SET_SLOT): New macros.
        * font.c (check_gstring): Use them and AREF to access the vector before
index a3b7b7afa4a9db2c0f8257a51564f9c8097a1a1e..fdd1ee7988cc28e5aec30da653c936e6b87bf314 100644 (file)
@@ -376,9 +376,12 @@ usage: (call-process PROGRAM &optional INFILE BUFFER DISPLAY &rest ARGS)  */)
 
     GCPRO4 (infile, buffer, current_dir, error_file);
 
-    current_dir
-      = expand_and_dir_to_file (Funhandled_file_name_directory (current_dir),
-                               Qnil);
+    current_dir = Funhandled_file_name_directory (current_dir);
+    if (NILP (current_dir))
+      /* If the file name handler says that current_dir is unreachable, use
+        a sensible default. */
+      current_dir = build_string ("~/");
+    current_dir = expand_and_dir_to_file (current_dir, Qnil);
     if (NILP (Ffile_accessible_directory_p (current_dir)))
       report_file_error ("Setting current directory",
                         Fcons (current_buffer->directory, Qnil));
index 26020732160c6006b6d63684e509b407dbced1f0..76d076f75b25091b39a9f54573bd364358114fff 100644 (file)
@@ -532,6 +532,8 @@ A `directly usable' directory name is one that may be used without the
 intervention of any file handler.
 If FILENAME is a directly usable file itself, return
 \(file-name-directory FILENAME).
+If FILENAME refers to a file which is not accessible from a local process,
+then this should return nil.
 The `call-process' and `start-process' functions use this function to
 get a current directory to run processes in.  */)
      (filename)
index e5546488aae857250fb84b0c16a0d19cd801b589..73da0db18a8b118fe605f93854e5e5edbc50bd59 100644 (file)
@@ -1614,9 +1614,12 @@ usage: (start-process NAME BUFFER PROGRAM &rest PROGRAM-ARGS)  */)
 
     GCPRO2 (buffer, current_dir);
 
-    current_dir
-      = expand_and_dir_to_file (Funhandled_file_name_directory (current_dir),
-                               Qnil);
+    current_dir = Funhandled_file_name_directory (current_dir);
+    if (NILP (current_dir))
+      /* If the file name handler says that current_dir is unreachable, use
+        a sensible default. */
+      current_dir = build_string ("~/");
+    current_dir = expand_and_dir_to_file (current_dir, Qnil);
     if (NILP (Ffile_accessible_directory_p (current_dir)))
       report_file_error ("Setting current directory",
                         Fcons (current_buffer->directory, Qnil));