doomemacs/modules/ui/hl-todo/autoload.el
Henrik Lissner 4be4756f90
ui/hl-todo: fix comment detection for some major modes
For major modes with poorly implemented syntax-tables, or simply can't
use them for their comments.
2017-09-14 12:50:58 +02:00

14 lines
610 B
EmacsLisp

;;; 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))))))