Variable: buffer-file-coding-system
buffer-file-coding-system is a buffer-local variable defined in
buffer.c.
Documentation
Coding system to be used for encoding the buffer contents on saving.
This variable applies to saving the buffer, and also to write-region
and other functions that use write-region.
It does not apply to sending output to subprocesses, however.
If this is nil, the buffer is saved without any code conversion
unless some coding system is specified in file-coding-system-alist
for the buffer file.
If the text to be saved cannot be encoded as specified by this variable,
an alternative encoding is selected by select-safe-coding-system, which see.
The variable coding-system-for-write, if non-nil, overrides this variable.
This variable is never applied to a way of decoding a file while reading it.
Probably introduced at or before Emacs version 20.4.
Source Code
// Defined in /usr/src/emacs/src/buffer.c
DEFVAR_PER_BUFFER ("buffer-file-coding-system",
&BVAR (current_buffer, buffer_file_coding_system), Qnil,
doc: /* Coding system to be used for encoding the buffer contents on saving.
This variable applies to saving the buffer, and also to `write-region'
and other functions that use `write-region'.
It does not apply to sending output to subprocesses, however.
If this is nil, the buffer is saved without any code conversion
unless some coding system is specified in `file-coding-system-alist'
for the buffer file.
If the text to be saved cannot be encoded as specified by this variable,
an alternative encoding is selected by `select-safe-coding-system', which see.
The variable `coding-system-for-write', if non-nil, overrides this variable.
This variable is never applied to a way of decoding a file while reading it. */);