File: nrepl-client.el.html

Provides an Emacs Lisp client to connect to Clojure nREPL servers.

A connection is an abstract idea of the communication between Emacs (client) and nREPL server. On the Emacs side connections are represented by two running processes. The two processes are the server process and client process (the connection to the server). Each of these is represented by its own process buffer, filter and sentinel.

The nREPL communication process can be broadly represented as follows:

   1) The server process is started as an Emacs subprocess (usually by
      cider-jack-in, which in turn fires up an nREPL server). Note that
      if a connection was established using cider-connect there won't be
      a server process.

   2) The server's process filter (nrepl-server-filter) detects the
      connection port from the first plain text response from the server and
      starts a communication process (socket connection) as another Emacs
      subprocess. This is the nREPL client process (nrepl-client-filter).
      All requests and responses handling happens through this client
      connection.

   3) Requests are sent by nrepl-send-request and
      nrepl-send-sync-request. A request is simply a list containing a
      requested operation name and the parameters required by the
      operation. Each request has an associated callback that is called once
      the response for the request has arrived. Besides the above functions
      there are specialized request senders for each type of common
      operations. Examples are nrepl-request:eval, nrepl-request:clone,
      nrepl-sync-request:describe.

   4) Responses from the server are decoded in nrepl-client-filter and are
      physically represented by alists whose structure depends on the type of
      the response. After having been decoded, the data from the response is
      passed over to the callback that was registered by the original
      request.

Please see the comments in dedicated sections of this file for more detailed description.

Defined variables (28)

cider-enlighten-modeNon-nil if Cider-Enlighten mode is enabled.
cider-enlighten-mode-hookHook run after entering or leaving ‘cider-enlighten-mode’.
nrepl-auxAuxiliary information received from the describe op.
nrepl-connected-hookList of functions to call when connecting to the nREPL server.
nrepl-disconnected-hookList of functions to call when disconnected from the nREPL server.
nrepl-err-handlerEvaluation error handler.
nrepl-force-ssh-for-remote-hostsIf non-nil, do not attempt a direct connection for remote hosts.
nrepl-hide-special-buffersControl the display of some special buffers in buffer switching commands.
nrepl-last-sync-request-timestampThe time when the last sync request was initiated.
nrepl-last-sync-responseResult of the last sync request.
nrepl-listening-inet-address-regexpA regexp to search an nREPL’s stdout for the address it is listening on.
nrepl-log-messagesIf non-nil, log protocol messages to an nREPL messages buffer.
nrepl-message-buffer-max-sizeMaximum size for the nREPL message buffer.
nrepl-message-buffer-reduce-denominatorDivisor by which to reduce message buffer size.
nrepl-message-colorsColors used in the messages buffer.
nrepl-messages-mode-abbrev-tableAbbrev table for ‘nrepl-messages-mode’.
nrepl-messages-mode-hookHook run after entering ‘nrepl-messages-mode’.
nrepl-messages-mode-mapKeymap for ‘nrepl-messages-mode’.
nrepl-messages-mode-syntax-tableSyntax table for ‘nrepl-messages-mode’.
nrepl-ongoing-sync-requestDynamically bound to t while a sync request is ongoing.
nrepl-opsAvailable nREPL server ops (from describe).
nrepl-request-counterContinuation serial number counter.
nrepl-response-handler-functionsList of functions to call on each nREPL message.
nrepl-sessionCurrent nREPL session id.
nrepl-sync-request-timeoutThe number of seconds to wait for a sync response.
nrepl-tooling-sessionCurrent nREPL tooling session id.
nrepl-use-ssh-fallback-for-remote-hostsIf non-nil, Use ssh as a fallback to connect to remote hosts.
nrepl-versionsVersion information received from the describe op.

Defined functions (86)

cider--process-plist-put(PROC PROP VAL)
cider-enlighten-mode(&optional ARG)
copy-nrepl-response-queue(ARG)
emacs-bug-46284/when-27.1-windows-nt(&rest BODY)
nrepl--bdecode-1(&optional STACK)
nrepl--bdecode-list(&optional STACK)
nrepl--bdecode-message(&optional STACK)
nrepl--bencode-dict(DICT)
nrepl--clear-client-sessions(CONN-BUFFER)
nrepl--direct-connect(HOST PORT &optional NO-ERROR)
nrepl--dispatch-response(RESPONSE)
nrepl--ensure-fundamental-mode()
nrepl--eval-request(INPUT &optional NS LINE COLUMN)
nrepl--init-capabilities(CONN-BUFFER)
nrepl--init-client-sessions(CLIENT)
nrepl--kill-process(PROC)
nrepl--make-hidden-name(BUFFER-NAME)
nrepl--mark-id-completed(ID)
nrepl--maybe-kill-server-buffer(SERVER-BUF)
nrepl--port-from-file(FILE)
nrepl--port-string-to-number(S)
nrepl--ssh-file-name-matches-host-p(FILE-NAME HOST)
nrepl--ssh-tunnel-command(SSH DIR PORT)
nrepl--ssh-tunnel-connect(HOST PORT)
nrepl--ssh-tunnel-filter(PORT)
nrepl--unix-connect(SOCKET-FILE &optional NO-ERROR)
nrepl-aux-info(KEY CONNECTION)
nrepl-bdecode(STRING-Q &optional RESPONSE-Q)
nrepl-bencode(OBJECT)
nrepl-client-filter(PROC STRING)
nrepl-client-sentinel(PROCESS MESSAGE)
nrepl-connect(HOST PORT)
nrepl-decorate-msg(MSG TYPE)
nrepl-error-buffer()
nrepl-extract-ports(DIR)
nrepl-kill-server-buffer(SERVER-BUF)
nrepl-local-host-p(HOST)
nrepl-log--expand-button-mouse(EVENT)
nrepl-log--message-color(ID)
nrepl-log--pp-listlike(OBJECT &optional FOREGROUND BUTTON)
nrepl-log-error(MSG)
nrepl-log-expand-all-buttons()
nrepl-log-expand-button(&optional BUTTON)
nrepl-log-insert-button(LABEL OBJECT)
nrepl-log-message(MSG TYPE)
nrepl-log-pp-object(OBJECT &optional FOREGROUND BUTTON)
nrepl-make-buffer-name(TEMPLATE PARAMS &optional DUP-OK)
nrepl-make-response-handler(BUFFER VALUE-HANDLER STDOUT-HANDLER STDERR-HANDLER DONE-HANDLER &optional EVAL-ERROR-HANDLER CONTENT-TYPE-HANDLER TRUNCATED-HANDLER)
nrepl-messages-buffer(CONN)
nrepl-messages-buffer-name(PARAMS)
nrepl-messages-mode()
nrepl-middleware(CONNECTION)
nrepl-next-request-id(CONNECTION)
nrepl-notify(MSG TYPE)
nrepl-op-supported-p(OP CONNECTION)
nrepl-repl-buffer-name(PARAMS &optional DUP-OK)
nrepl-request:eval(INPUT CALLBACK CONNECTION &optional NS LINE COLUMN ADDITIONAL-PARAMS TOOLING)
nrepl-request:interrupt(PENDING-REQUEST-ID CALLBACK CONNECTION)
nrepl-request:stdin(INPUT CALLBACK CONNECTION)
nrepl-response-queue(&optional ARG1)
nrepl-response-queue--cmacro(CL-WHOLE-ARG &optional STUB)
nrepl-response-queue-head(CL-X)
nrepl-response-queue-head--cmacro(CL-WHOLE-ARG CL-X)
nrepl-response-queue-p(CL-X)
nrepl-response-queue-p--cmacro(CL-WHOLE-ARG CL-X)
nrepl-response-queue-stub(CL-X)
nrepl-response-queue-stub--cmacro(CL-WHOLE-ARG CL-X)
nrepl-response-queue-tail(CL-X)
nrepl-response-queue-tail--cmacro(CL-WHOLE-ARG CL-X)
nrepl-send-request(REQUEST CALLBACK CONNECTION &optional TOOLING)
nrepl-send-sync-request(REQUEST CONNECTION &optional ABORT-ON-INPUT TOOLING CALLBACK)
nrepl-server-buffer-name(PARAMS)
nrepl-server-filter(PROCESS OUTPUT)
nrepl-server-p(BUFFER-OR-PROCESS)
nrepl-server-sentinel(PROCESS EVENT)
nrepl-sessions(CONNECTION)
nrepl-start-client-process(&optional HOST PORT SERVER-PROC BUFFER-BUILDER SOCKET-FILE)
nrepl-start-server-process(DIRECTORY CMD ON-PORT-CALLBACK)
nrepl-sync-request:clone(CONNECTION &optional TOOLING)
nrepl-sync-request:close(CONNECTION)
nrepl-sync-request:describe(CONNECTION)
nrepl-sync-request:eval(INPUT CONNECTION &optional NS TOOLING)
nrepl-sync-request:ls-middleware(CONNECTION)
nrepl-sync-request:ls-sessions(CONNECTION)
nrepl-toggle-message-logging()
nrepl-tunnel-buffer-name(PARAMS)

Defined faces (0)