From: Kenichi Handa Date: Tue, 17 Dec 2002 11:39:59 +0000 (+0000) Subject: (choose_write_coding_system): Even if X-Git-Tag: ttn-vms-21-2-B4~11986 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=42b01e1e9b09b8e8fbbfe921a894e01bd0de4d44;p=emacs.git (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 --git a/src/fileio.c b/src/fileio.c index a8d27f0ef2d..996de3136de 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -4624,7 +4624,15 @@ choose_write_coding_system (start, end, filename, 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,