diff options
| author | Glenn Morris | 2014-03-25 21:14:44 -0400 |
|---|---|---|
| committer | Glenn Morris | 2014-03-25 21:14:44 -0400 |
| commit | 11ee65afc20d41f1fc31fe2ead84b2203b4bfeb0 (patch) | |
| tree | a3ae87b8d8d73968f293973444fbf3ae753d83f1 /src/fileio.c | |
| parent | defd53bdc5ef9d75fa112487d76f4d7a4cb9fe92 (diff) | |
| download | emacs-11ee65afc20d41f1fc31fe2ead84b2203b4bfeb0.tar.gz emacs-11ee65afc20d41f1fc31fe2ead84b2203b4bfeb0.zip | |
Remove the build-time option CLASH_DETECTION
Every platform supports it, and the runtime option `create-lockfiles'
replaces it.
* configure.ac (CLASH_DETECTION): Remove option.
* lisp/files.el (lock-buffer, unlock-buffer, file-locked-p):
Remove fallback aliases, since they are always defined now.
* src/buffer.c (Frestore_buffer_modified_p, Fkill_buffer):
* src/emacs.c (shut_down_emacs):
* src/fileio.c (Finsert_file_contents, write_region):
* src/filelock.c (top-level, syms_of_filelock):
* src/insdel.c (prepare_to_modify_buffer_1):
CLASH_DETECTION is always defined now.
* admin/CPP-DEFINES: Remove CLASH_DETECTION.
Diffstat (limited to 'src/fileio.c')
| -rw-r--r-- | src/fileio.c | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/fileio.c b/src/fileio.c index fb0a33b39db..152b7a8a8ed 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -4079,13 +4079,11 @@ by calling `format-decode', which see. */) | |||
| 4079 | 4079 | ||
| 4080 | if (NILP (visit) && total > 0) | 4080 | if (NILP (visit) && total > 0) |
| 4081 | { | 4081 | { |
| 4082 | #ifdef CLASH_DETECTION | ||
| 4083 | if (!NILP (BVAR (current_buffer, file_truename)) | 4082 | if (!NILP (BVAR (current_buffer, file_truename)) |
| 4084 | /* Make binding buffer-file-name to nil effective. */ | 4083 | /* Make binding buffer-file-name to nil effective. */ |
| 4085 | && !NILP (BVAR (current_buffer, filename)) | 4084 | && !NILP (BVAR (current_buffer, filename)) |
| 4086 | && SAVE_MODIFF >= MODIFF) | 4085 | && SAVE_MODIFF >= MODIFF) |
| 4087 | we_locked_file = 1; | 4086 | we_locked_file = 1; |
| 4088 | #endif /* CLASH_DETECTION */ | ||
| 4089 | prepare_to_modify_buffer (GPT, GPT, NULL); | 4087 | prepare_to_modify_buffer (GPT, GPT, NULL); |
| 4090 | } | 4088 | } |
| 4091 | 4089 | ||
| @@ -4185,10 +4183,8 @@ by calling `format-decode', which see. */) | |||
| 4185 | 4183 | ||
| 4186 | if (inserted == 0) | 4184 | if (inserted == 0) |
| 4187 | { | 4185 | { |
| 4188 | #ifdef CLASH_DETECTION | ||
| 4189 | if (we_locked_file) | 4186 | if (we_locked_file) |
| 4190 | unlock_file (BVAR (current_buffer, file_truename)); | 4187 | unlock_file (BVAR (current_buffer, file_truename)); |
| 4191 | #endif | ||
| 4192 | Vdeactivate_mark = old_Vdeactivate_mark; | 4188 | Vdeactivate_mark = old_Vdeactivate_mark; |
| 4193 | } | 4189 | } |
| 4194 | else | 4190 | else |
| @@ -4337,14 +4333,12 @@ by calling `format-decode', which see. */) | |||
| 4337 | SAVE_MODIFF = MODIFF; | 4333 | SAVE_MODIFF = MODIFF; |
| 4338 | BUF_AUTOSAVE_MODIFF (current_buffer) = MODIFF; | 4334 | BUF_AUTOSAVE_MODIFF (current_buffer) = MODIFF; |
| 4339 | XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG); | 4335 | XSETFASTINT (BVAR (current_buffer, save_length), Z - BEG); |
| 4340 | #ifdef CLASH_DETECTION | ||
| 4341 | if (NILP (handler)) | 4336 | if (NILP (handler)) |
| 4342 | { | 4337 | { |
| 4343 | if (!NILP (BVAR (current_buffer, file_truename))) | 4338 | if (!NILP (BVAR (current_buffer, file_truename))) |
| 4344 | unlock_file (BVAR (current_buffer, file_truename)); | 4339 | unlock_file (BVAR (current_buffer, file_truename)); |
| 4345 | unlock_file (filename); | 4340 | unlock_file (filename); |
| 4346 | } | 4341 | } |
| 4347 | #endif /* CLASH_DETECTION */ | ||
| 4348 | if (not_regular) | 4342 | if (not_regular) |
| 4349 | xsignal2 (Qfile_error, | 4343 | xsignal2 (Qfile_error, |
| 4350 | build_string ("not a regular file"), orig_filename); | 4344 | build_string ("not a regular file"), orig_filename); |
| @@ -4814,13 +4808,11 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename, | |||
| 4814 | if (!STRINGP (start) && !NILP (BVAR (current_buffer, selective_display))) | 4808 | if (!STRINGP (start) && !NILP (BVAR (current_buffer, selective_display))) |
| 4815 | coding.mode |= CODING_MODE_SELECTIVE_DISPLAY; | 4809 | coding.mode |= CODING_MODE_SELECTIVE_DISPLAY; |
| 4816 | 4810 | ||
| 4817 | #ifdef CLASH_DETECTION | ||
| 4818 | if (open_and_close_file && !auto_saving) | 4811 | if (open_and_close_file && !auto_saving) |
| 4819 | { | 4812 | { |
| 4820 | lock_file (lockname); | 4813 | lock_file (lockname); |
| 4821 | file_locked = 1; | 4814 | file_locked = 1; |
| 4822 | } | 4815 | } |
| 4823 | #endif /* CLASH_DETECTION */ | ||
| 4824 | 4816 | ||
| 4825 | encoded_filename = ENCODE_FILE (filename); | 4817 | encoded_filename = ENCODE_FILE (filename); |
| 4826 | fn = SSDATA (encoded_filename); | 4818 | fn = SSDATA (encoded_filename); |
| @@ -4842,10 +4834,8 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename, | |||
| 4842 | if (desc < 0) | 4834 | if (desc < 0) |
| 4843 | { | 4835 | { |
| 4844 | int open_errno = errno; | 4836 | int open_errno = errno; |
| 4845 | #ifdef CLASH_DETECTION | ||
| 4846 | if (file_locked) | 4837 | if (file_locked) |
| 4847 | unlock_file (lockname); | 4838 | unlock_file (lockname); |
| 4848 | #endif /* CLASH_DETECTION */ | ||
| 4849 | UNGCPRO; | 4839 | UNGCPRO; |
| 4850 | report_file_errno ("Opening output file", filename, open_errno); | 4840 | report_file_errno ("Opening output file", filename, open_errno); |
| 4851 | } | 4841 | } |
| @@ -4860,10 +4850,8 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename, | |||
| 4860 | if (ret < 0) | 4850 | if (ret < 0) |
| 4861 | { | 4851 | { |
| 4862 | int lseek_errno = errno; | 4852 | int lseek_errno = errno; |
| 4863 | #ifdef CLASH_DETECTION | ||
| 4864 | if (file_locked) | 4853 | if (file_locked) |
| 4865 | unlock_file (lockname); | 4854 | unlock_file (lockname); |
| 4866 | #endif /* CLASH_DETECTION */ | ||
| 4867 | UNGCPRO; | 4855 | UNGCPRO; |
| 4868 | report_file_errno ("Lseek error", filename, lseek_errno); | 4856 | report_file_errno ("Lseek error", filename, lseek_errno); |
| 4869 | } | 4857 | } |
| @@ -5006,10 +4994,8 @@ write_region (Lisp_Object start, Lisp_Object end, Lisp_Object filename, | |||
| 5006 | 4994 | ||
| 5007 | unbind_to (count, Qnil); | 4995 | unbind_to (count, Qnil); |
| 5008 | 4996 | ||
| 5009 | #ifdef CLASH_DETECTION | ||
| 5010 | if (file_locked) | 4997 | if (file_locked) |
| 5011 | unlock_file (lockname); | 4998 | unlock_file (lockname); |
| 5012 | #endif /* CLASH_DETECTION */ | ||
| 5013 | 4999 | ||
| 5014 | /* Do this before reporting IO error | 5000 | /* Do this before reporting IO error |
| 5015 | to avoid a "file has changed on disk" warning on | 5001 | to avoid a "file has changed on disk" warning on |