Function: cider-make-popup-buffer

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

Signature

(cider-make-popup-buffer NAME &optional MODE ANCILLARY)

Documentation

Create a temporary buffer called NAME using major MODE (if specified).

If ANCILLARY is non-nil, the buffer is added to cider-ancillary-buffers and automatically removed when killed.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/cider-popup.el
(defun cider-make-popup-buffer (name &optional mode ancillary)
  "Create a temporary buffer called NAME using major MODE (if specified).
If ANCILLARY is non-nil, the buffer is added to `cider-ancillary-buffers'
and automatically removed when killed."
  (with-current-buffer (get-buffer-create name)
    (kill-all-local-variables)
    (setq buffer-read-only nil)
    (erase-buffer)
    (when mode
      (funcall mode))
    (cider-popup-buffer-mode 1)
    (setq cider-popup-output-marker (point-marker))
    (setq buffer-read-only t)
    (when ancillary
      (add-to-list 'cider-ancillary-buffers name)
      (add-hook 'kill-buffer-hook
                (lambda ()
                  (setq cider-ancillary-buffers
                        (remove name cider-ancillary-buffers)))
                nil 'local))
    (current-buffer)))