XEmacs 21.4.17 "Jumbo Shrimp".
[chise/xemacs-chise.git.1] / src / fileio.c
index 578da72..f2b20c3 100644 (file)
@@ -364,6 +364,8 @@ If OPERATION equals `inhibit-file-name-operation', then we ignore
 any handlers that are members of `inhibit-file-name-handlers',
 but we still do run any other handlers.  This lets handlers
 use the standard functions without calling themselves recursively.
+
+Otherwise, OPERATION is the name of a funcall'able function.
 */
        (filename, operation))
 {
@@ -952,7 +954,7 @@ See also the function `substitute-in-file-name'.
              if (IS_DIRECTORY_SEP (nm[1]))
                {
                  if (strcmp ((char *) nm, (char *) XSTRING_DATA (name)) != 0)
-                   name = build_string ((CBufbyte *) nm);
+                   name = build_string ((Bufbyte *) nm);
                }
              /* drive must be set, so this is okay */
              else if (strcmp ((char *) nm - 2,
@@ -1333,7 +1335,23 @@ No component of the resulting pathname will be a symbolic link, as
     TO_EXTERNAL_FORMAT (LISP_STRING, expanded_name,
                        ALLOCA, (path, elen),
                        Qfile_name);
+
+#if defined(WIN32_FILENAMES) && defined(CYGWIN)
+    /* When using win32 filenames in cygwin we want file-truename to
+       detect that c:/windows == /windows for example. */
+    if ((IS_DIRECTORY_SEP (path[0]) 
+        && (elen == 1 || !IS_DIRECTORY_SEP (path[1])))
+       || (isalpha (path[0])
+           && (elen == 1 || !IS_DEVICE_SEP (path[1])))) {
+      int ltwff2 =
+       cygwin_posix_to_win32_path_list_buf_size (path);
+      p = (Bufbyte *) alloca (ltwff2);
+      cygwin_posix_to_win32_path_list (path, p);
+      path = p;
+    }
+#endif
     p = path;
+
     if (elen > MAXPATHLEN)
       goto toolong;
 
@@ -3181,6 +3199,11 @@ of the CODESYS argument under XEmacs/Mule. (When Mule support is not
 present, both functions are identical and ignore the CODESYS argument.)
 If support for Mule exists in this Emacs, the file is encoded according
 to the value of CODESYS.  If this is nil, no code conversion occurs.
+
+As a special kludge to support auto-saving, when START is nil START and
+END are set to the beginning and end, respectively, of the buffer,
+regardless of any restrictions.  Don't use this feature.  It is documented
+here because write-region handler writers need to be aware of it.
 */
        (start, end, filename, append, visit, lockname, codesys))
 {
@@ -3858,8 +3881,8 @@ auto_save_1 (Lisp_Object ignored)
   return
     /* !!#### need to deal with this 'escape-quoted everywhere */
     Fwrite_region_internal (Qnil, Qnil, a, Qnil, Qlambda, Qnil,
-#ifdef MULE
-                           Qescape_quoted
+#ifdef FILE_CODING
+                           current_buffer->buffer_file_coding_system
 #else
                            Qnil
 #endif
@@ -3905,7 +3928,7 @@ do_auto_save_unwind_2 (Lisp_Object old_auto_saving)
    and if so, tries to avoid touching lisp objects.
 
    The only time that Fdo_auto_save() is called while GC is in progress
-   is if we're going down, as a result of an abort() or a kill signal.
+   is if we're going down, as a result of an ABORT() or a kill signal.
    It's fairly important that we generate autosave files in that case!
  */