branch: master
commit 216550ee2376e9fe1f3bc6ea10d3321825c3e33b
Author: Oleh Krehel <ohwoeo...@gmail.com>
Commit: Oleh Krehel <ohwoeo...@gmail.com>

    Add option to font-lock `defhydra'
    
    * hydra.el (hydra-add-font-lock): New function.
    
    Fixes #32.
---
 hydra.el |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/hydra.el b/hydra.el
index 94347ea..70de566 100644
--- a/hydra.el
+++ b/hydra.el
@@ -111,6 +111,14 @@ It's possible to set this to nil.")
 (defface hydra-face-amaranth
     '((t (:foreground "#E52B50" :bold t)))
   "Amaranth Hydra can exit only through a blue head.")
+;;* Fontification
+(defun hydra-add-font-lock ()
+  "Fontify `defhydra' statements."
+  (font-lock-add-keywords
+   'emacs-lisp-mode
+   '(("(\\(defhydra\\)\\_> +\\(.*?\\)\\_>"
+      (1 font-lock-keyword-face)
+      (2 font-lock-type-face)))))
 
 ;;* Universal Argument
 (defvar hydra-base-map

Reply via email to