Meadow+Python-modeでPythonを書いている。
問題
漢字を使ったプログラムで、C-c C-c(=バッファ内容を実行)とすると、
UnicodeDecodeErrorが出ていた。
#!/usr/bin/env python # -*- coding: utf-8 -*- mes = u'漢字' print mes
解決方法
.emacsに追加(あるいは修正)
(defadvice py-execute-region (around my-py-execute-region) "back to the original buffer when py-execute-region finished." (if (get-buffer "*Python Output*") (kill-buffer "*Python Output*") nil) (let* ((coding-system-for-write buffer-file-coding-system)) ad-do-it ) (shrink-window-if-larger-than-buffer) (other-window -1) ) (ad-enable-advice 'py-execute-region 'around 'my-py-execute-region) (ad-activate 'py-execute-region)