Function: embark-eval-replace

embark-eval-replace is an interactive and byte-compiled function defined in embark.el.

Signature

(embark-eval-replace NOQUOTE)

Documentation

Evaluate region and replace with evaluated result.

If NOQUOTE is non-nil (interactively, if called with a prefix argument), no quoting is used for strings.

Key Bindings

Source Code

;; Defined in ~/.emacs.d/elpa/embark-20260610.302/embark.el
(defun embark-eval-replace (noquote)
  "Evaluate region and replace with evaluated result.
If NOQUOTE is non-nil (interactively, if called with a prefix
argument), no quoting is used for strings."
  (interactive "P")
  (let ((beg (region-beginning))
        (end (region-end)))
    (save-excursion
      (goto-char end)
      (insert (format (if noquote "%s" "%S")
               (eval (read (buffer-substring beg end)) lexical-binding)))
      (delete-region beg end))))