ui/hl-todo: add HACK, REVIEW & DEPRECATED keywords

And include following colon, if any.
This commit is contained in:
Henrik Lissner 2019-07-21 23:57:03 +02:00
parent 56e1dfe9bb
commit 256284f5c0
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
2 changed files with 6 additions and 20 deletions

View file

@ -1,18 +0,0 @@
;;; ui/hl-todo/autoload.el -*- lexical-binding: t; -*-
;;;###autoload
(defun +hl-todo|use-face-detection ()
"Use a different, more primitive method of locating todo keywords.
This is useful for major modes that don't use or have a valid syntax-table entry
for comment start/end characters."
(set (make-local-variable 'hl-todo-keywords)
'(((lambda (limit)
(let (case-fold-search)
(and (re-search-forward hl-todo-regexp limit t)
(memq 'font-lock-comment-face (doom-enlist (get-text-property (point) 'face))))))
(1 (hl-todo-get-face) t t))))
(when hl-todo-mode
(hl-todo-mode -1)
(hl-todo-mode +1)))

View file

@ -3,10 +3,14 @@
(def-package! hl-todo (def-package! hl-todo
:hook (prog-mode . hl-todo-mode) :hook (prog-mode . hl-todo-mode)
:config :config
(setq hl-todo-keyword-faces (setq hl-todo-highlight-punctuation ":"
hl-todo-keyword-faces
`(("TODO" . ,(face-foreground 'warning)) `(("TODO" . ,(face-foreground 'warning))
("FIXME" . ,(face-foreground 'error)) ("FIXME" . ,(face-foreground 'error))
("NOTE" . ,(face-foreground 'success)))) ("HACK" . ,(face-foreground 'font-lock-constant-face))
("REVIEW" . ,(face-foreground 'font-lock-keyword-face))
("NOTE" . ,(face-foreground 'success))
("DEPRECATED" . ,(face-foreground 'font-lock-doc-face))))
;; Use a more primitive todo-keyword detection method in major modes that ;; Use a more primitive todo-keyword detection method in major modes that
;; don't use/have a valid syntax table entry for comments. ;; don't use/have a valid syntax table entry for comments.