diff options
| author | Richard M. Stallman | 1993-06-13 00:07:35 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-06-13 00:07:35 +0000 |
| commit | 51cf6d37910e297caa2f3e14ee245b1070394c41 (patch) | |
| tree | 3a8d61ee66215f1321a6d93b1a68220bfbb38583 /src | |
| parent | 8a2c760a0efb478880a3a198e9713a5fb69b5b8a (diff) | |
| download | emacs-51cf6d37910e297caa2f3e14ee245b1070394c41.tar.gz emacs-51cf6d37910e297caa2f3e14ee245b1070394c41.zip | |
(Fcopy_file): Pass all the args to the handler.
(Fwrite_region): Use call6.
(Frename_file): Look for handler for newname.
(Fadd_name_to_file): Pass arg ok_if_already_exists to handler.
(Fmake_symbolic_link): Likewise.
(Ffile_newer_than_file_p): Check both file names for handler.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/fileio.c b/src/fileio.c index d7805c5d582..68ad2790969 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -1584,6 +1584,7 @@ A prefix arg makes KEEP-TIME non-nil.") | |||
| 1584 | Lisp_Object handler; | 1584 | Lisp_Object handler; |
| 1585 | struct gcpro gcpro1, gcpro2; | 1585 | struct gcpro gcpro1, gcpro2; |
| 1586 | int count = specpdl_ptr - specpdl; | 1586 | int count = specpdl_ptr - specpdl; |
| 1587 | Lisp_Object args[6]; | ||
| 1587 | 1588 | ||
| 1588 | GCPRO2 (filename, newname); | 1589 | GCPRO2 (filename, newname); |
| 1589 | CHECK_STRING (filename, 0); | 1590 | CHECK_STRING (filename, 0); |
| @@ -1594,12 +1595,12 @@ A prefix arg makes KEEP-TIME non-nil.") | |||
| 1594 | /* If the input file name has special constructs in it, | 1595 | /* If the input file name has special constructs in it, |
| 1595 | call the corresponding file handler. */ | 1596 | call the corresponding file handler. */ |
| 1596 | handler = Ffind_file_name_handler (filename); | 1597 | handler = Ffind_file_name_handler (filename); |
| 1597 | if (!NILP (handler)) | ||
| 1598 | return call3 (handler, Qcopy_file, filename, newname); | ||
| 1599 | /* Likewise for output file name. */ | 1598 | /* Likewise for output file name. */ |
| 1600 | handler = Ffind_file_name_handler (newname); | 1599 | if (NILP (handler)) |
| 1600 | handler = Ffind_file_name_handler (newname); | ||
| 1601 | if (!NILP (handler)) | 1601 | if (!NILP (handler)) |
| 1602 | return call3 (handler, Qcopy_file, filename, newname); | 1602 | return call5 (handler, Qcopy_file, filename, newname, |
| 1603 | ok_if_already_exists, keep_date); | ||
| 1603 | 1604 | ||
| 1604 | if (NILP (ok_if_already_exists) | 1605 | if (NILP (ok_if_already_exists) |
| 1605 | || XTYPE (ok_if_already_exists) == Lisp_Int) | 1606 | || XTYPE (ok_if_already_exists) == Lisp_Int) |
| @@ -1747,6 +1748,8 @@ This is what happens in interactive use with M-x.") | |||
| 1747 | /* If the file name has special constructs in it, | 1748 | /* If the file name has special constructs in it, |
| 1748 | call the corresponding file handler. */ | 1749 | call the corresponding file handler. */ |
| 1749 | handler = Ffind_file_name_handler (filename); | 1750 | handler = Ffind_file_name_handler (filename); |
| 1751 | if (NILP (handler)) | ||
| 1752 | handler = Ffind_file_name_handler (newname); | ||
| 1750 | if (!NILP (handler)) | 1753 | if (!NILP (handler)) |
| 1751 | return call4 (handler, Qrename_file, | 1754 | return call4 (handler, Qrename_file, |
| 1752 | filename, newname, ok_if_already_exists); | 1755 | filename, newname, ok_if_already_exists); |
| @@ -1808,7 +1811,8 @@ This is what happens in interactive use with M-x.") | |||
| 1808 | call the corresponding file handler. */ | 1811 | call the corresponding file handler. */ |
| 1809 | handler = Ffind_file_name_handler (filename); | 1812 | handler = Ffind_file_name_handler (filename); |
| 1810 | if (!NILP (handler)) | 1813 | if (!NILP (handler)) |
| 1811 | return call3 (handler, Qadd_name_to_file, filename, newname); | 1814 | return call4 (handler, Qadd_name_to_file, filename, newname, |
| 1815 | ok_if_already_exists); | ||
| 1812 | 1816 | ||
| 1813 | if (NILP (ok_if_already_exists) | 1817 | if (NILP (ok_if_already_exists) |
| 1814 | || XTYPE (ok_if_already_exists) == Lisp_Int) | 1818 | || XTYPE (ok_if_already_exists) == Lisp_Int) |
| @@ -1859,7 +1863,8 @@ This happens for interactive use with M-x.") | |||
| 1859 | call the corresponding file handler. */ | 1863 | call the corresponding file handler. */ |
| 1860 | handler = Ffind_file_name_handler (filename); | 1864 | handler = Ffind_file_name_handler (filename); |
| 1861 | if (!NILP (handler)) | 1865 | if (!NILP (handler)) |
| 1862 | return call3 (handler, Qmake_symbolic_link, filename, linkname); | 1866 | return call4 (handler, Qmake_symbolic_link, filename, linkname, |
| 1867 | ok_if_already_exists); | ||
| 1863 | 1868 | ||
| 1864 | if (NILP (ok_if_already_exists) | 1869 | if (NILP (ok_if_already_exists) |
| 1865 | || XTYPE (ok_if_already_exists) == Lisp_Int) | 1870 | || XTYPE (ok_if_already_exists) == Lisp_Int) |
| @@ -2317,6 +2322,8 @@ otherwise, if FILE2 does not exist, the answer is t.") | |||
| 2317 | /* If the file name has special constructs in it, | 2322 | /* If the file name has special constructs in it, |
| 2318 | call the corresponding file handler. */ | 2323 | call the corresponding file handler. */ |
| 2319 | handler = Ffind_file_name_handler (abspath1); | 2324 | handler = Ffind_file_name_handler (abspath1); |
| 2325 | if (NILP (handler)) | ||
| 2326 | handler = Ffind_file_name_handler (abspath2); | ||
| 2320 | if (!NILP (handler)) | 2327 | if (!NILP (handler)) |
| 2321 | return call3 (handler, Qfile_newer_than_file_p, abspath1, abspath2); | 2328 | return call3 (handler, Qfile_newer_than_file_p, abspath1, abspath2); |
| 2322 | 2329 | ||
| @@ -2554,16 +2561,9 @@ to the file, instead of any buffer contents, and END is ignored.") | |||
| 2554 | 2561 | ||
| 2555 | if (!NILP (handler)) | 2562 | if (!NILP (handler)) |
| 2556 | { | 2563 | { |
| 2557 | Lisp_Object args[7]; | ||
| 2558 | Lisp_Object val; | 2564 | Lisp_Object val; |
| 2559 | args[0] = handler; | 2565 | val = call6 (handler, Qwrite_region, start, end, |
| 2560 | args[1] = Qwrite_region; | 2566 | filename, append, visit); |
| 2561 | args[2] = start; | ||
| 2562 | args[3] = end; | ||
| 2563 | args[4] = filename; | ||
| 2564 | args[5] = append; | ||
| 2565 | args[6] = visit; | ||
| 2566 | val = Ffuncall (7, args); | ||
| 2567 | 2567 | ||
| 2568 | /* Do this before reporting IO error | 2568 | /* Do this before reporting IO error |
| 2569 | to avoid a "file has changed on disk" warning on | 2569 | to avoid a "file has changed on disk" warning on |