elisp: properly highlight narf macros
This commit is contained in:
parent
503a019bab
commit
c08c266bfd
1 changed files with 14 additions and 4 deletions
|
@ -47,10 +47,20 @@
|
||||||
collect
|
collect
|
||||||
(cons disp (cons k v)))))
|
(cons disp (cons k v)))))
|
||||||
|
|
||||||
(font-lock-add-keywords 'emacs-lisp-mode `(("(\\(lambda\\)" (0 (narf/show-as ?λ)))))
|
(font-lock-add-keywords
|
||||||
;; Highlight narf macros (macros are already fontified in emacs 25+)
|
'emacs-lisp-mode
|
||||||
(when (<= emacs-major-version 24)
|
`(("(\\(lambda\\)"
|
||||||
(font-lock-add-keywords 'emacs-lisp-mode `(("(\\([^!]+!\\) " 1 'font-lock-keyword-face))))
|
(1 (narf/show-as ?λ)))
|
||||||
|
;; Highlight narf macros (macros are fontified in emacs 25+)
|
||||||
|
(,(concat
|
||||||
|
"(\\("
|
||||||
|
(regexp-opt '("λ" "in" "map" "after" "exmap" "shut-up"
|
||||||
|
"add-hook" "associate" "open-with" "define-repl"
|
||||||
|
"define-builder" "narf-space-setup" "define-env-command"
|
||||||
|
"define-text-object" "add-yas-minor-mode"
|
||||||
|
"define-company-backend"))
|
||||||
|
"!\\)")
|
||||||
|
(1 font-lock-keyword-face append))))
|
||||||
|
|
||||||
;; Real go-to-definition for elisp
|
;; Real go-to-definition for elisp
|
||||||
(map! :map emacs-lisp-mode-map
|
(map! :map emacs-lisp-mode-map
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue