Function: nrepl-start-server-process

nrepl-start-server-process is a byte-compiled function defined in nrepl-client.el.

Signature

(nrepl-start-server-process DIRECTORY CMD ON-PORT-CALLBACK)

Documentation

Start nREPL server process in DIRECTORY using shell command CMD.

Return a newly created process. Set nrepl-server-filter as the process filter, which starts REPL process with its own buffer once the server has started. ON-PORT-CALLBACK is a function of one argument (server buffer) which is called by the process filter once the port of the connection has been determined.

Source Code

;; Defined in ~/.emacs.d/elpa/cider-20260414.1619/nrepl-client.el
(defun nrepl-start-server-process (directory cmd on-port-callback)
  "Start nREPL server process in DIRECTORY using shell command CMD.
Return a newly created process.  Set `nrepl-server-filter' as the process
filter, which starts REPL process with its own buffer once the server has
started.  ON-PORT-CALLBACK is a function of one argument (server buffer)
which is called by the process filter once the port of the connection has
been determined."
  (let* ((default-directory (or directory default-directory))
         (serv-buf (get-buffer-create
                    (nrepl-server-buffer-name
                     `(:project-dir ,default-directory)))))
    (with-current-buffer serv-buf
      (setq nrepl-is-server t
            nrepl-project-dir default-directory
            nrepl-server-command cmd
            nrepl-on-port-callback on-port-callback))
    (let ((serv-proc (start-file-process-shell-command
                      "nrepl-server" serv-buf cmd)))
      (set-process-filter serv-proc #'nrepl-server-filter)
      (set-process-sentinel serv-proc #'nrepl-server-sentinel)
      (set-process-coding-system serv-proc 'utf-8-unix 'utf-8-unix)
      (message "[nREPL] Starting server via %s"
               (propertize cmd 'face 'font-lock-keyword-face))
      serv-proc)))