Function: cider-repl--display-external-body

cider-repl--display-external-body is a byte-compiled function defined in cider-repl.el.

Signature

(cider-repl--display-external-body BUFFER URL &optional SHOW-PREFIX BOL)

Documentation

Insert URL and a button that fetches its content into BUFFER.

The URL itself is a link that opens in the browser. For compatibility with the rest of CIDER's REPL machinery, supports SHOW-PREFIX and BOL.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260822.1520/cider-repl.el
(defun cider-repl--display-external-body (buffer url &optional show-prefix bol)
  "Insert URL and a button that fetches its content into BUFFER.
The URL itself is a link that opens in the browser.  For compatibility
with the rest of CIDER's REPL machinery, supports SHOW-PREFIX and BOL."
  (with-current-buffer buffer
    (save-excursion
      (cider-save-marker cider-repl-output-start
        (goto-char cider-repl-output-end)
        (when (and bol (not (bolp)))
          (insert-before-markers "\n"))
        (when show-prefix
          (insert-before-markers
           (propertize cider-repl-result-prefix 'font-lock-face 'font-lock-comment-face)))
        (let ((start (point)))
          (insert-before-markers url)
          (make-text-button start (point)
                            'follow-link t
                            'help-echo "Open in the browser"
                            'action (lambda (_button) (browse-url url))))
        (insert-before-markers " ")
        (let ((start (point)))
          (insert-before-markers "[show content]")
          (make-text-button start (point)
                            'follow-link t
                            'help-echo (format "Fetch %s and render it here" url)
                            'action (lambda (_button)
                                      (cider-repl--fetch-external-body buffer url)))))))
  t)