896 |
|
|
897 |
@table @kbd |
@table @kbd |
898 |
@item C-x @key{RET} f @var{coding} @key{RET} |
@item C-x @key{RET} f @var{coding} @key{RET} |
899 |
Use coding system @var{coding} for the visited file |
Use coding system @var{coding} for saving or revisiting the visited |
900 |
in the current buffer. |
file in the current buffer. |
901 |
|
|
902 |
@item C-x @key{RET} c @var{coding} @key{RET} |
@item C-x @key{RET} c @var{coding} @key{RET} |
903 |
Specify coding system @var{coding} for the immediately following |
Specify coding system @var{coding} for the immediately following |
924 |
|
|
925 |
@kindex C-x RET f |
@kindex C-x RET f |
926 |
@findex set-buffer-file-coding-system |
@findex set-buffer-file-coding-system |
927 |
The command @kbd{C-x @key{RET} f} (@code{set-buffer-file-coding-system}) |
The command @kbd{C-x @key{RET} f} |
928 |
specifies the file coding system for the current buffer---in other |
(@code{set-buffer-file-coding-system}) sets the file coding system for |
929 |
words, which coding system to use when saving or rereading the visited |
the current buffer---in other words, it says which coding system to |
930 |
file. You specify which coding system using the minibuffer. Since this |
use when saving or reverting the visited file. You specify which |
931 |
command applies to a file you have already visited, it affects only the |
coding system using the minibuffer. If you specify a coding system |
932 |
way the file is saved. |
that cannot handle all of the characters in the buffer, Emacs warns |
933 |
|
you about the troublesome characters when you actually save the |
934 |
|
buffer. |
935 |
|
|
936 |
@kindex C-x RET c |
@kindex C-x RET c |
937 |
@findex universal-coding-system-argument |
@findex universal-coding-system-argument |
944 |
|
|
945 |
So if the immediately following command is @kbd{C-x C-f}, for example, |
So if the immediately following command is @kbd{C-x C-f}, for example, |
946 |
it reads the file using that coding system (and records the coding |
it reads the file using that coding system (and records the coding |
947 |
system for when the file is saved). Or if the immediately following |
system for when you later save the file). Or if the immediately following |
948 |
command is @kbd{C-x C-w}, it writes the file using that coding system. |
command is @kbd{C-x C-w}, it writes the file using that coding system. |
949 |
Other file commands affected by a specified coding system include |
When you specify the coding system for saving in this way, instead |
950 |
@kbd{C-x C-i} and @kbd{C-x C-v}, as well as the other-window variants of |
of with @kbd{C-x @key{RET} f}, there is no warning if the buffer |
951 |
@kbd{C-x C-f}. |
contains characters that the coding system cannot handle. |
952 |
|
|
953 |
|
Other file commands affected by a specified coding system include |
954 |
|
@kbd{C-x C-i} and @kbd{C-x C-v}, as well as the other-window variants |
955 |
|
of @kbd{C-x C-f}. @kbd{C-x @key{RET} c} also affects commands that |
956 |
|
start subprocesses, including @kbd{M-x shell} (@pxref{Shell}). |
957 |
|
|
958 |
@kbd{C-x @key{RET} c} also affects commands that start subprocesses, |
If the immediately following command does not use the coding system, |
959 |
including @kbd{M-x shell} (@pxref{Shell}). |
then @kbd{C-x @key{RET} c} ultimately has no effect. |
|
|
|
|
However, if the immediately following command does not use the coding |
|
|
system, then @kbd{C-x @key{RET} c} ultimately has no effect. |
|
960 |
|
|
961 |
An easy way to visit a file with no conversion is with the @kbd{M-x |
An easy way to visit a file with no conversion is with the @kbd{M-x |
962 |
find-file-literally} command. @xref{Visiting}. |
find-file-literally} command. @xref{Visiting}. |