且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Emacs:全局启用空格模式

更新时间:2022-12-27 16:22:26

一般来说,***通过使用函数调用来启用/禁用模式设置变量(这是您为 global-whitespace-mode 所做的)。



尝试:

 (全球空白模式1)


I want globally enable whitespace-mode. I have tried this in my .emacs:

(require 'whitespace)
(setq-default whitespace-style '(face trailing lines empty indentation::space))
(setq-default whitespace-line-column 80)
(setq global-whitespace-mode 1)
(whitespace-mode 1)

but without success... I able to enable it via M+x whitespace-mode, but I want it to enable it globally... Any suggestions? I am using GNU Emacs 23.3.1 .

In general it's best to enable/disable modes by using the function call, not setting the variable (which is what you did for global-whitespace-mode).

Try:

(global-whitespace-mode 1)