diff options
author | Case Duckworth | 2022-01-25 16:54:47 -0600 |
---|---|---|
committer | Case Duckworth | 2022-01-25 16:54:47 -0600 |
commit | 3c30daf8a5c3424ad05d9637c30567d56004269d (patch) | |
tree | 32dfd034e923954667a228019435e2d328304ab8 | |
parent | Here we go again (diff) | |
download | emacs-3c30daf8a5c3424ad05d9637c30567d56004269d.tar.gz emacs-3c30daf8a5c3424ad05d9637c30567d56004269d.zip |
Add function `font-lock-todo-insinuate'
-rw-r--r-- | init.el | 4 | ||||
-rw-r--r-- | lisp/acdw.el | 19 |
2 files changed, 20 insertions, 3 deletions
diff --git a/init.el b/init.el index 21647cd..ed7252e 100644 --- a/init.el +++ b/init.el | |||
@@ -45,9 +45,7 @@ | |||
45 | ;; "C-x C-3" #'+split-window-right-then | 45 | ;; "C-x C-3" #'+split-window-right-then |
46 | ) | 46 | ) |
47 | ;; Font-lock keywords | 47 | ;; Font-lock keywords |
48 | (font-lock-add-keywords | 48 | (add-hook 'prog-mode-hook #'font-lock-todo-insinuate) |
49 | nil | ||
50 | '(("\\<\\(TODO\\|XXX\\|FIXME\\|BUG\\):" 1 font-lock-warning-face t))) | ||
51 | ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults | 49 | ;; C-h deletes backward - see https://idiomdrottning.org/bad-emacs-defaults |
52 | (global-set-key (kbd "C-h") 'delete-backward-char) | 50 | (global-set-key (kbd "C-h") 'delete-backward-char) |
53 | (keyboard-translate ?\C-h ?\C-?) | 51 | (keyboard-translate ?\C-h ?\C-?) |
diff --git a/lisp/acdw.el b/lisp/acdw.el index 4e5afb5..d805a10 100644 --- a/lisp/acdw.el +++ b/lisp/acdw.el | |||
@@ -222,5 +222,24 @@ UNIT can be one of :kb, :mb, :gb, :tb, :pb, :eb, :zb, :yb; :kib, :mib, :gib, | |||
222 | (:zib (* 1024 1024 1024 1024 1024 1024 1024)) | 222 | (:zib (* 1024 1024 1024 1024 1024 1024 1024)) |
223 | (:yib (* 1024 1024 1024 1024 1024 1024 1024 1024))))) | 223 | (:yib (* 1024 1024 1024 1024 1024 1024 1024 1024))))) |
224 | 224 | ||
225 | ;;; Font lock TODO keywords | ||
226 | |||
227 | (defcustom font-lock-todo-keywords '("TODO" "XXX" "FIXME" "BUG") | ||
228 | "Keywords to highlight with `font-lock-todo-face'.") | ||
229 | |||
230 | (defface font-lock-todo-face '((t :inherit font-lock-warning-face)) | ||
231 | "Face for TODO keywords.") | ||
232 | |||
233 | (defun font-lock-todo-insinuate () | ||
234 | (let ((keyword-regexp | ||
235 | (rx bow (group (eval (let ((lst '(or))) | ||
236 | (dolist (kw font-lock-todo-keywords) | ||
237 | (push kw lst)) | ||
238 | (nreverse lst)))) | ||
239 | ":"))) | ||
240 | (font-lock-add-keywords | ||
241 | nil | ||
242 | `((,keyword-regexp 1 'font-lock-todo-face prepend))))) | ||
243 | |||
225 | (provide 'acdw) | 244 | (provide 'acdw) |
226 | ;;; acdw.el ends here | 245 | ;;; acdw.el ends here |