Emacs: Workaround for font-lock reset with sh-mode

master
Pierre Neidhardt 2014-07-15 11:45:49 +02:00
parent 65117dad17
commit 130e73513a
1 changed files with 9 additions and 0 deletions

View File

@ -45,6 +45,15 @@ The advantages of this function over the vanilla code are:
(setq sh-shell-file (concat "/bin/" (symbol-name sh-shell)))
(set (make-local-variable 'compile-command) (concat sh-shell-file " " buffer-file-name)))
;; sh-set-shell partly resets some of the font-lock config. We use this
;; workaround to restore it.
(add-hook-and-eval 'sh-set-shell-hook
(lambda () (font-lock-add-keywords
'sh-mode
'(("\\<\\(FIXME\\):" 1 font-lock-warning-face prepend)
("\\<\\(TODO\\):" 1 font-lock-warning-face prepend)
("\\<\\(WARNING\\):" 1 font-lock-warning-face prepend)))))
(add-hook-and-eval
'sh-mode-hook
(lambda ()