aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorErik Naggum1996-01-09 00:32:04 +0000
committerErik Naggum1996-01-09 00:32:04 +0000
commit3b7f6e604c7d89024a457073f062b00650fd8816 (patch)
tree4653b6154ba14ea4442d057e54f3a3a6a5b884f0 /src
parent79e8bfbf2736fd3d1121f6bf92d2f7e12b240494 (diff)
downloademacs-3b7f6e604c7d89024a457073f062b00650fd8816.tar.gz
emacs-3b7f6e604c7d89024a457073f062b00650fd8816.zip
(Ffile_name_directory, Ffile_name_nondirectory, Ffile_name_as_directory,
Fdirectory_file_name, Fexpand_file_name, Fsubstitute_in_file_name, Fcopy_file, Fmake_directory_internal, Fdelete_directory, Fdelete_file, Frename_file, Fadd_name_to_file, Fdefine_logical_name, Ffile_modes, Fset_file_modes, Fset_default_file_modes, Fdo_auto_save, Fread_file_name): Harmonize arguments with documentation.
Diffstat (limited to 'src')
-rw-r--r--src/fileio.c262
1 files changed, 131 insertions, 131 deletions
diff --git a/src/fileio.c b/src/fileio.c
index 6faf1563959..626a69d40f6 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -283,31 +283,31 @@ use the standard functions without calling themselves recursively.")
283 283
284DEFUN ("file-name-directory", Ffile_name_directory, Sfile_name_directory, 284DEFUN ("file-name-directory", Ffile_name_directory, Sfile_name_directory,
285 1, 1, 0, 285 1, 1, 0,
286 "Return the directory component in file name NAME.\n\ 286 "Return the directory component in file name FILENAME.\n\
287Return nil if NAME does not include a directory.\n\ 287Return nil if FILENAME does not include a directory.\n\
288Otherwise return a directory spec.\n\ 288Otherwise return a directory spec.\n\
289Given a Unix syntax file name, returns a string ending in slash;\n\ 289Given a Unix syntax file name, returns a string ending in slash;\n\
290on VMS, perhaps instead a string ending in `:', `]' or `>'.") 290on VMS, perhaps instead a string ending in `:', `]' or `>'.")
291 (file) 291 (filename)
292 Lisp_Object file; 292 Lisp_Object filename;
293{ 293{
294 register unsigned char *beg; 294 register unsigned char *beg;
295 register unsigned char *p; 295 register unsigned char *p;
296 Lisp_Object handler; 296 Lisp_Object handler;
297 297
298 CHECK_STRING (file, 0); 298 CHECK_STRING (filename, 0);
299 299
300 /* If the file name has special constructs in it, 300 /* If the file name has special constructs in it,
301 call the corresponding file handler. */ 301 call the corresponding file handler. */
302 handler = Ffind_file_name_handler (file, Qfile_name_directory); 302 handler = Ffind_file_name_handler (filename, Qfile_name_directory);
303 if (!NILP (handler)) 303 if (!NILP (handler))
304 return call2 (handler, Qfile_name_directory, file); 304 return call2 (handler, Qfile_name_directory, filename);
305 305
306#ifdef FILE_SYSTEM_CASE 306#ifdef FILE_SYSTEM_CASE
307 file = FILE_SYSTEM_CASE (file); 307 filename = FILE_SYSTEM_CASE (filename);
308#endif 308#endif
309 beg = XSTRING (file)->data; 309 beg = XSTRING (filename)->data;
310 p = beg + XSTRING (file)->size; 310 p = beg + XSTRING (filename)->size;
311 311
312 while (p != beg && !IS_ANY_SEP (p[-1]) 312 while (p != beg && !IS_ANY_SEP (p[-1])
313#ifdef VMS 313#ifdef VMS
@@ -351,26 +351,26 @@ on VMS, perhaps instead a string ending in `:', `]' or `>'.")
351 351
352DEFUN ("file-name-nondirectory", Ffile_name_nondirectory, Sfile_name_nondirectory, 352DEFUN ("file-name-nondirectory", Ffile_name_nondirectory, Sfile_name_nondirectory,
353 1, 1, 0, 353 1, 1, 0,
354 "Return file name NAME sans its directory.\n\ 354 "Return file name FILENAME sans its directory.\n\
355For example, in a Unix-syntax file name,\n\ 355For example, in a Unix-syntax file name,\n\
356this is everything after the last slash,\n\ 356this is everything after the last slash,\n\
357or the entire name if it contains no slash.") 357or the entire name if it contains no slash.")
358 (file) 358 (filename)
359 Lisp_Object file; 359 Lisp_Object filename;
360{ 360{
361 register unsigned char *beg, *p, *end; 361 register unsigned char *beg, *p, *end;
362 Lisp_Object handler; 362 Lisp_Object handler;
363 363
364 CHECK_STRING (file, 0); 364 CHECK_STRING (filename, 0);
365 365
366 /* If the file name has special constructs in it, 366 /* If the file name has special constructs in it,
367 call the corresponding file handler. */ 367 call the corresponding file handler. */
368 handler = Ffind_file_name_handler (file, Qfile_name_nondirectory); 368 handler = Ffind_file_name_handler (filename, Qfile_name_nondirectory);
369 if (!NILP (handler)) 369 if (!NILP (handler))
370 return call2 (handler, Qfile_name_nondirectory, file); 370 return call2 (handler, Qfile_name_nondirectory, filename);
371 371
372 beg = XSTRING (file)->data; 372 beg = XSTRING (filename)->data;
373 end = p = beg + XSTRING (file)->size; 373 end = p = beg + XSTRING (filename)->size;
374 374
375 while (p != beg && !IS_ANY_SEP (p[-1]) 375 while (p != beg && !IS_ANY_SEP (p[-1])
376#ifdef VMS 376#ifdef VMS
@@ -669,8 +669,8 @@ directory_file_name (src, dst)
669 669
670DEFUN ("directory-file-name", Fdirectory_file_name, Sdirectory_file_name, 670DEFUN ("directory-file-name", Fdirectory_file_name, Sdirectory_file_name,
671 1, 1, 0, 671 1, 1, 0,
672 "Returns the file name of the directory named DIR.\n\ 672 "Returns the file name of the directory named DIRECTORY.\n\
673This is the name of the file that holds the data for the directory DIR.\n\ 673This is the name of the file that holds the data for the directory DIRECTORY.\n\
674This operation exists because a directory is also a file, but its name as\n\ 674This operation exists because a directory is also a file, but its name as\n\
675a directory is different from its name as a file.\n\ 675a directory is different from its name as a file.\n\
676In Unix-syntax, this function just removes the final slash.\n\ 676In Unix-syntax, this function just removes the final slash.\n\
@@ -719,9 +719,9 @@ so there is no danger of generating a name being used by another process.")
719} 719}
720 720
721DEFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0, 721DEFUN ("expand-file-name", Fexpand_file_name, Sexpand_file_name, 1, 2, 0,
722 "Convert FILENAME to absolute, and canonicalize it.\n\ 722 "Convert filename NAME to absolute, and canonicalize it.\n\
723Second arg DEFAULT is directory to start with if FILENAME is relative\n\ 723Second arg DEFAULT-DIRECTORY is directory to start with if NAME is relative\n\
724 (does not start with slash); if DEFAULT is nil or missing,\n\ 724 (does not start with slash); if DEFAULT-DIRECTORY is nil or missing,\n\
725the current buffer's value of default-directory is used.\n\ 725the current buffer's value of default-directory is used.\n\
726Path components that are `.' are removed, and \n\ 726Path components that are `.' are removed, and \n\
727path components followed by `..' are removed, along with the `..' itself;\n\ 727path components followed by `..' are removed, along with the `..' itself;\n\
@@ -730,8 +730,8 @@ paths in the file system.\n\
730An initial `~/' expands to your home directory.\n\ 730An initial `~/' expands to your home directory.\n\
731An initial `~USER/' expands to USER's home directory.\n\ 731An initial `~USER/' expands to USER's home directory.\n\
732See also the function `substitute-in-file-name'.") 732See also the function `substitute-in-file-name'.")
733 (name, defalt) 733 (name, default_directory)
734 Lisp_Object name, defalt; 734 Lisp_Object name, default_directory;
735{ 735{
736 unsigned char *nm; 736 unsigned char *nm;
737 737
@@ -761,25 +761,25 @@ See also the function `substitute-in-file-name'.")
761 call the corresponding file handler. */ 761 call the corresponding file handler. */
762 handler = Ffind_file_name_handler (name, Qexpand_file_name); 762 handler = Ffind_file_name_handler (name, Qexpand_file_name);
763 if (!NILP (handler)) 763 if (!NILP (handler))
764 return call3 (handler, Qexpand_file_name, name, defalt); 764 return call3 (handler, Qexpand_file_name, name, default_directory);
765 765
766 /* Use the buffer's default-directory if DEFALT is omitted. */ 766 /* Use the buffer's default-directory if DEFAULT_DIRECTORY is omitted. */
767 if (NILP (defalt)) 767 if (NILP (default_directory))
768 defalt = current_buffer->directory; 768 default_directory = current_buffer->directory;
769 CHECK_STRING (defalt, 1); 769 CHECK_STRING (default_directory, 1);
770 770
771 if (!NILP (defalt)) 771 if (!NILP (default_directory))
772 { 772 {
773 handler = Ffind_file_name_handler (defalt, Qexpand_file_name); 773 handler = Ffind_file_name_handler (default_directory, Qexpand_file_name);
774 if (!NILP (handler)) 774 if (!NILP (handler))
775 return call3 (handler, Qexpand_file_name, name, defalt); 775 return call3 (handler, Qexpand_file_name, name, default_directory);
776 } 776 }
777 777
778 o = XSTRING (defalt)->data; 778 o = XSTRING (default_directory)->data;
779 779
780 /* Make sure DEFALT is properly expanded. 780 /* Make sure DEFAULT_DIRECTORY is properly expanded.
781 It would be better to do this down below where we actually use 781 It would be better to do this down below where we actually use
782 defalt. Unfortunately, calling Fexpand_file_name recursively 782 default_directory. Unfortunately, calling Fexpand_file_name recursively
783 could invoke GC, and the strings might be relocated. This would 783 could invoke GC, and the strings might be relocated. This would
784 be annoying because we have pointers into strings lying around 784 be annoying because we have pointers into strings lying around
785 that would need adjusting, and people would add new pointers to 785 that would need adjusting, and people would add new pointers to
@@ -787,16 +787,16 @@ See also the function `substitute-in-file-name'.")
787 Putting this call here avoids all that crud. 787 Putting this call here avoids all that crud.
788 788
789 The EQ test avoids infinite recursion. */ 789 The EQ test avoids infinite recursion. */
790 if (! NILP (defalt) && !EQ (defalt, name) 790 if (! NILP (default_directory) && !EQ (default_directory, name)
791 /* This saves time in a common case. */ 791 /* This saves time in a common case. */
792 && ! (XSTRING (defalt)->size >= 3 792 && ! (XSTRING (default_directory)->size >= 3
793 && IS_DIRECTORY_SEP (XSTRING (defalt)->data[0]) 793 && IS_DIRECTORY_SEP (XSTRING (default_directory)->data[0])
794 && IS_DEVICE_SEP (XSTRING (defalt)->data[1]))) 794 && IS_DEVICE_SEP (XSTRING (default_directory)->data[1])))
795 { 795 {
796 struct gcpro gcpro1; 796 struct gcpro gcpro1;
797 797
798 GCPRO1 (name); 798 GCPRO1 (name);
799 defalt = Fexpand_file_name (defalt, Qnil); 799 default_directory = Fexpand_file_name (default_directory, Qnil);
800 UNGCPRO; 800 UNGCPRO;
801 } 801 }
802 802
@@ -1048,7 +1048,7 @@ See also the function `substitute-in-file-name'.")
1048#endif /* DOS_NT */ 1048#endif /* DOS_NT */
1049 && !newdir) 1049 && !newdir)
1050 { 1050 {
1051 newdir = XSTRING (defalt)->data; 1051 newdir = XSTRING (default_directory)->data;
1052 } 1052 }
1053 1053
1054#ifdef DOS_NT 1054#ifdef DOS_NT
@@ -1556,8 +1556,8 @@ the entire variable name in braces.\n\
1556If `/~' appears, all of FILENAME through that `/' is discarded.\n\n\ 1556If `/~' appears, all of FILENAME through that `/' is discarded.\n\n\
1557On VMS, `$' substitution is not done; this function does little and only\n\ 1557On VMS, `$' substitution is not done; this function does little and only\n\
1558duplicates what `expand-file-name' does.") 1558duplicates what `expand-file-name' does.")
1559 (string) 1559 (filename)
1560 Lisp_Object string; 1560 Lisp_Object filename;
1561{ 1561{
1562 unsigned char *nm; 1562 unsigned char *nm;
1563 1563
@@ -1568,20 +1568,20 @@ duplicates what `expand-file-name' does.")
1568 unsigned char *xnm; 1568 unsigned char *xnm;
1569 Lisp_Object handler; 1569 Lisp_Object handler;
1570 1570
1571 CHECK_STRING (string, 0); 1571 CHECK_STRING (filename, 0);
1572 1572
1573 /* If the file name has special constructs in it, 1573 /* If the file name has special constructs in it,
1574 call the corresponding file handler. */ 1574 call the corresponding file handler. */
1575 handler = Ffind_file_name_handler (string, Qsubstitute_in_file_name); 1575 handler = Ffind_file_name_handler (filename, Qsubstitute_in_file_name);
1576 if (!NILP (handler)) 1576 if (!NILP (handler))
1577 return call2 (handler, Qsubstitute_in_file_name, string); 1577 return call2 (handler, Qsubstitute_in_file_name, filename);
1578 1578
1579 nm = XSTRING (string)->data; 1579 nm = XSTRING (filename)->data;
1580#ifdef MSDOS 1580#ifdef MSDOS
1581 dostounix_filename (nm = strcpy (alloca (strlen (nm) + 1), nm)); 1581 dostounix_filename (nm = strcpy (alloca (strlen (nm) + 1), nm));
1582 substituted = !strcmp (nm, XSTRING (string)->data); 1582 substituted = !strcmp (nm, XSTRING (filename)->data);
1583#endif 1583#endif
1584 endp = nm + XSTRING (string)->size; 1584 endp = nm + XSTRING (filename)->size;
1585 1585
1586 /* If /~ or // appears, discard everything through first slash. */ 1586 /* If /~ or // appears, discard everything through first slash. */
1587 1587
@@ -1671,11 +1671,11 @@ duplicates what `expand-file-name' does.")
1671 } 1671 }
1672 1672
1673 if (!substituted) 1673 if (!substituted)
1674 return string; 1674 return filename;
1675 1675
1676 /* If substitution required, recopy the string and do it */ 1676 /* If substitution required, recopy the string and do it */
1677 /* Make space in stack frame for the new copy */ 1677 /* Make space in stack frame for the new copy */
1678 xnm = (unsigned char *) alloca (XSTRING (string)->size + total + 1); 1678 xnm = (unsigned char *) alloca (XSTRING (filename)->size + total + 1);
1679 x = xnm; 1679 x = xnm;
1680 1680
1681 /* Copy the rest of the name through, replacing $ constructs with values */ 1681 /* Copy the rest of the name through, replacing $ constructs with values */
@@ -1844,8 +1844,8 @@ This is what happens in interactive use with M-x.\n\
1844Fourth arg KEEP-TIME non-nil means give the new file the same\n\ 1844Fourth arg KEEP-TIME non-nil means give the new file the same\n\
1845last-modified time as the old one. (This works on only some systems.)\n\ 1845last-modified time as the old one. (This works on only some systems.)\n\
1846A prefix arg makes KEEP-TIME non-nil.") 1846A prefix arg makes KEEP-TIME non-nil.")
1847 (filename, newname, ok_if_already_exists, keep_date) 1847 (file, newname, ok_if_already_exists, keep_date)
1848 Lisp_Object filename, newname, ok_if_already_exists, keep_date; 1848 Lisp_Object file, newname, ok_if_already_exists, keep_date;
1849{ 1849{
1850 int ifd, ofd, n; 1850 int ifd, ofd, n;
1851 char buf[16 * 1024]; 1851 char buf[16 * 1024];
@@ -1855,20 +1855,20 @@ A prefix arg makes KEEP-TIME non-nil.")
1855 int count = specpdl_ptr - specpdl; 1855 int count = specpdl_ptr - specpdl;
1856 int input_file_statable_p; 1856 int input_file_statable_p;
1857 1857
1858 GCPRO2 (filename, newname); 1858 GCPRO2 (file, newname);
1859 CHECK_STRING (filename, 0); 1859 CHECK_STRING (file, 0);
1860 CHECK_STRING (newname, 1); 1860 CHECK_STRING (newname, 1);
1861 filename = Fexpand_file_name (filename, Qnil); 1861 file = Fexpand_file_name (file, Qnil);
1862 newname = Fexpand_file_name (newname, Qnil); 1862 newname = Fexpand_file_name (newname, Qnil);
1863 1863
1864 /* If the input file name has special constructs in it, 1864 /* If the input file name has special constructs in it,
1865 call the corresponding file handler. */ 1865 call the corresponding file handler. */
1866 handler = Ffind_file_name_handler (filename, Qcopy_file); 1866 handler = Ffind_file_name_handler (file, Qcopy_file);
1867 /* Likewise for output file name. */ 1867 /* Likewise for output file name. */
1868 if (NILP (handler)) 1868 if (NILP (handler))
1869 handler = Ffind_file_name_handler (newname, Qcopy_file); 1869 handler = Ffind_file_name_handler (newname, Qcopy_file);
1870 if (!NILP (handler)) 1870 if (!NILP (handler))
1871 RETURN_UNGCPRO (call5 (handler, Qcopy_file, filename, newname, 1871 RETURN_UNGCPRO (call5 (handler, Qcopy_file, file, newname,
1872 ok_if_already_exists, keep_date)); 1872 ok_if_already_exists, keep_date));
1873 1873
1874 if (NILP (ok_if_already_exists) 1874 if (NILP (ok_if_already_exists)
@@ -1878,9 +1878,9 @@ A prefix arg makes KEEP-TIME non-nil.")
1878 else if (stat (XSTRING (newname)->data, &out_st) < 0) 1878 else if (stat (XSTRING (newname)->data, &out_st) < 0)
1879 out_st.st_mode = 0; 1879 out_st.st_mode = 0;
1880 1880
1881 ifd = open (XSTRING (filename)->data, O_RDONLY); 1881 ifd = open (XSTRING (file)->data, O_RDONLY);
1882 if (ifd < 0) 1882 if (ifd < 0)
1883 report_file_error ("Opening input file", Fcons (filename, Qnil)); 1883 report_file_error ("Opening input file", Fcons (file, Qnil));
1884 1884
1885 record_unwind_protect (close_file_unwind, make_number (ifd)); 1885 record_unwind_protect (close_file_unwind, make_number (ifd));
1886 1886
@@ -1894,7 +1894,7 @@ A prefix arg makes KEEP-TIME non-nil.")
1894 { 1894 {
1895 errno = 0; 1895 errno = 0;
1896 report_file_error ("Input and output files are the same", 1896 report_file_error ("Input and output files are the same",
1897 Fcons (filename, Fcons (newname, Qnil))); 1897 Fcons (file, Fcons (newname, Qnil)));
1898 } 1898 }
1899#endif 1899#endif
1900 1900
@@ -1907,7 +1907,7 @@ A prefix arg makes KEEP-TIME non-nil.")
1907 /* Get a better looking error message. */ 1907 /* Get a better looking error message. */
1908 errno = EISDIR; 1908 errno = EISDIR;
1909#endif /* EISDIR */ 1909#endif /* EISDIR */
1910 report_file_error ("Non-regular file", Fcons (filename, Qnil)); 1910 report_file_error ("Non-regular file", Fcons (file, Qnil));
1911 } 1911 }
1912 } 1912 }
1913#endif /* S_ISREG && S_ISLNK */ 1913#endif /* S_ISREG && S_ISLNK */
@@ -1974,56 +1974,56 @@ A prefix arg makes KEEP-TIME non-nil.")
1974 1974
1975DEFUN ("make-directory-internal", Fmake_directory_internal, 1975DEFUN ("make-directory-internal", Fmake_directory_internal,
1976 Smake_directory_internal, 1, 1, 0, 1976 Smake_directory_internal, 1, 1, 0,
1977 "Create a directory. One argument, a file name string.") 1977 "Create a new directory named DIRECTORY.")
1978 (dirname) 1978 (directory)
1979 Lisp_Object dirname; 1979 Lisp_Object directory;
1980{ 1980{
1981 unsigned char *dir; 1981 unsigned char *dir;
1982 Lisp_Object handler; 1982 Lisp_Object handler;
1983 1983
1984 CHECK_STRING (dirname, 0); 1984 CHECK_STRING (directory, 0);
1985 dirname = Fexpand_file_name (dirname, Qnil); 1985 directory = Fexpand_file_name (directory, Qnil);
1986 1986
1987 handler = Ffind_file_name_handler (dirname, Qmake_directory_internal); 1987 handler = Ffind_file_name_handler (directory, Qmake_directory_internal);
1988 if (!NILP (handler)) 1988 if (!NILP (handler))
1989 return call2 (handler, Qmake_directory_internal, dirname); 1989 return call2 (handler, Qmake_directory_internal, directory);
1990 1990
1991 dir = XSTRING (dirname)->data; 1991 dir = XSTRING (directory)->data;
1992 1992
1993#ifdef WINDOWSNT 1993#ifdef WINDOWSNT
1994 if (mkdir (dir) != 0) 1994 if (mkdir (dir) != 0)
1995#else 1995#else
1996 if (mkdir (dir, 0777) != 0) 1996 if (mkdir (dir, 0777) != 0)
1997#endif 1997#endif
1998 report_file_error ("Creating directory", Flist (1, &dirname)); 1998 report_file_error ("Creating directory", Flist (1, &directory));
1999 1999
2000 return Qnil; 2000 return Qnil;
2001} 2001}
2002 2002
2003DEFUN ("delete-directory", Fdelete_directory, Sdelete_directory, 1, 1, "FDelete directory: ", 2003DEFUN ("delete-directory", Fdelete_directory, Sdelete_directory, 1, 1, "FDelete directory: ",
2004 "Delete a directory. One argument, a file name or directory name string.") 2004 "Delete the directory named DIRECTORY.")
2005 (dirname) 2005 (directory)
2006 Lisp_Object dirname; 2006 Lisp_Object directory;
2007{ 2007{
2008 unsigned char *dir; 2008 unsigned char *dir;
2009 Lisp_Object handler; 2009 Lisp_Object handler;
2010 2010
2011 CHECK_STRING (dirname, 0); 2011 CHECK_STRING (directory, 0);
2012 dirname = Fdirectory_file_name (Fexpand_file_name (dirname, Qnil)); 2012 directory = Fdirectory_file_name (Fexpand_file_name (directory, Qnil));
2013 dir = XSTRING (dirname)->data; 2013 dir = XSTRING (directory)->data;
2014 2014
2015 handler = Ffind_file_name_handler (dirname, Qdelete_directory); 2015 handler = Ffind_file_name_handler (directory, Qdelete_directory);
2016 if (!NILP (handler)) 2016 if (!NILP (handler))
2017 return call2 (handler, Qdelete_directory, dirname); 2017 return call2 (handler, Qdelete_directory, directory);
2018 2018
2019 if (rmdir (dir) != 0) 2019 if (rmdir (dir) != 0)
2020 report_file_error ("Removing directory", Flist (1, &dirname)); 2020 report_file_error ("Removing directory", Flist (1, &directory));
2021 2021
2022 return Qnil; 2022 return Qnil;
2023} 2023}
2024 2024
2025DEFUN ("delete-file", Fdelete_file, Sdelete_file, 1, 1, "fDelete file: ", 2025DEFUN ("delete-file", Fdelete_file, Sdelete_file, 1, 1, "fDelete file: ",
2026 "Delete specified file. One argument, a file name string.\n\ 2026 "Delete file named FILENAME.\n\
2027If file has multiple names, it continues to exist with the other names.") 2027If file has multiple names, it continues to exist with the other names.")
2028 (filename) 2028 (filename)
2029 Lisp_Object filename; 2029 Lisp_Object filename;
@@ -2066,8 +2066,8 @@ Signals a `file-already-exists' error if a file NEWNAME already exists\n\
2066unless optional third argument OK-IF-ALREADY-EXISTS is non-nil.\n\ 2066unless optional third argument OK-IF-ALREADY-EXISTS is non-nil.\n\
2067A number as third arg means request confirmation if NEWNAME already exists.\n\ 2067A number as third arg means request confirmation if NEWNAME already exists.\n\
2068This is what happens in interactive use with M-x.") 2068This is what happens in interactive use with M-x.")
2069 (filename, newname, ok_if_already_exists) 2069 (file, newname, ok_if_already_exists)
2070 Lisp_Object filename, newname, ok_if_already_exists; 2070 Lisp_Object file, newname, ok_if_already_exists;
2071{ 2071{
2072#ifdef NO_ARG_ARRAY 2072#ifdef NO_ARG_ARRAY
2073 Lisp_Object args[2]; 2073 Lisp_Object args[2];
@@ -2075,33 +2075,33 @@ This is what happens in interactive use with M-x.")
2075 Lisp_Object handler; 2075 Lisp_Object handler;
2076 struct gcpro gcpro1, gcpro2; 2076 struct gcpro gcpro1, gcpro2;
2077 2077
2078 GCPRO2 (filename, newname); 2078 GCPRO2 (file, newname);
2079 CHECK_STRING (filename, 0); 2079 CHECK_STRING (file, 0);
2080 CHECK_STRING (newname, 1); 2080 CHECK_STRING (newname, 1);
2081 filename = Fexpand_file_name (filename, Qnil); 2081 file = Fexpand_file_name (file, Qnil);
2082 newname = Fexpand_file_name (newname, Qnil); 2082 newname = Fexpand_file_name (newname, Qnil);
2083 2083
2084 /* If the file name has special constructs in it, 2084 /* If the file name has special constructs in it,
2085 call the corresponding file handler. */ 2085 call the corresponding file handler. */
2086 handler = Ffind_file_name_handler (filename, Qrename_file); 2086 handler = Ffind_file_name_handler (file, Qrename_file);
2087 if (NILP (handler)) 2087 if (NILP (handler))
2088 handler = Ffind_file_name_handler (newname, Qrename_file); 2088 handler = Ffind_file_name_handler (newname, Qrename_file);
2089 if (!NILP (handler)) 2089 if (!NILP (handler))
2090 RETURN_UNGCPRO (call4 (handler, Qrename_file, 2090 RETURN_UNGCPRO (call4 (handler, Qrename_file,
2091 filename, newname, ok_if_already_exists)); 2091 file, newname, ok_if_already_exists));
2092 2092
2093 if (NILP (ok_if_already_exists) 2093 if (NILP (ok_if_already_exists)
2094 || INTEGERP (ok_if_already_exists)) 2094 || INTEGERP (ok_if_already_exists))
2095 barf_or_query_if_file_exists (newname, "rename to it", 2095 barf_or_query_if_file_exists (newname, "rename to it",
2096 INTEGERP (ok_if_already_exists), 0); 2096 INTEGERP (ok_if_already_exists), 0);
2097#ifndef BSD4_1 2097#ifndef BSD4_1
2098 if (0 > rename (XSTRING (filename)->data, XSTRING (newname)->data)) 2098 if (0 > rename (XSTRING (file)->data, XSTRING (newname)->data))
2099#else 2099#else
2100#ifdef WINDOWSNT 2100#ifdef WINDOWSNT
2101 if (!MoveFile (XSTRING (filename)->data, XSTRING (newname)->data)) 2101 if (!MoveFile (XSTRING (file)->data, XSTRING (newname)->data))
2102#else /* not WINDOWSNT */ 2102#else /* not WINDOWSNT */
2103 if (0 > link (XSTRING (filename)->data, XSTRING (newname)->data) 2103 if (0 > link (XSTRING (file)->data, XSTRING (newname)->data)
2104 || 0 > unlink (XSTRING (filename)->data)) 2104 || 0 > unlink (XSTRING (file)->data))
2105#endif /* not WINDOWSNT */ 2105#endif /* not WINDOWSNT */
2106#endif 2106#endif
2107 { 2107 {
@@ -2113,21 +2113,21 @@ This is what happens in interactive use with M-x.")
2113 if (errno == EXDEV) 2113 if (errno == EXDEV)
2114#endif /* not WINDOWSNT */ 2114#endif /* not WINDOWSNT */
2115 { 2115 {
2116 Fcopy_file (filename, newname, 2116 Fcopy_file (file, newname,
2117 /* We have already prompted if it was an integer, 2117 /* We have already prompted if it was an integer,
2118 so don't have copy-file prompt again. */ 2118 so don't have copy-file prompt again. */
2119 NILP (ok_if_already_exists) ? Qnil : Qt, Qt); 2119 NILP (ok_if_already_exists) ? Qnil : Qt, Qt);
2120 Fdelete_file (filename); 2120 Fdelete_file (file);
2121 } 2121 }
2122 else 2122 else
2123#ifdef NO_ARG_ARRAY 2123#ifdef NO_ARG_ARRAY
2124 { 2124 {
2125 args[0] = filename; 2125 args[0] = file;
2126 args[1] = newname; 2126 args[1] = newname;
2127 report_file_error ("Renaming", Flist (2, args)); 2127 report_file_error ("Renaming", Flist (2, args));
2128 } 2128 }
2129#else 2129#else
2130 report_file_error ("Renaming", Flist (2, &filename)); 2130 report_file_error ("Renaming", Flist (2, &file));
2131#endif 2131#endif
2132 } 2132 }
2133 UNGCPRO; 2133 UNGCPRO;
@@ -2141,8 +2141,8 @@ Signals a `file-already-exists' error if a file NEWNAME already exists\n\
2141unless optional third argument OK-IF-ALREADY-EXISTS is non-nil.\n\ 2141unless optional third argument OK-IF-ALREADY-EXISTS is non-nil.\n\
2142A number as third arg means request confirmation if NEWNAME already exists.\n\ 2142A number as third arg means request confirmation if NEWNAME already exists.\n\
2143This is what happens in interactive use with M-x.") 2143This is what happens in interactive use with M-x.")
2144 (filename, newname, ok_if_already_exists) 2144 (file, newname, ok_if_already_exists)
2145 Lisp_Object filename, newname, ok_if_already_exists; 2145 Lisp_Object file, newname, ok_if_already_exists;
2146{ 2146{
2147#ifdef NO_ARG_ARRAY 2147#ifdef NO_ARG_ARRAY
2148 Lisp_Object args[2]; 2148 Lisp_Object args[2];
@@ -2150,24 +2150,24 @@ This is what happens in interactive use with M-x.")
2150 Lisp_Object handler; 2150 Lisp_Object handler;
2151 struct gcpro gcpro1, gcpro2; 2151 struct gcpro gcpro1, gcpro2;
2152 2152
2153 GCPRO2 (filename, newname); 2153 GCPRO2 (file, newname);
2154 CHECK_STRING (filename, 0); 2154 CHECK_STRING (file, 0);
2155 CHECK_STRING (newname, 1); 2155 CHECK_STRING (newname, 1);
2156 filename = Fexpand_file_name (filename, Qnil); 2156 file = Fexpand_file_name (file, Qnil);
2157 newname = Fexpand_file_name (newname, Qnil); 2157 newname = Fexpand_file_name (newname, Qnil);
2158 2158
2159 /* If the file name has special constructs in it, 2159 /* If the file name has special constructs in it,
2160 call the corresponding file handler. */ 2160 call the corresponding file handler. */
2161 handler = Ffind_file_name_handler (filename, Qadd_name_to_file); 2161 handler = Ffind_file_name_handler (file, Qadd_name_to_file);
2162 if (!NILP (handler)) 2162 if (!NILP (handler))
2163 RETURN_UNGCPRO (call4 (handler, Qadd_name_to_file, filename, 2163 RETURN_UNGCPRO (call4 (handler, Qadd_name_to_file, file,
2164 newname, ok_if_already_exists)); 2164 newname, ok_if_already_exists));
2165 2165
2166 /* If the new name has special constructs in it, 2166 /* If the new name has special constructs in it,
2167 call the corresponding file handler. */ 2167 call the corresponding file handler. */
2168 handler = Ffind_file_name_handler (newname, Qadd_name_to_file); 2168 handler = Ffind_file_name_handler (newname, Qadd_name_to_file);
2169 if (!NILP (handler)) 2169 if (!NILP (handler))
2170 RETURN_UNGCPRO (call4 (handler, Qadd_name_to_file, filename, 2170 RETURN_UNGCPRO (call4 (handler, Qadd_name_to_file, file,
2171 newname, ok_if_already_exists)); 2171 newname, ok_if_already_exists));
2172 2172
2173 if (NILP (ok_if_already_exists) 2173 if (NILP (ok_if_already_exists)
@@ -2176,18 +2176,18 @@ This is what happens in interactive use with M-x.")
2176 INTEGERP (ok_if_already_exists), 0); 2176 INTEGERP (ok_if_already_exists), 0);
2177#ifdef WINDOWSNT 2177#ifdef WINDOWSNT
2178 /* Windows does not support this operation. */ 2178 /* Windows does not support this operation. */
2179 report_file_error ("Adding new name", Flist (2, &filename)); 2179 report_file_error ("Adding new name", Flist (2, &file));
2180#else /* not WINDOWSNT */ 2180#else /* not WINDOWSNT */
2181 2181
2182 unlink (XSTRING (newname)->data); 2182 unlink (XSTRING (newname)->data);
2183 if (0 > link (XSTRING (filename)->data, XSTRING (newname)->data)) 2183 if (0 > link (XSTRING (file)->data, XSTRING (newname)->data))
2184 { 2184 {
2185#ifdef NO_ARG_ARRAY 2185#ifdef NO_ARG_ARRAY
2186 args[0] = filename; 2186 args[0] = file;
2187 args[1] = newname; 2187 args[1] = newname;
2188 report_file_error ("Adding new name", Flist (2, args)); 2188 report_file_error ("Adding new name", Flist (2, args));
2189#else 2189#else
2190 report_file_error ("Adding new name", Flist (2, &filename)); 2190 report_file_error ("Adding new name", Flist (2, &file));
2191#endif 2191#endif
2192 } 2192 }
2193#endif /* not WINDOWSNT */ 2193#endif /* not WINDOWSNT */
@@ -2273,21 +2273,21 @@ DEFUN ("define-logical-name", Fdefine_logical_name, Sdefine_logical_name,
2273 2, 2, "sDefine logical name: \nsDefine logical name %s as: ", 2273 2, 2, "sDefine logical name: \nsDefine logical name %s as: ",
2274 "Define the job-wide logical name NAME to have the value STRING.\n\ 2274 "Define the job-wide logical name NAME to have the value STRING.\n\
2275If STRING is nil or a null string, the logical name NAME is deleted.") 2275If STRING is nil or a null string, the logical name NAME is deleted.")
2276 (varname, string) 2276 (name, string)
2277 Lisp_Object varname; 2277 Lisp_Object name;
2278 Lisp_Object string; 2278 Lisp_Object string;
2279{ 2279{
2280 CHECK_STRING (varname, 0); 2280 CHECK_STRING (name, 0);
2281 if (NILP (string)) 2281 if (NILP (string))
2282 delete_logical_name (XSTRING (varname)->data); 2282 delete_logical_name (XSTRING (name)->data);
2283 else 2283 else
2284 { 2284 {
2285 CHECK_STRING (string, 1); 2285 CHECK_STRING (string, 1);
2286 2286
2287 if (XSTRING (string)->size == 0) 2287 if (XSTRING (string)->size == 0)
2288 delete_logical_name (XSTRING (varname)->data); 2288 delete_logical_name (XSTRING (name)->data);
2289 else 2289 else
2290 define_logical_name (XSTRING (varname)->data, XSTRING (string)->data); 2290 define_logical_name (XSTRING (name)->data, XSTRING (string)->data);
2291 } 2291 }
2292 2292
2293 return string; 2293 return string;
@@ -2639,7 +2639,7 @@ This is the sort of file that holds an ordinary stream of data bytes.")
2639} 2639}
2640 2640
2641DEFUN ("file-modes", Ffile_modes, Sfile_modes, 1, 1, 0, 2641DEFUN ("file-modes", Ffile_modes, Sfile_modes, 1, 1, 0,
2642 "Return mode bits of FILE, as an integer.") 2642 "Return mode bits of file named FILENAME, as an integer.")
2643 (filename) 2643 (filename)
2644 Lisp_Object filename; 2644 Lisp_Object filename;
2645{ 2645{
@@ -2666,7 +2666,7 @@ DEFUN ("file-modes", Ffile_modes, Sfile_modes, 1, 1, 0,
2666} 2666}
2667 2667
2668DEFUN ("set-file-modes", Fset_file_modes, Sset_file_modes, 2, 2, 0, 2668DEFUN ("set-file-modes", Fset_file_modes, Sset_file_modes, 2, 2, 0,
2669 "Set mode bits of FILE to MODE (an integer).\n\ 2669 "Set mode bits of file named FILENAME to MODE (an integer).\n\
2670Only the 12 low bits of MODE are used.") 2670Only the 12 low bits of MODE are used.")
2671 (filename, mode) 2671 (filename, mode)
2672 Lisp_Object filename, mode; 2672 Lisp_Object filename, mode;
@@ -3839,8 +3839,8 @@ Auto-saving writes the buffer into a file\n\
3839so that your editing is not lost if the system crashes.\n\ 3839so that your editing is not lost if the system crashes.\n\
3840This file is not the file you visited; that changes only when you save.\n\ 3840This file is not the file you visited; that changes only when you save.\n\
3841Normally we run the normal hook `auto-save-hook' before saving.\n\n\ 3841Normally we run the normal hook `auto-save-hook' before saving.\n\n\
3842Non-nil first argument means do not print any message if successful.\n\ 3842A non-nil NO-MESSAGE argument means do not print any message if successful.\n\
3843Non-nil second argument means save only current buffer.") 3843A non-nil CURRENT-ONLY argument means save only current buffer.")
3844 (no_message, current_only) 3844 (no_message, current_only)
3845 Lisp_Object no_message, current_only; 3845 Lisp_Object no_message, current_only;
3846{ 3846{
@@ -4143,15 +4143,15 @@ DEFUN ("read-file-name-internal", Fread_file_name_internal, Sread_file_name_inte
4143DEFUN ("read-file-name", Fread_file_name, Sread_file_name, 1, 5, 0, 4143DEFUN ("read-file-name", Fread_file_name, Sread_file_name, 1, 5, 0,
4144 "Read file name, prompting with PROMPT and completing in directory DIR.\n\ 4144 "Read file name, prompting with PROMPT and completing in directory DIR.\n\
4145Value is not expanded---you must call `expand-file-name' yourself.\n\ 4145Value is not expanded---you must call `expand-file-name' yourself.\n\
4146Default name to DEFAULT if user enters a null string.\n\ 4146Default name to DEFAULT-FILENAME if user enters a null string.\n\
4147 (If DEFAULT is omitted, the visited file name is used,\n\ 4147 (If DEFAULT-FILENAME is omitted, the visited file name is used,\n\
4148 except that if INITIAL is specified, that combined with DIR is used.)\n\ 4148 except that if INITIAL is specified, that combined with DIR is used.)\n\
4149Fourth arg MUSTMATCH non-nil means require existing file's name.\n\ 4149Fourth arg MUSTMATCH non-nil means require existing file's name.\n\
4150 Non-nil and non-t means also require confirmation after completion.\n\ 4150 Non-nil and non-t means also require confirmation after completion.\n\
4151Fifth arg INITIAL specifies text to start with.\n\ 4151Fifth arg INITIAL specifies text to start with.\n\
4152DIR defaults to current buffer's directory default.") 4152DIR defaults to current buffer's directory default.")
4153 (prompt, dir, defalt, mustmatch, initial) 4153 (prompt, dir, default_filename, mustmatch, initial)
4154 Lisp_Object prompt, dir, defalt, mustmatch, initial; 4154 Lisp_Object prompt, dir, default_filename, mustmatch, initial;
4155{ 4155{
4156 Lisp_Object val, insdef, insdef1, tem; 4156 Lisp_Object val, insdef, insdef1, tem;
4157 struct gcpro gcpro1, gcpro2; 4157 struct gcpro gcpro1, gcpro2;
@@ -4160,12 +4160,12 @@ DIR defaults to current buffer's directory default.")
4160 4160
4161 if (NILP (dir)) 4161 if (NILP (dir))
4162 dir = current_buffer->directory; 4162 dir = current_buffer->directory;
4163 if (NILP (defalt)) 4163 if (NILP (default_filename))
4164 { 4164 {
4165 if (! NILP (initial)) 4165 if (! NILP (initial))
4166 defalt = Fexpand_file_name (initial, dir); 4166 default_filename = Fexpand_file_name (initial, dir);
4167 else 4167 else
4168 defalt = current_buffer->filename; 4168 default_filename = current_buffer->filename;
4169 } 4169 }
4170 4170
4171 /* If dir starts with user's homedir, change that to ~. */ 4171 /* If dir starts with user's homedir, change that to ~. */
@@ -4209,7 +4209,7 @@ DIR defaults to current buffer's directory default.")
4209 specbind (intern ("completion-ignore-case"), Qt); 4209 specbind (intern ("completion-ignore-case"), Qt);
4210#endif 4210#endif
4211 4211
4212 GCPRO2 (insdef, defalt); 4212 GCPRO2 (insdef, default_filename);
4213 val = Fcompleting_read (prompt, intern ("read-file-name-internal"), 4213 val = Fcompleting_read (prompt, intern ("read-file-name-internal"),
4214 dir, mustmatch, insdef1, 4214 dir, mustmatch, insdef1,
4215 Qfile_name_history); 4215 Qfile_name_history);
@@ -4222,12 +4222,12 @@ DIR defaults to current buffer's directory default.")
4222 if (NILP (val)) 4222 if (NILP (val))
4223 error ("No file name specified"); 4223 error ("No file name specified");
4224 tem = Fstring_equal (val, insdef); 4224 tem = Fstring_equal (val, insdef);
4225 if (!NILP (tem) && !NILP (defalt)) 4225 if (!NILP (tem) && !NILP (default_filename))
4226 return defalt; 4226 return default_filename;
4227 if (XSTRING (val)->size == 0 && NILP (insdef)) 4227 if (XSTRING (val)->size == 0 && NILP (insdef))
4228 { 4228 {
4229 if (!NILP (defalt)) 4229 if (!NILP (default_filename))
4230 return defalt; 4230 return default_filename;
4231 else 4231 else
4232 error ("No default file name"); 4232 error ("No default file name");
4233 } 4233 }