From 9de3d88eb881311c89f2e00421f7203a42b9246f Mon Sep 17 00:00:00 2001 From: Pierre Neidhardt Date: Sun, 28 May 2017 12:05:01 +0200 Subject: [PATCH] Emacs: Simplify code for TODO, FIXME, etc. fontification --- .emacs.d/lisp/visual.el | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.emacs.d/lisp/visual.el b/.emacs.d/lisp/visual.el index cff2e728..f8aea9f7 100644 --- a/.emacs.d/lisp/visual.el +++ b/.emacs.d/lisp/visual.el @@ -160,15 +160,9 @@ (font-lock-add-keywords nil ;; See https://en.wikipedia.org/wiki/Comment_(computer_programming)#Tags. - '(("\\<\\(FIXME\\(([^)]+)\\)?\\):" 1 font-lock-warning-face prepend) - ("\\<\\(HACK\\):" 1 font-lock-warning-face prepend) - ("\\<\\(OPTIMIZE\\(([^)]+)\\)?\\):" 1 font-lock-warning-face prepend) - ("\\<\\(REVIEW\\(([^)]+)\\)?\\):" 1 font-lock-warning-face prepend) - ("\\<\\(TODO\\(([^)]+)\\)?\\):" 1 font-lock-warning-face prepend) - ("\\<\\(UNDONE\\):" 1 font-lock-warning-face prepend) - ("\\<\\(UX\\):" 1 font-lock-warning-face prepend) - ("\\<\\(WARNING\\):" 1 font-lock-warning-face prepend) - ("\\<\\(XXX\\):" 1 font-lock-warning-face prepend)))))) + (mapcar + (lambda (keyword) `(,(concat "\\<\\(" keyword "\\):") 1 font-lock-warning-face prepend)) + '("FIXME\\(([^)]+)\\)?" "HACK" "OPTIMIZE\\(([^)]+)\\)?" "REVIEW\\(([^)]+)\\)?" "TODO\\(([^)]+)\\)?" "UNDONE" "UX" "WARNING" "XXX")))))) ;; Man pages (add-hook