问题是现在我一按Tab是八个空格(space),怎么样才能是一个'\t'? 我在网上找到一段 .emacs的配置:
代码:
(require 'cc-mode) (defun my-build-tab-stop-list (width) (let ((num-tab-stops (/ 80 width)) (counter 1) (ls nil)) (while (<= counter num-tab-stops) (setq ls (cons (* width counter) ls)) (setq counter (1+ counter))) (set (make-local-variable 'tab-stop-list) (nreverse ls)))) (defun my-c-mode-common-hook () (setq tab-width 8) ;; change this to taste, this is what K&R uses :) (my-build-tab-stop-list tab-width) (setq c-basic-offset tab-width) (setq indent-tabs-mode nil)) ;; force only spaces for indentation (add-hook 'c-mode-common-hook 'my-c-mode-common-hook)
但是不管用
请教,谢谢
|