(read_char): Save and restore echo_string when
[bpt/emacs.git] / src / dired.c
index 52a19f4..e833ceb 100644 (file)
@@ -1,5 +1,5 @@
 /* Lisp functions for making directory listings.
-   Copyright (C) 1985, 1986, 1993, 1994, 1999, 2000, 2001
+   Copyright (C) 1985, 1986, 1993, 1994, 1999, 2000, 2001, 2004
      Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -359,17 +359,8 @@ If NOSORT is non-nil, the list is not sorted--its order is unpredictable.
      call the corresponding file handler.  */
   handler = Ffind_file_name_handler (directory, Qdirectory_files);
   if (!NILP (handler))
-    {
-      Lisp_Object args[6];
-
-      args[0] = handler;
-      args[1] = Qdirectory_files;
-      args[2] = directory;
-      args[3] = full;
-      args[4] = match;
-      args[5] = nosort;
-      return Ffuncall (6, args);
-    }
+    return call5 (handler, Qdirectory_files, directory,
+                  full, match, nosort);
 
   return directory_files_internal (directory, full, match, nosort, 0, Qnil);
 }
@@ -395,18 +386,8 @@ ID-FORMAT specifies the preferred format of attributes uid and gid, see
      call the corresponding file handler.  */
   handler = Ffind_file_name_handler (directory, Qdirectory_files_and_attributes);
   if (!NILP (handler))
-    {
-      Lisp_Object args[7];
-
-      args[0] = handler;
-      args[1] = Qdirectory_files_and_attributes;
-      args[2] = directory;
-      args[3] = full;
-      args[4] = match;
-      args[5] = nosort;
-      args[6] = id_format;
-      return Ffuncall (7, args);
-    }
+    return call6 (handler, Qdirectory_files_and_attributes,
+                  directory, full, match, nosort, id_format);
 
   return directory_files_internal (directory, full, match, nosort, 1, id_format);
 }
@@ -933,7 +914,13 @@ Elements of the attribute list are:
      call the corresponding file handler.  */
   handler = Ffind_file_name_handler (filename, Qfile_attributes);
   if (!NILP (handler))
-    return call3 (handler, Qfile_attributes, filename, id_format);
+    { /* Only pass the extra arg if it is used to help backward compatibility
+        with old file handlers which do not implement the new arg.  --Stef  */
+      if (NILP (id_format))
+       return call2 (handler, Qfile_attributes, filename);
+      else
+       return call3 (handler, Qfile_attributes, filename, id_format);
+    }
 
   encoded = ENCODE_FILE (filename);
 
@@ -960,9 +947,9 @@ Elements of the attribute list are:
   else
     {
       pw = (struct passwd *) getpwuid (s.st_uid);
-      values[2] = (pw ? build_string (pw->pw_name) : s.st_uid);
+      values[2] = (pw ? build_string (pw->pw_name) : make_number (s.st_uid));
       gr = (struct group *) getgrgid (s.st_gid);
-      values[3] = (gr ? build_string (gr->gr_name) : s.st_gid);
+      values[3] = (gr ? build_string (gr->gr_name) : make_number (s.st_gid));
     }
   values[4] = make_time (s.st_atime);
   values[5] = make_time (s.st_mtime);