我的 .emacs 被忽略了吗?

发布于 2024-12-13 04:11:27 字数 615 浏览 1 评论 0原文

我的主目录中有一个非常简单的 .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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

安静 2024-12-20 04:11:27

尝试设置变量c-basic-offset

(setq c-basic-offset 3)

请参阅cc手册部分入门 了解更多详细信息。有很多方法可以自定义缩进行为。

Try setting the variable c-basic-offset

(setq c-basic-offset 3)

See the cc-manual section Getting Started for more details. There are many many ways to customize the indentation behavior.

眼泪淡了忧伤 2024-12-20 04:11:27

我想重新讨论这个老问题。 @user1021810 能够通过将 homedir 添加到 $PATH 来解决她/他的问题。我也这么做了。但似乎我的 .emacs 被忽略了。此外,我还尝试

  1. 在我的 homedir 中创建一个文件 .emacs.el
  2. 在 ~/.emacs.d dir 中创建一个文件 init.el

似乎没有任何效果。寻求想法。

谢谢。

更新:我的 .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

  1. creating a file .emacs.el in my homedir
  2. creating a file init.el in ~/.emacs.d dir

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文