Function: majutsu-tpl

majutsu-tpl is a macro defined in majutsu-template.el.

Signature

(majutsu-tpl FORM &optional SELF-TYPE)

Documentation

Expand and compile FORM to a jj template string.

Vector literals are compiled at macro-expansion time IF SELF-TYPE is provided as a constant.

If SELF-TYPE is not provided, compilation is deferred to runtime to respect dynamic bindings of majutsu-template-default-self-type.

Source Code

;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-template.el
;;;###autoload
(defmacro majutsu-tpl (form &optional self-type)
  "Expand and compile FORM to a jj template string.
Vector literals are compiled at macro-expansion time IF SELF-TYPE is provided
as a constant.

If SELF-TYPE is not provided, compilation is deferred to runtime to respect
dynamic bindings of `majutsu-template-default-self-type'."
  (cond
   ((and (vectorp form) (or (keywordp self-type) (and (consp self-type) (eq (car self-type) 'quote))))
    (let ((majutsu-template-default-self-type (majutsu-template--normalize-type-symbol (eval self-type)))
          (majutsu-template--allow-eval t))
      (let ((node (majutsu-template--call-with-root-self-binding
                   nil
                   (lambda ()
                     (majutsu-template--rewrite form)))))
        `(majutsu-template-compile ',node))))
   ((vectorp form)
    `(let ((majutsu-template--allow-eval t))
       (majutsu-template-compile ,form ,self-type)))
   (t
    `(let ((majutsu-template--allow-eval t))
       (majutsu-template-compile ,form ,self-type)))))