From 256284f5c076fea7c3ba1bea9a4efddd4a0b73dc Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 21 Jul 2019 23:57:03 +0200 Subject: [PATCH] ui/hl-todo: add HACK, REVIEW & DEPRECATED keywords And include following colon, if any. --- modules/ui/hl-todo/autoload.el | 18 ------------------ modules/ui/hl-todo/config.el | 8 ++++++-- 2 files changed, 6 insertions(+), 20 deletions(-) delete mode 100644 modules/ui/hl-todo/autoload.el diff --git a/modules/ui/hl-todo/autoload.el b/modules/ui/hl-todo/autoload.el deleted file mode 100644 index 21f09e6b7..000000000 --- a/modules/ui/hl-todo/autoload.el +++ /dev/null @@ -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))) - diff --git a/modules/ui/hl-todo/config.el b/modules/ui/hl-todo/config.el index 4e1ee456f..624a04cb2 100644 --- a/modules/ui/hl-todo/config.el +++ b/modules/ui/hl-todo/config.el @@ -3,10 +3,14 @@ (def-package! hl-todo :hook (prog-mode . hl-todo-mode) :config - (setq hl-todo-keyword-faces + (setq hl-todo-highlight-punctuation ":" + hl-todo-keyword-faces `(("TODO" . ,(face-foreground 'warning)) ("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 ;; don't use/have a valid syntax table entry for comments.