Function: cider-emit-into-popup-buffer

cider-emit-into-popup-buffer is a byte-compiled function defined in cider-popup.el.

Signature

(cider-emit-into-popup-buffer BUFFER VALUE &optional FACE INHIBIT-INDENT)

Documentation

Emit into BUFFER the provided VALUE optionally using FACE.

Indent emitted value (usually a sexp) unless INHIBIT-INDENT is specified and non-nil.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-popup.el
(defun cider-emit-into-popup-buffer (buffer value &optional face inhibit-indent)
  "Emit into BUFFER the provided VALUE optionally using FACE.
Indent emitted value (usually a sexp) unless INHIBIT-INDENT is specified
and non-nil."
  ;; Long string output renders Emacs unresponsive and users might intentionally
  ;; kill the frozen popup buffer. Therefore, we don't re-create the buffer and
  ;; silently ignore the output.
  (when (buffer-live-p buffer)
    (with-current-buffer buffer
      (let ((inhibit-read-only t)
            (buffer-undo-list t)
            (moving (= (point) cider-popup-output-marker)))
        (save-excursion
          (goto-char cider-popup-output-marker)
          (let ((value-str (format "%s" value)))
            (when face
              (add-face-text-property 0 (length value-str) face nil value-str))
            (insert value-str))
          (unless inhibit-indent
            (indent-sexp))
          (set-marker cider-popup-output-marker (point)))
        (when moving (goto-char cider-popup-output-marker))))))