diff --git a/hl-todo.el b/hl-todo.el index b342e02..a008aef 100644 --- a/hl-todo.el +++ b/hl-todo.el @@ -467,6 +467,19 @@ then append that character to the inserted string." (save-excursion (insert "\n"))) (indent-region (line-beginning-position) (line-end-position)))))) +(defun hl-todo-magit-revision () + "Highlight TODO and similar keywords in commit messages and notes. +If `global-hl-todo-mode' is disabled, do nothing." + (when global-hl-todo-mode + (let ((case-fold-search nil) + (regexp (hl-todo--regexp))) + (while (re-search-forward regexp nil t) + (put-text-property (match-beginning 1) + (match-end 1) + 'font-lock-face (hl-todo--get-face)))))) + +(add-hook 'magit-wash-message-hook #'hl-todo-magit-revision) + ;;; _ (provide 'hl-todo) ;; Local Variables: