Function: combobulate-query-builder-expand-match-face
combobulate-query-builder-expand-match-face is a natively compiled
function defined in combobulate-query.el.
Signature
(combobulate-query-builder-expand-match-face QUERY &optional ADDITIONAL-MATCH-FACES)
Documentation
Given a QUERY, expand all @hl.* matches with the appropriate face.
The QUERY can be either a Lisp form or a string, but it is always returned as a string.
Faces are sourced from combobulate-query-match-face-alist. If
ADDITIONAL-MATCH-FACES is non-nil, then it is an alist of match
faces to also replace. NOTE that neither ADDITIONAL-MATCH-FACES
nor combobulate-query-match-face-alist should have @ prefixed
to its keys.
Note that ADDITIONAL-MATCH-FACES are converted first, giving you
the opportunity to map generic constructs like @capture to a
known combobulate highlighter, for instance.
Source Code
;; Defined in /nix/store/b5fvrwzi3zvkabyzx0in6gw1cj963z46-emacs-packages-deps/share/emacs/site-lisp/combobulate-query.el
(defun combobulate-query-builder-expand-match-face (query &optional additional-match-faces)
"Given a QUERY, expand all `@hl.*' matches with the appropriate face.
The QUERY can be either a Lisp form or a string, but it is always
returned as a string.
Faces are sourced from `combobulate-query-match-face-alist'. If
ADDITIONAL-MATCH-FACES is non-nil, then it is an alist of match
faces to also replace. NOTE that neither ADDITIONAL-MATCH-FACES
nor `combobulate-query-match-face-alist' should have `@' prefixed
to its keys.
Note that ADDITIONAL-MATCH-FACES are converted first, giving you
the opportunity to map generic constructs like `@capture' to a
known combobulate highlighter, for instance."
(let ((query (if (stringp query) query (prin1-to-string query))))
(dolist (match-face (append additional-match-faces
combobulate-query-match-face-alist))
(let ((match-name (car match-face))
(face (cdr match-face)))
(setq query (replace-regexp-in-string
(concat (concat "@" match-name))
(concat "@" (symbol-name (cadr face)))
query))))
query))