emacs python 缩进问题_在emacs 23中将python indent设置为2个空格?

我在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缩进时,它会说:

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。Grr号。我试着自定义变量并保存,仍然是4。我试着自定义组缩进,还是4。

如何让emacs注意?

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值