gpt4 book ai didi

即使更改 .emacs 后,Emacs 也会自动添加换行符

转载 作者:行者123 更新时间:2023-12-02 23:55:57 25 4
gpt4 key购买 nike

我目前使用的是 Mac,并且正在尝试将 Emacs 设置为默认情况下不在文件末尾添加换行符,但几乎我搜索的所有内容都表示只添加 (setq require-final-newline nil)到主目录中的 .emacs 文件...这不起作用。接下来我应该注意什么来改变?

这就是 .emacs 文件现在的样子

(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.
'(gud-gdb-command-name "gdb --annotate=1")
'(large-file-warning-threshold nil)
'(require-final-newline nil))
(custom-set-faces
;; custom-set-faces 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.
)

最佳答案

你尝试过吗:

(setq mode-require-final-newline nil)

文件的主要模式可能正在使用此变量的值......

如何找出哪些模式使用此变量而不是您尝试过的变量并不是立即显而易见的,但想必该模式的作者知道得更好......

因此,您可能想要更改该文件的主要模式,这可以通过回答此 SQ 问题来完成:How to tell emacs to open .h file in C++ mode? (显然可以根据您的需要自定义答案)。

关于即使更改 .emacs 后,Emacs 也会自动添加换行符,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13574564/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com