# HG changeset patch # User Kenichi Handa # Date 1040125199 0 # Node ID 0b4aeb4594adb198ac6ad633e729440c52e30614 # Parent e79464fe61d71e59b480ed2013ce2b3364b9cb01 (choose_write_coding_system): Even if Vcoding_system_for_write is non-nil, if coding_system_require_warning is nonzero, call Vselect_safe_coding_system_function. diff -r e79464fe61d7 -r 0b4aeb4594ad src/fileio.c --- a/src/fileio.c Tue Dec 17 11:39:34 2002 +0000 +++ b/src/fileio.c Tue Dec 17 11:39:59 2002 +0000 @@ -4624,7 +4624,15 @@ if (auto_saving) val = Qnil; else if (!NILP (Vcoding_system_for_write)) - val = Vcoding_system_for_write; + { + val = Vcoding_system_for_write; + if (coding_system_require_warning + && !NILP (Ffboundp (Vselect_safe_coding_system_function))) + /* Confirm that VAL can surely encode the current region. */ + val = call5 (Vselect_safe_coding_system_function, + start, end, Fcons (Qt, Fcons (val, Qnil)), + Qnil, filename); + } else { /* If the variable `buffer-file-coding-system' is set locally,