2008-09-05 64 views

回答

22

你有

 
(setq-default indent-tabs-mode nil) 
在你的.emacs

?當我這樣做時,它在emacs 23.0.60.1中可以正常工作。 js2-mode使用標準的emacs函數indent-to(尊重indent-tabs-mode)來進行縮進。

10

添加到您的.emacs文件保存在某個加載JS2模式後:

(setq js2-mode-hook 
    '(lambda() (progn 
    (set-variable 'indent-tabs-mode nil)))) 
3

在我的GNU Emacs的24.2.1的副本,設置:

(setq-default indent-tabs-mode nil) 

中的.emacs是不夠的javascript模式,大概是因爲該設置在某個緩衝區上下文中已經被覆蓋了。以下更改已足夠:

(custom-set-variables 
;; custom-set-variables was added by Custom. 
;; If you edit it by hand, you could mess it up, so be careful. 
;; Your init file should contain only one such instance. 
;; If there is more than one, they won't work right. 
'(indent-tabs-mode nil)) 
相關問題