diff options
| author | Richard M. Stallman | 1997-04-01 04:25:04 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-04-01 04:25:04 +0000 |
| commit | c0b7b21c1271c9a53f15489485a104f1ba1d583f (patch) | |
| tree | 24b1119a451e6d782bdcfdd58b7c1c4d4373367f /src | |
| parent | 0992c4d48802ac8917d9e10af52bf639f8abe320 (diff) | |
| download | emacs-c0b7b21c1271c9a53f15489485a104f1ba1d583f.tar.gz emacs-c0b7b21c1271c9a53f15489485a104f1ba1d583f.zip | |
(Fcopy_file): Use Qfile_date_error if can't set file date.
(Qfile_date_error): New variable.
(syms_of_fileio): Set it up.
Diffstat (limited to 'src')
| -rw-r--r-- | src/fileio.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/fileio.c b/src/fileio.c index b925c18c41b..cd8b0c19d0f 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -207,7 +207,7 @@ extern int minibuf_level; | |||
| 207 | static Lisp_Object Vinhibit_file_name_handlers; | 207 | static Lisp_Object Vinhibit_file_name_handlers; |
| 208 | static Lisp_Object Vinhibit_file_name_operation; | 208 | static Lisp_Object Vinhibit_file_name_operation; |
| 209 | 209 | ||
| 210 | Lisp_Object Qfile_error, Qfile_already_exists; | 210 | Lisp_Object Qfile_error, Qfile_already_exists, Qfile_date_error; |
| 211 | 211 | ||
| 212 | Lisp_Object Qfile_name_history; | 212 | Lisp_Object Qfile_name_history; |
| 213 | 213 | ||
| @@ -2129,7 +2129,9 @@ A prefix arg makes KEEP-TIME non-nil.") | |||
| 2129 | EMACS_SET_SECS_USECS (atime, st.st_atime, 0); | 2129 | EMACS_SET_SECS_USECS (atime, st.st_atime, 0); |
| 2130 | EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0); | 2130 | EMACS_SET_SECS_USECS (mtime, st.st_mtime, 0); |
| 2131 | if (set_file_times (XSTRING (newname)->data, atime, mtime)) | 2131 | if (set_file_times (XSTRING (newname)->data, atime, mtime)) |
| 2132 | report_file_error ("I/O error", Fcons (newname, Qnil)); | 2132 | Fsignal (Qfile_date_error, |
| 2133 | Fcons (build_string ("File already exists"), | ||
| 2134 | Fcons (absname, Qnil))); | ||
| 2133 | } | 2135 | } |
| 2134 | #ifndef MSDOS | 2136 | #ifndef MSDOS |
| 2135 | chmod (XSTRING (newname)->data, st.st_mode & 07777); | 2137 | chmod (XSTRING (newname)->data, st.st_mode & 07777); |
| @@ -4789,6 +4791,8 @@ syms_of_fileio () | |||
| 4789 | staticpro (&Qfile_error); | 4791 | staticpro (&Qfile_error); |
| 4790 | Qfile_already_exists = intern ("file-already-exists"); | 4792 | Qfile_already_exists = intern ("file-already-exists"); |
| 4791 | staticpro (&Qfile_already_exists); | 4793 | staticpro (&Qfile_already_exists); |
| 4794 | Qfile_date_error = intern ("file-date-error"); | ||
| 4795 | staticpro (&Qfile_date_error); | ||
| 4792 | 4796 | ||
| 4793 | #ifdef DOS_NT | 4797 | #ifdef DOS_NT |
| 4794 | Qfind_buffer_file_type = intern ("find-buffer-file-type"); | 4798 | Qfind_buffer_file_type = intern ("find-buffer-file-type"); |
| @@ -4821,6 +4825,12 @@ same format as a regular save would use."); | |||
| 4821 | Fput (Qfile_already_exists, Qerror_message, | 4825 | Fput (Qfile_already_exists, Qerror_message, |
| 4822 | build_string ("File already exists")); | 4826 | build_string ("File already exists")); |
| 4823 | 4827 | ||
| 4828 | Fput (Qfile_date_error, Qerror_conditions, | ||
| 4829 | Fcons (Qfile_date_error, | ||
| 4830 | Fcons (Qfile_error, Fcons (Qerror, Qnil)))); | ||
| 4831 | Fput (Qfile_date_error, Qerror_message, | ||
| 4832 | build_string ("Cannot set file date")); | ||
| 4833 | |||
| 4824 | DEFVAR_BOOL ("insert-default-directory", &insert_default_directory, | 4834 | DEFVAR_BOOL ("insert-default-directory", &insert_default_directory, |
| 4825 | "*Non-nil means when reading a filename start with default dir in minibuffer."); | 4835 | "*Non-nil means when reading a filename start with default dir in minibuffer."); |
| 4826 | insert_default_directory = 1; | 4836 | insert_default_directory = 1; |