when I use "use-package" macro in emacs lisp, I found that the argument is highlighted.
but argument of my own macro is not highlighted by emacs.
How to write a macro with highlighted arguments?
use-package uses font-lock-add-keywords to mark the argument with font-lock-constant-face. Replacing "use-package" with "test_macro" in the the code would colorize your argument similarly
use-package
font-lock-add-keywords
font-lock-constant-face
(defconst my-font-lock-keywords '(("(\\(test_macro\\)\\_>[ \t']*\\(\\(?:\\sw\\|\\s_\\)+\\)?" (1 font-lock-keyword-face) (2 font-lock-constant-face nil t)))) (font-lock-add-keywords 'emacs-lisp-mode my-font-lock-keywords)
Copyright © 2021 Jogjafile Inc.
use-packageusesfont-lock-add-keywordsto mark the argument withfont-lock-constant-face. Replacing "use-package" with "test_macro" in the the code would colorize your argument similarly