我在Ubuntu 10.04上使用emacs 23.1.1。我希望在Python中编写一个2空格的缩进。 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空格缩进。当我尝试C-h 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.
那就是4,不是2。我尝试自定义变量和保存,仍然4.我尝试自定义组缩进,仍然4。
如何让emacs得到注意?