我想为C和python文件单独配置Emacs空格选项,因为缩进突出显示(制表符前的空格等)不适用于Python编码样式。我目前全局设置了空格变量,但希望为Python单独(最小)配置。以下是我的.emacs的相关部分:
(require 'whitespace)
(setq whitespace-line-column 80)
(setq whitespace-style '(face lines-tail indentation trailing space-before-tab))
(add-hook 'c-mode-hook 'whitespace-mode)这适用于C语言,最好是Python的'(face Lines Tail trailing),但我不知道如何为特定的模式设置q。执行此操作的正确方法是什么?谢谢。在Ubuntu中使用Emacs 23。
发布于 2012-12-07 02:26:31
我通过将设置与空白模式的调用一起放入钩子中,使其正常工作:
(add-hook 'python-mode-hook
(lambda ()
(progn
(setq whitespace-line-column 79)
(setq whitespace-style '(face lines-tail))
(whitespace-mode))))发布于 2011-11-02 01:09:22
也许使用File Local Variables可以对您有所帮助?
https://stackoverflow.com/questions/7970052
复制相似问题