LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 1519|回复: 2

我设置的emacs的tab-width值,为什么不生效啊?

[复制链接]
发表于 2006-9-25 09:49:00 | 显示全部楼层 |阅读模式
用emacs写c++,非常不习惯默认的2个空格的tab width,想改成4个空格的,可是怎么改都不好使,我在编辑C++文件时,按tab键,还是缩进2个空格。
下面是我的.emacs文件的内容:
(setq current-language-environment "UTF-8")
(setq default-input-method "chinese-py")
(setq locale-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(prefer-coding-system 'utf-8)
;; Set the tab width
(setq default-tab-width 4)
(setq tab-width 4)
(setq c-basic-indent 4)
;; C++ and C mode...
(defun my-c++-mode-hook ()
  (setq tab-width 4)
  (define-key c++-mode-map "\C-m" 'reindent-then-newline-and-indent)
  (define-key c++-mode-map "\C-ce" 'c-comment-edit)
  (setq c++-auto-hungry-initial-state 'none)
  (setq c++-delete-function 'backward-delete-char)
  (setq c++-tab-always-indent t)
  (setq c-indent-level 4)
  (setq c-continued-statement-offset 4)
  (setq c++-empty-arglist-indent 4))
发表于 2006-9-25 12:03:02 | 显示全部楼层
  1. (c-set-style "stroustrup")
复制代码
如何?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-9-25 13:04:29 | 显示全部楼层
楼上,还是不好使
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表