我有這樣的代碼高亮顯示製表符,並希望利用項目的細節宏禁用它們:如何突出製表符從具體項目文件在Emacs
(require 'highlight-chars)
(make-variable-buffer-local 'prevent-highlight-tabs)
(setq highlight-chars-disable '(term-mode erc-mode fundamental-mode))
(setq-default prevent-highlight-tabs nil)
(add-hook 'font-lock-mode-hook
(lambda()
(message "lock")
(when (and (null (memql major-mode highlight-chars-disable))
(not prevent-highlight-tabs))
(message "%s" prevent-highlight-tabs)
(hc-highlight-tabs))))
(custom-set-faces '(hc-tab ((t (:background "red")))))
和project-specifics
是定義添加find-file-hook
宏和dired-after-readin-hook
從這個question
(project-specifics "projects/test"
(message "specific")
(setq prevent-highlight-tabs t)
(setq indent-tabs-mode t))
我想做的事是禁止的紅色標籤(我想他們,因爲在大多數項目中,我只想要空間,並希望看到製表)在工程中的文件噸/測試,但是我有一個問題,因爲從font-lock-mode-hook
代碼project-specifics
(找到文件掛機)之前執行,並防止-高亮突出部總是零在字體鎖定模式掛機。爲什麼是這樣,以及如何解決它?
的內置'空格mode'可能是有用的喲ü。 (這也可能是過度殺滅和過於複雜的滿足您的需求,但肯定是值得玩。) – phils
@phils我想在第一次嘗試使用空白模式,但是當有人建議使用'亮點,字符相反。 – jcubic