Function: verb--eval-code-tags-in-buffer

verb--eval-code-tags-in-buffer is a natively compiled function defined in verb.el.

Signature

(verb--eval-code-tags-in-buffer BUF CONTEXT)

Documentation

Eval code tags within buffer BUF.

When evaluating the code, use buffer CONTEXT as the current buffer. Replace the code tags with the results of their own evaluations. Code tags are delimited with verb-code-tag-delimiters.

Source Code

;; Defined in /nix/store/8jnfn8w2mxcxbr2crbklcnija9m0zlkq-emacs-packages-deps/share/emacs/site-lisp/elpa/verb-20260818.1921/verb.el
(defun verb--eval-code-tags-in-buffer (buf context)
  "Eval code tags within buffer BUF.
When evaluating the code, use buffer CONTEXT as the current buffer.
Replace the code tags with the results of their own evaluations.  Code
tags are delimited with `verb-code-tag-delimiters'."
  (unless verb--inhibit-code-tags-evaluation
    (with-current-buffer buf
      (while (re-search-forward (concat (car verb-code-tag-delimiters)
                                        "\\(.*?\\)"
                                        (cdr verb-code-tag-delimiters))
                                nil t)
        (let ((result (verb--eval-string (match-string 1) context)))
          (cond
           ((stringp result)
            (replace-match result nil t))
           ((bufferp result)
            (goto-char (match-beginning 0))
            (delete-region (match-beginning 0) (match-end 0))
            (insert-buffer-substring result)
            (when (buffer-local-value 'verb-kill-this-buffer result)
              (kill-buffer result)))
           (t
            (replace-match (format "%s" result) nil t))))))))