Function: cider--pin-repl-if-out-of-project
cider--pin-repl-if-out-of-project is a byte-compiled function defined
in cider-common.el.
Signature
(cider--pin-repl-if-out-of-project REPL)
Documentation
Pin REPL onto the current buffer if its file is outside REPL's project.
When jumping to a definition or resource that lives outside the
originating session's project directory (typically a dependency's
source), associate the buffer with REPL via cider--pinned-repl-buffer
so that CIDER commands invoked there target the session the buffer was
navigated from. Buffers inside the project directory are left untouched
so they keep tracking the current session.
Source Code
;; Defined in ~/.emacs.d/elpa/cider-20260822.1520/cider-common.el
(defun cider--pin-repl-if-out-of-project (repl)
"Pin REPL onto the current buffer if its file is outside REPL's project.
When jumping to a definition or resource that lives outside the
originating session's project directory (typically a dependency's
source), associate the buffer with REPL via `cider--pinned-repl-buffer'
so that CIDER commands invoked there target the session the buffer was
navigated from. Buffers inside the project directory are left untouched
so they keep tracking the current session."
(when-let* ((repl (and (buffer-live-p repl) repl))
(file (buffer-file-name)))
(let ((proj-dir (buffer-local-value 'nrepl-project-dir repl)))
(when (or (null proj-dir)
(not (string-prefix-p (file-name-as-directory (file-truename proj-dir))
(file-truename file))))
(setq-local cider--pinned-repl-buffer repl)))))