Function: verb--var-preview

verb--var-preview is a natively compiled function defined in verb.el.

Signature

(verb--var-preview)

Documentation

Preview the value of a Verb variable in the minibuffer.

Source Code

;; Defined in /nix/store/8jnfn8w2mxcxbr2crbklcnija9m0zlkq-emacs-packages-deps/share/emacs/site-lisp/elpa/verb-20260818.1921/verb.el
(defun verb--var-preview ()
  "Preview the value of a Verb variable in the minibuffer."
  (when-let* (((not (current-message)))
              (verb-enable-var-preview)
              ((not (string= (buffer-substring (line-beginning-position)
                                               (1+ (line-beginning-position)))
                             "#")))
              ;; Get the contents inside the code tag: {{<content>}}.
              (beg (save-excursion
                     (when (search-backward (car verb-code-tag-delimiters)
                                            (line-beginning-position) t)
                       (match-end 0))))
              (end (save-excursion
                     (when (search-forward (cdr verb-code-tag-delimiters)
                                           (line-end-position) t)
                       (match-beginning 0))))
              (code (buffer-substring-no-properties beg end))
              (form (car (ignore-errors (read-from-string code))))
              ((eq (car form) 'verb-var))
              (var (cadr form))
              (val (assq var verb--vars)))
    (let ((message-log-max nil))
      (message "Current value for %s: %s" (car val) (cdr val)))))