我只有一个来自插件的模式,我想全局启用它。为了手动打开它,我需要输入M-x highlight-indentation-mode. 所以,下面是我尝试过的列表:(highlight-indentation-mode t)
, (highlight-indentation-mode 1)
, (setq highlight-indentation-mode t)
. 没有任何效果。接下来我发现可能是我需要全局启用一个模式,于是我开始用谷歌搜索它。我接下来尝试了什么:
(define-globalized-minor-mode global-highlight-indentation-mode highlight-indentation-mode
(lambda () (setq highlight-indentation-mode t)))
不,这肯定不是我要找的机器人,它打开了变量,但模式仍然不起作用。
(define-globalized-minor-mode global-highlight-indentation-mode highlight-indentation-mode
(lambda () highlight-indentation-mode t))
(define-globalized-minor-mode global-highlight-indentation-mode highlight-indentation-mode
(highlight-indentation-mode t))
这两个只是破坏了我的 Emacs:当我尝试在 config 中使用这两个命令打开文件时,Emacs 写了一个错误,并拒绝打开文件。
UPD:根据我也尝试过的评论
(defun enable-highlight-indentation-mode ()
(interactive)
(highlight-indentation-mode t))
(define-globalized-minor-mode global-highlight-indentation-mode highlight-indentation-mode
enable-highlight-indentation-mode)
(global-highlight-indentation-mode t)
没有(interactive)
. 当我尝试用这个打开一个文件时,Emacs 拒绝打开,并写一个错误:
File mode specification error: (void-function nil)
c-font-lock-fontify-region: Symbol's function definition is void: nil