Ubuntu 10.04 で emacs 23.1.1 を使用しています。2 スペースのインデントを使用して Python でプログラミングしたいと考えています。emacs には python (python.el?) のデフォルト モードがあるようです。
私は.emacsに以下を入れました:
;; Only spaces, no tabs
(setq indent-tabs-mode nil)
;; Always end a file with a newline
(setq require-final-newline nil)
;; Don't know which of these might work
(setq-default tab-width 2)
(setq-default python-indent 2)
(setq-default py-indent-offset 2)
Python ファイルを編集すると、4 スペースのインデントが使用されます。Ch v python-indent を試すと、次のように表示されます。
python-indent's value is 4
Local in buffer webpage_cache.py; global value is 2
This variable is safe as a file local variable if its value
satisfies the predicate `integerp'.
Documentation:
Number of columns for a unit of indentation in Python mode.
See also `M-x python-guess-indent'
You can customize this variable.
つまり、2 ではなく 4 です。変数をカスタマイズして保存しようとしましたが、まだ 4 です。customize-group indent を試しましたが、まだ 4 です。
emacsに注意を向けさせるにはどうすればよいですか?