我目前在mac上,正在尝试将Emacs设置为默认情况下不在文件末尾添加换行符,但我搜索的几乎所有内容都表明只需将(setq需要最终换行符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问题的答案来实现:如何告诉emacs以C++模式打开.h文件?(显然是根据自己的需要定制答案)。