4
1
In Emacs, I routinely use an inferior shell, invoked with M-x shell
. I often need to specifically set its coding system, which I do with C-x RET p
followed by utf-8
(twice).
I want to do this once and for all in my .emacs file. The documentation says that the default coding system for shells started via M-x shell
comes from process-coding-system-alist
. After consulting the documentation for this variable, I tried
(add-to-list 'process-coding-system-alist '("zsh" . utf-8))
...since zsh
is my default shell. (According to the docs, the first element of the added pair is interpreted as a regex matching the shell program's name, so the string shown above should work.)
This, however, fails to produce the desired result. (E.g. some characters are not properly displayed in stdout in a freshly started *shell*
; nevertheless, these characters are properly displayed once I execute C-x RET p
, etc., as described above. This means that, whatever my add-to-list
command is doing, it is not doing what I want it to do.)
My question is simply, why doesn't'
(add-to-list 'process-coding-system-alist '("zsh" . utf-8))
work?
NB: there may be other ways to achieve the same result, but here I am specifically interested in understanding why what I tried did not work, and fix it.
Did you try starting emacs with "Toggle debug on error" to check if it correctly reads that line? – T. Verron – 2012-05-16T22:15:07.097