我的 .emacs 被忽略了吗?
我的主目录中有一个非常简单的 .emacs 文件,我试图在按 Tab 键时使其缩进 3 个空格。相反,我总是得到 2 个空格,这是默认行为。它似乎完全忽略我的 .emacs 文件......?
这是 .emacs 的内容。如果它是正确的(似乎是......)它一定会被忽略?太短了,不会出错:
;; -*-Emacs-Lisp-*-
;; This file is designed to be re-evaled; use the variable first-time
;; to avoid any problems with this.
(setq c++-mode-hook
(function (lambda ()
(setq indent-tabs-mode nil)
(setq c-indent-level 3))))
(custom-set-variables
'(tab-stop-list (quote (3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 75))))
(setq indent-tabs-mode nil)
(setq tab-width 3)
I have a very simple .emacs file in my home directory, I'm trying to get it to indent 3 spaces when I hit tab. instead I always get 2 spaces, which is the default behavior. It seems to completely ignore my .emacs file.... ?
here is the contents of the .emacs. If it's correct (seems to be...) it must be getting ignored? It's damn short, not much to go wrong:
;; -*-Emacs-Lisp-*-
;; This file is designed to be re-evaled; use the variable first-time
;; to avoid any problems with this.
(setq c++-mode-hook
(function (lambda ()
(setq indent-tabs-mode nil)
(setq c-indent-level 3))))
(custom-set-variables
'(tab-stop-list (quote (3 6 9 12 15 18 21 24 27 30 33 36 39 42 45 48 51 54 57 60 63 66 69 72 75))))
(setq indent-tabs-mode nil)
(setq tab-width 3)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试设置变量
c-basic-offset
请参阅cc手册部分
入门
了解更多详细信息。有很多方法可以自定义缩进行为。Try setting the variable
c-basic-offset
See the cc-manual section
Getting Started
for more details. There are many many ways to customize the indentation behavior.我想重新讨论这个老问题。 @user1021810 能够通过将 homedir 添加到 $PATH 来解决她/他的问题。我也这么做了。但似乎我的 .emacs 被忽略了。此外,我还尝试
似乎没有任何效果。寻求想法。
谢谢。
更新:我的 .emacs 文件的内容是有效的,因为一旦我手动加载文件,这些效果就会发生。
I'd like to reopen this old question. @user1021810 was able to fix her/his problem by adding the homedir to $PATH. I did that too. But it seems that my .emacs is being ignored. Additionally, I also tried
Nothing seems to work. Ideas sought.
Thanks.
Update: The contents of my .emacs file are valid because those effects take place as soon as I load the file manually.