diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2024-10-03 21:05:59 +0200 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2024-10-03 21:05:59 +0200 |
| commit | da803c676ef981d96eeaa3755f69e4e2cbf9d40f (patch) | |
| tree | d3d79e63b1afe097e75c64dc82f9b94908772530 | |
| parent | f349f7503eb0a2c8a4458bebf78c2583e0f83dda (diff) | |
llama-font-lock-keywords-29: Use font-lock-keyword-face for llama
Make that the default, but do so via a new `llama-llama-macro' face
to make it customizable. Rename `llama-macro' to `llama-\#\#-macro'
for consistency.
| -rw-r--r-- | llama.el | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -320,9 +320,12 @@ that) is used as COLLECTION, by `unintern'ing that symbol temporarily." :group 'extensions :group 'lisp) -(defface llama-macro '((t :inherit font-lock-function-call-face)) +(defface llama-\#\#-macro '((t :inherit font-lock-function-call-face)) "Face used for the name of the `##' macro.") +(defface llama-llama-macro '((t :inherit font-lock-keyword-face)) + "Face used for the name of the `llama' macro.") + (defface llama-mandatory-argument '((t :inherit font-lock-variable-use-face)) "Face used for mandatory arguments `%1' through `%9' and `%'.") @@ -345,8 +348,8 @@ body), these arguments are deleted from the function body during macro expansion, and the looks of this face should hint at that.") (defconst llama-font-lock-keywords-28 - '(("(\\(##\\)" 1 'llama-macro) - ("(\\(llama\\)\\_>" 1 'font-lock-keyword-face) + '(("(\\(##\\)" 1 'llama-\#\#-macro) + ("(\\(llama\\)\\_>" 1 'llama-llama-macro) ("\\_<\\(?:_?%[1-9]?\\)\\_>" 0 (llama--maybe-face 'llama-mandatory-argument)) ("\\_<\\(?:_?&[1-9*]?\\)\\_>" @@ -355,8 +358,11 @@ expansion, and the looks of this face should hint at that.") 0 'llama-deleted-argument prepend))) (defconst llama-font-lock-keywords-29 - '(("\\_<\\(&[1-9*]?\\)\\_>" 1 'default) - (llama--match-and-fontify 1 'llama-macro))) + `(("\\_<\\(&[1-9*]?\\)\\_>" 1 'default) + (,(apply-partially #'llama--match-and-fontify "(\\(##\\)") + 1 'llama-\#\#-macro) + (,(apply-partially #'llama--match-and-fontify "(\\(llama\\_>\\)") + 1 'llama-llama-macro))) (defvar llama-font-lock-keywords (if (fboundp 'read-positioning-symbols) @@ -372,8 +378,8 @@ expansion, and the looks of this face should hint at that.") (1+ beg) (match-beginning 0)))))) face)) -(defun llama--match-and-fontify (end) - (and (re-search-forward "(\\(##\\|llama\\_>\\)" end t) +(defun llama--match-and-fontify (re end) + (and (re-search-forward re end t) (prog1 t (save-excursion (goto-char (match-beginning 0)) |
