2010-01-19 32 views
2

我使用Emacs 23.1和ESS 5.4编辑Sweave文件。我想关闭缓冲区中的默认AUCTeX缩进行为(以避免包含在逐项列表中的代码块带来的麻烦),所以在文件顶部我有% -*- LaTeX-indent-level: 0; LaTeX-item-indent: 0; -*-。当我打开了缓冲和运行C-h v LaTeX-indent-level,我得到了我想要的东西:使用Emacs和Sweave的缓冲区局部变量

LaTeX-indent-level is a variable defined in `latex.el'. 
Its value is 0 
Local in buffer test.Rnw; global value is 2 

    This variable is a file local variable. 

然而,当我编辑的代码块,它返回到默认的行为。 C-h v LaTeX-indent-level,现在产量:

LaTeX-indent-level is a variable defined in `latex.el'. 
Its value is 2 

我试图修复中the noweb-mode FAQ建议,该建议加入

(add-hook 'noweb-select-mode-hook 
       '(lambda() (hack-local-variables-prop-line))) 

我的.emacs。当我这样做时,上述行为依然存在。

有什么办法可以让缓冲区局部变量在这种情况下工作吗?我宁愿不必更改我的.emacs以在所有Sweave/noweb缓冲区中将LaTeX-indent-level设置为0。

回答

0

我没有测试过这一点,但尽量不要使用以下:

(add-hook 'noweb-select-mode-hook 
       '(lambda() (hack-local-variables))) 

也许劈局部变量 - 丙线已改为只解析值,而不是instate他们。