615 |
@defvar buffer-file-coding-system |
@defvar buffer-file-coding-system |
616 |
This variable records the coding system that was used for visiting the |
This variable records the coding system that was used for visiting the |
617 |
current buffer. It is used for saving the buffer, and for writing part |
current buffer. It is used for saving the buffer, and for writing part |
618 |
of the buffer with @code{write-region}. When those operations ask the |
of the buffer with @code{write-region}. If the text to be written |
619 |
user to specify a different coding system, |
cannot be safely encoded using the coding system specified by this |
620 |
@code{buffer-file-coding-system} is updated to the coding system |
variable, these operations select an alternative encoding by calling |
621 |
specified. |
the function @code{select-safe-coding-system} (@pxref{User-Chosen |
622 |
|
Coding Systems}). If selecting a different encoding requires to ask |
623 |
|
the user to specify a coding system, @code{buffer-file-coding-system} |
624 |
|
is updated to the newly selected coding system. |
625 |
|
|
626 |
However, @code{buffer-file-coding-system} does not affect sending text |
@code{buffer-file-coding-system} does @emph{not} affect sending text |
627 |
to a subprocess. |
to a subprocess. |
628 |
@end defvar |
@end defvar |
629 |
|
|
636 |
@code{buffer-file-coding-system} (or @code{save-buffer-coding-system}), |
@code{buffer-file-coding-system} (or @code{save-buffer-coding-system}), |
637 |
and that coding system cannot handle |
and that coding system cannot handle |
638 |
the actual text in the buffer, the command asks the user to choose |
the actual text in the buffer, the command asks the user to choose |
639 |
another coding system. After that happens, the command also updates |
another coding system (by calling @code{select-safe-coding-system}). |
640 |
@code{buffer-file-coding-system} to represent the coding system that the |
After that happens, the command also updates |
641 |
user specified. |
@code{buffer-file-coding-system} to represent the coding system that |
642 |
|
the user specified. |
643 |
@end defvar |
@end defvar |
644 |
|
|
645 |
@defvar last-coding-system-used |
@defvar last-coding-system-used |
743 |
@node User-Chosen Coding Systems |
@node User-Chosen Coding Systems |
744 |
@subsection User-Chosen Coding Systems |
@subsection User-Chosen Coding Systems |
745 |
|
|
746 |
|
@cindex select safe coding system |
747 |
@defun select-safe-coding-system from to &optional default-coding-system accept-default-p |
@defun select-safe-coding-system from to &optional default-coding-system accept-default-p |
748 |
This function selects a coding system for encoding specified text, |
This function selects a coding system for encoding specified text, |
749 |
asking the user to choose if necessary. Normally the specified text |
asking the user to choose if necessary. Normally the specified text |