diff options
| author | Kim F. Storm | 2006-07-18 13:27:48 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2006-07-18 13:27:48 +0000 |
| commit | 24b1ddad0b6c5a33b58057066dff750fe3567b33 (patch) | |
| tree | dabcdb76146122542b3194d6bd3d86db1f20274e /src | |
| parent | 734d55a2bd7fa9e9d122cf8aa1090adb52197763 (diff) | |
| download | emacs-24b1ddad0b6c5a33b58057066dff750fe3567b33.tar.gz emacs-24b1ddad0b6c5a33b58057066dff750fe3567b33.zip | |
(report_file_error): Use xsignal.
(barf_or_query_if_file_exists, Fcopy_file, Fdelete_file)
(Finsert_file_contents): Use xsignal2.
(syms_of_fileio): Use list2, list3.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 48 |
1 files changed, 20 insertions, 28 deletions
diff --git a/src/fileio.c b/src/fileio.c index 21e6fd3a86c..d26b2808726 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -280,7 +280,7 @@ report_file_error (string, data) | |||
| 280 | switch (errorno) | 280 | switch (errorno) |
| 281 | { | 281 | { |
| 282 | case EEXIST: | 282 | case EEXIST: |
| 283 | Fsignal (Qfile_already_exists, Fcons (errstring, data)); | 283 | xsignal (Qfile_already_exists, Fcons (errstring, data)); |
| 284 | break; | 284 | break; |
| 285 | default: | 285 | default: |
| 286 | /* System error messages are capitalized. Downcase the initial | 286 | /* System error messages are capitalized. Downcase the initial |
| @@ -288,7 +288,7 @@ report_file_error (string, data) | |||
| 288 | if (SREF (errstring, 1) != '/') | 288 | if (SREF (errstring, 1) != '/') |
| 289 | SSET (errstring, 0, DOWNCASE (SREF (errstring, 0))); | 289 | SSET (errstring, 0, DOWNCASE (SREF (errstring, 0))); |
| 290 | 290 | ||
| 291 | Fsignal (Qfile_error, | 291 | xsignal (Qfile_error, |
| 292 | Fcons (build_string (string), Fcons (errstring, data))); | 292 | Fcons (build_string (string), Fcons (errstring, data))); |
| 293 | } | 293 | } |
| 294 | } | 294 | } |
| @@ -2384,9 +2384,8 @@ barf_or_query_if_file_exists (absname, querystring, interactive, statptr, quick) | |||
| 2384 | if (lstat (SDATA (encoded_filename), &statbuf) >= 0) | 2384 | if (lstat (SDATA (encoded_filename), &statbuf) >= 0) |
| 2385 | { | 2385 | { |
| 2386 | if (! interactive) | 2386 | if (! interactive) |
| 2387 | Fsignal (Qfile_already_exists, | 2387 | xsignal2 (Qfile_already_exists, |
| 2388 | Fcons (build_string ("File already exists"), | 2388 | build_string ("File already exists"), absname); |
| 2389 | Fcons (absname, Qnil))); | ||
| 2390 | GCPRO1 (absname); | 2389 | GCPRO1 (absname); |
| 2391 | tem = format2 ("File %s already exists; %s anyway? ", | 2390 | tem = format2 ("File %s already exists; %s anyway? ", |
| 2392 | absname, build_string (querystring)); | 2391 | absname, build_string (querystring)); |
| @@ -2396,9 +2395,8 @@ barf_or_query_if_file_exists (absname, querystring, interactive, statptr, quick) | |||
| 2396 | tem = do_yes_or_no_p (tem); | 2395 | tem = do_yes_or_no_p (tem); |
| 2397 | UNGCPRO; | 2396 | UNGCPRO; |
| 2398 | if (NILP (tem)) | 2397 | if (NILP (tem)) |
| 2399 | Fsignal (Qfile_already_exists, | 2398 | xsignal2 (Qfile_already_exists, |
| 2400 | Fcons (build_string ("File already exists"), | 2399 | build_string ("File already exists"), absname); |
| 2401 | Fcons (absname, Qnil))); | ||
| 2402 | if (statptr) | 2400 | if (statptr) |
| 2403 | *statptr = statbuf; | 2401 | *statptr = statbuf; |
| 2404 | } | 2402 | } |
| @@ -2500,9 +2498,8 @@ uid and gid of FILE to NEWNAME. */) | |||
| 2500 | { | 2498 | { |
| 2501 | /* Restore original attributes. */ | 2499 | /* Restore original attributes. */ |
| 2502 | SetFileAttributes (filename, attributes); | 2500 | SetFileAttributes (filename, attributes); |
| 2503 | Fsignal (Qfile_date_error, | 2501 | xsignal2 (Qfile_date_error, |
| 2504 | Fcons (build_string ("Cannot set file date"), | 2502 | build_string ("Cannot set file date"), newname); |
| 2505 | Fcons (newname, Qnil))); | ||
| 2506 | } | 2503 | } |
| 2507 | /* Restore original attributes. */ | 2504 | /* Restore original attributes. */ |
| 2508 | SetFileAttributes (filename, attributes); | 2505 | SetFileAttributes (filename, attributes); |
| @@ -2598,9 +2595,8 @@ uid and gid of FILE to NEWNAME. */) | |||
| 2598 | EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0); | 2595 | EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0); |
| 2599 | if (set_file_times (SDATA (encoded_newname), | 2596 | if (set_file_times (SDATA (encoded_newname), |
| 2600 | atime, mtime)) | 2597 | atime, mtime)) |
| 2601 | Fsignal (Qfile_date_error, | 2598 | xsignal2 (Qfile_date_error, |
| 2602 | Fcons (build_string ("Cannot set file date"), | 2599 | build_string ("Cannot set file date"), newname); |
| 2603 | Fcons (newname, Qnil))); | ||
| 2604 | } | 2600 | } |
| 2605 | } | 2601 | } |
| 2606 | 2602 | ||
| @@ -2696,9 +2692,9 @@ If file has multiple names, it continues to exist with the other names. */) | |||
| 2696 | GCPRO1 (filename); | 2692 | GCPRO1 (filename); |
| 2697 | if (!NILP (Ffile_directory_p (filename)) | 2693 | if (!NILP (Ffile_directory_p (filename)) |
| 2698 | && NILP (Ffile_symlink_p (filename))) | 2694 | && NILP (Ffile_symlink_p (filename))) |
| 2699 | Fsignal (Qfile_error, | 2695 | xsignal2 (Qfile_error, |
| 2700 | Fcons (build_string ("Removing old name: is a directory"), | 2696 | build_string ("Removing old name: is a directory"), |
| 2701 | Fcons (filename, Qnil))); | 2697 | filename); |
| 2702 | UNGCPRO; | 2698 | UNGCPRO; |
| 2703 | filename = Fexpand_file_name (filename, Qnil); | 2699 | filename = Fexpand_file_name (filename, Qnil); |
| 2704 | 2700 | ||
| @@ -3848,9 +3844,8 @@ actually used. */) | |||
| 3848 | goto notfound; | 3844 | goto notfound; |
| 3849 | 3845 | ||
| 3850 | if (! NILP (replace) || ! NILP (beg) || ! NILP (end)) | 3846 | if (! NILP (replace) || ! NILP (beg) || ! NILP (end)) |
| 3851 | Fsignal (Qfile_error, | 3847 | xsignal2 (Qfile_error, |
| 3852 | Fcons (build_string ("not a regular file"), | 3848 | build_string ("not a regular file"), orig_filename); |
| 3853 | Fcons (orig_filename, Qnil))); | ||
| 3854 | } | 3849 | } |
| 3855 | #endif | 3850 | #endif |
| 3856 | 3851 | ||
| @@ -4723,9 +4718,8 @@ actually used. */) | |||
| 4723 | } | 4718 | } |
| 4724 | #endif /* CLASH_DETECTION */ | 4719 | #endif /* CLASH_DETECTION */ |
| 4725 | if (not_regular) | 4720 | if (not_regular) |
| 4726 | Fsignal (Qfile_error, | 4721 | xsignal2 (Qfile_error, |
| 4727 | Fcons (build_string ("not a regular file"), | 4722 | build_string ("not a regular file"), orig_filename); |
| 4728 | Fcons (orig_filename, Qnil))); | ||
| 4729 | } | 4723 | } |
| 4730 | 4724 | ||
| 4731 | if (set_coding_system) | 4725 | if (set_coding_system) |
| @@ -6630,19 +6624,17 @@ of file names regardless of the current language environment. */); | |||
| 6630 | staticpro (&Qcar_less_than_car); | 6624 | staticpro (&Qcar_less_than_car); |
| 6631 | 6625 | ||
| 6632 | Fput (Qfile_error, Qerror_conditions, | 6626 | Fput (Qfile_error, Qerror_conditions, |
| 6633 | Fcons (Qfile_error, Fcons (Qerror, Qnil))); | 6627 | list2 (Qfile_error, Qerror)); |
| 6634 | Fput (Qfile_error, Qerror_message, | 6628 | Fput (Qfile_error, Qerror_message, |
| 6635 | build_string ("File error")); | 6629 | build_string ("File error")); |
| 6636 | 6630 | ||
| 6637 | Fput (Qfile_already_exists, Qerror_conditions, | 6631 | Fput (Qfile_already_exists, Qerror_conditions, |
| 6638 | Fcons (Qfile_already_exists, | 6632 | list3 (Qfile_already_exists, Qfile_error, Qerror)); |
| 6639 | Fcons (Qfile_error, Fcons (Qerror, Qnil)))); | ||
| 6640 | Fput (Qfile_already_exists, Qerror_message, | 6633 | Fput (Qfile_already_exists, Qerror_message, |
| 6641 | build_string ("File already exists")); | 6634 | build_string ("File already exists")); |
| 6642 | 6635 | ||
| 6643 | Fput (Qfile_date_error, Qerror_conditions, | 6636 | Fput (Qfile_date_error, Qerror_conditions, |
| 6644 | Fcons (Qfile_date_error, | 6637 | list3 (Qfile_date_error, Qfile_error, Qerror)); |
| 6645 | Fcons (Qfile_error, Fcons (Qerror, Qnil)))); | ||
| 6646 | Fput (Qfile_date_error, Qerror_message, | 6638 | Fput (Qfile_date_error, Qerror_message, |
| 6647 | build_string ("Cannot set file date")); | 6639 | build_string ("Cannot set file date")); |
| 6648 | 6640 | ||