diff options
| author | Eli Zaretskii | 2015-10-04 12:23:45 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2015-10-04 12:23:45 +0300 |
| commit | 2021680e9dcd277a4ebbdb613d535e6edc86f384 (patch) | |
| tree | 06ab54e63156c388e5012bd969ead613d4c5abb6 | |
| parent | 45d0b3dd119566b2d2b29526b931eead15cdf740 (diff) | |
| download | emacs-2021680e9dcd277a4ebbdb613d535e6edc86f384.tar.gz emacs-2021680e9dcd277a4ebbdb613d535e6edc86f384.zip | |
; Restore some of the recent deletions in fileio.c
* src/fileio.c (Finsert_file_contents, choose_write_coding_system):
Restore some of the recently deleted calls to CHECK_CODING_SYSTEM.
| -rw-r--r-- | src/fileio.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/src/fileio.c b/src/fileio.c index b82b7d360b5..3155ef0edf1 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -3470,7 +3470,11 @@ by calling `format-decode', which see. */) | |||
| 3470 | mtime = time_error_value (save_errno); | 3470 | mtime = time_error_value (save_errno); |
| 3471 | st.st_size = -1; | 3471 | st.st_size = -1; |
| 3472 | if (!NILP (Vcoding_system_for_read)) | 3472 | if (!NILP (Vcoding_system_for_read)) |
| 3473 | Fset (Qbuffer_file_coding_system, Vcoding_system_for_read); | 3473 | { |
| 3474 | /* Don't let invalid values into buffer-file-coding-system. */ | ||
| 3475 | CHECK_CODING_SYSTEM (Vcoding_system_for_read); | ||
| 3476 | Fset (Qbuffer_file_coding_system, Vcoding_system_for_read); | ||
| 3477 | } | ||
| 3474 | goto notfound; | 3478 | goto notfound; |
| 3475 | } | 3479 | } |
| 3476 | 3480 | ||
| @@ -4569,7 +4573,7 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file | |||
| 4569 | if (NILP (val)) | 4573 | if (NILP (val)) |
| 4570 | { | 4574 | { |
| 4571 | /* If we still have not decided a coding system, use the | 4575 | /* If we still have not decided a coding system, use the |
| 4572 | default value of buffer-file-coding-system. */ | 4576 | current buffer's value of buffer-file-coding-system. */ |
| 4573 | val = BVAR (current_buffer, buffer_file_coding_system); | 4577 | val = BVAR (current_buffer, buffer_file_coding_system); |
| 4574 | using_default_coding = 1; | 4578 | using_default_coding = 1; |
| 4575 | } | 4579 | } |
| @@ -4587,9 +4591,16 @@ choose_write_coding_system (Lisp_Object start, Lisp_Object end, Lisp_Object file | |||
| 4587 | 4591 | ||
| 4588 | if (!force_raw_text | 4592 | if (!force_raw_text |
| 4589 | && !NILP (Ffboundp (Vselect_safe_coding_system_function))) | 4593 | && !NILP (Ffboundp (Vselect_safe_coding_system_function))) |
| 4590 | /* Confirm that VAL can surely encode the current region. */ | 4594 | { |
| 4591 | val = call5 (Vselect_safe_coding_system_function, | 4595 | /* Confirm that VAL can surely encode the current region. */ |
| 4592 | start, end, val, Qnil, filename); | 4596 | val = call5 (Vselect_safe_coding_system_function, |
| 4597 | start, end, val, Qnil, filename); | ||
| 4598 | /* As the function specified by select-safe-coding-system-function | ||
| 4599 | is out of our control, make sure we are not fed by bogus | ||
| 4600 | values. */ | ||
| 4601 | if (!NILP (val)) | ||
| 4602 | CHECK_CODING_SYSTEM (val); | ||
| 4603 | } | ||
| 4593 | 4604 | ||
| 4594 | /* If the decided coding-system doesn't specify end-of-line | 4605 | /* If the decided coding-system doesn't specify end-of-line |
| 4595 | format, we use that of | 4606 | format, we use that of |