Function: tempel--placeholder

tempel--placeholder is a natively compiled function defined in tempel.el.

Signature

(tempel--placeholder &optional PROMPT NAME NOINSERT)

Documentation

Handle placeholder element and add field with NAME.

If NOINSERT is non-nil do not insert a field, only bind the value to NAME. PROMPT is the optional prompt/default value. If a field was added, return it.

Source Code

;; Defined in /nix/store/b3ibjbs2i12kyhwapibfx6i39f025i85-emacs-packages-deps/share/emacs/site-lisp/elpa/tempel-20260705.1258/tempel.el
(defun tempel--placeholder (&optional prompt name noinsert)
  "Handle placeholder element and add field with NAME.
If NOINSERT is non-nil do not insert a field, only bind the value to NAME.
PROMPT is the optional prompt/default value.
If a field was added, return it."
  (let ((init
         (cond
          ((and (stringp prompt) noinsert) (read-string prompt))
          ((stringp prompt) prompt)
          ;; TEMPEL EXTENSION: Evaluate prompt
          (t (eval prompt (cdar tempel--active))))))
    (if noinsert
        (progn (setf (alist-get name (cdar tempel--active)) init) nil)
      (tempel--field name init (stringp prompt)))))