2017-06-08 11:47:56 +02:00
|
|
|
;;; ui/hl-todo/packages.el -*- lexical-binding: t; -*-
|
2017-02-19 18:13:15 -05:00
|
|
|
|
2019-07-23 12:44:03 +02:00
|
|
|
(use-package! hl-todo
|
2017-12-08 22:33:12 -05:00
|
|
|
:hook (prog-mode . hl-todo-mode)
|
2017-02-19 18:13:15 -05:00
|
|
|
:config
|
2019-07-21 23:57:03 +02:00
|
|
|
(setq hl-todo-highlight-punctuation ":"
|
|
|
|
hl-todo-keyword-faces
|
2020-04-10 00:18:31 -04:00
|
|
|
`(;; For things that need to be done, just not today.
|
|
|
|
("TODO" warning bold)
|
|
|
|
;; For problems that will become bigger problems later if not
|
|
|
|
;; fixed ASAP.
|
|
|
|
("FIXME" error bold)
|
|
|
|
;; For tidbits that are unconventional and not intended uses of the
|
|
|
|
;; constituent parts, and may break in a future update.
|
|
|
|
("HACK" font-lock-constant-face bold)
|
|
|
|
;; For things that were done hastily and/or hasn't been thoroughly
|
|
|
|
;; tested. It may not even be necessary!
|
|
|
|
("REVIEW" font-lock-keyword-face bold)
|
|
|
|
;; For especially important gotchas with a given implementation,
|
|
|
|
;; directed at another user other than the author.
|
|
|
|
("NOTE" success bold)
|
|
|
|
;; For things that just gotta go and will soon be gone.
|
2019-12-01 23:00:05 -05:00
|
|
|
("DEPRECATED" font-lock-doc-face bold)))
|
2017-09-14 12:50:54 +02:00
|
|
|
|
|
|
|
;; Use a more primitive todo-keyword detection method in major modes that
|
|
|
|
;; don't use/have a valid syntax table entry for comments.
|
2019-07-18 15:27:20 +02:00
|
|
|
(add-hook! '(pug-mode-hook haml-mode-hook)
|
|
|
|
(defun +hl-todo--use-face-detection-h ()
|
|
|
|
"Use a different, more primitive method of locating todo keywords."
|
|
|
|
(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)))))
|