Python Mode

EmacsPython モードには python-mode.el と python.el の2種類があったんですかそうですか。恥ずかしながら今更知った。

手動で python-mode.el 入れた Meadow では、RET で適切にインデントを入れてくれてたのに、CarbonEmacs では行頭に行っちゃうのが、どうしていやーん、とか思ってたんだけど。

というか python.el でも C-j で、ちゃんとインデント入れてくれるんですか。AquaSKK 入れてるから、かな入力切り替えになっちゃって気付かなかったよ。

しかも RET にバインドする方法も書いてた。これでスッキリ。

http://www.emacswiki.org/cgi-bin/wiki/PythonMode#toc2

 In python-mode.el RET is bound to py-newline-and-indent, which indents the next line if necessary. In python.el this is bound to C-j instead. You can get the previous behavior with this in your InitFile:

 (add-hook 'python-mode-hook '(lambda () (define-key python-mode-map "\C-m" 'newline-and-indent)))