syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.67k stars 4.89k forks source link

How to customize hl-todo highlighted keywords #16165

Closed sfavazza closed 11 months ago

sfavazza commented 11 months ago

Description :octocat:

I was trying to add few keywords to the hl-todo-keyword-faces without success.

Reproduction guide :beetle:

Observed behaviour: :eyes: :broken_heart: Nothing change, the highlighting remains unchanged.

Expected behaviour: :heart: :smile: The highlighting of the additional words should reflect the given configuration.

System Info :computer:

sfavazza commented 11 months ago

After some debugging and testing the following solution worked for me:

(add-hook 'spacemacs-post-theme-change-hook
          (lambda ()
            (mapc (lambda (hl-tuple) (add-to-list 'hl-todo-keyword-faces
                                                  hl-tuple))
                  '(("WARNING" . "#b1951d")
                    ("IMPORTANT" . "#f2241f")))))

The failure of the first snippet of code was due to the fact that: