branch: elpa/emacsql
commit 682c1816fb6a0bc280f4f14899a81de7f2c21dd8
Author: Christopher Wellons <well...@nullprogram.com>
Commit: Christopher Wellons <well...@nullprogram.com>

    Add optional font-locking.
---
 emacsql.el | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/emacsql.el b/emacsql.el
index 4482878968..2d09f60aff 100644
--- a/emacsql.el
+++ b/emacsql.el
@@ -476,6 +476,13 @@ definitions for return from a `emacsql-defexpander'."
                           (recur 0)
                           (combine (emacsql-expand subsql :sub)))))))))))))
 
+(defun emacsql-init-font-lock ()
+  "Add font-lock highlighting for `emacsql-defexpander'."
+  (font-lock-add-keywords
+   'emacs-lisp-mode
+   '(("(\\(emacsql-defexpander\\)\\_>"
+      (1 'font-lock-keyword-face)))))
+
 ;; SQL Expansion Functions:
 
 (emacsql-defexpander :select (arg)

Reply via email to