summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.dir-locals.el2
-rw-r--r--cider-apropos.el22
-rw-r--r--cider-client.el14
-rw-r--r--cider-common.el7
-rw-r--r--cider-debug.el12
-rw-r--r--cider-doc.el2
-rw-r--r--cider-grimoire.el2
-rw-r--r--cider-interaction.el30
-rw-r--r--cider-mode.el6
-rw-r--r--cider-overlays.el4
-rw-r--r--cider-repl.el8
-rw-r--r--cider-selector.el2
-rw-r--r--cider-stacktrace.el6
-rw-r--r--cider-test.el8
-rw-r--r--cider-util.el5
-rw-r--r--cider.el7
-rw-r--r--nrepl-client.el26
17 files changed, 107 insertions, 56 deletions
diff --git a/.dir-locals.el b/.dir-locals.el
index 009ce07a..09c620c3 100644
--- a/.dir-locals.el
+++ b/.dir-locals.el
@@ -7,6 +7,8 @@
(fill-column . 80)
(sentence-end-double-space . t)
(emacs-lisp-docstring-fill-column . 75)
+ (checkdoc-symbol-words . ("top-level" "major-mode" "macroexpand-all" "print-level" "print-length"))
+ (checkdoc-package-keywords-flag)
(checkdoc-arguments-in-order-flag))
(emacs-lisp-mode
(bug-reference-bug-regexp . "#\\(?2:[[:digit:]]+\\)")))
diff --git a/cider-apropos.el b/cider-apropos.el
index ba6637b0..843f75a6 100644
--- a/cider-apropos.el
+++ b/cider-apropos.el
@@ -46,7 +46,14 @@
(cider-doc-lookup (button-get button 'apropos-symbol)))
(defun cider-apropos-summary (query ns docs-p include-private-p case-sensitive-p)
- "Return a short description for the performed apropos search."
+ "Return a short description for the performed apropos search.
+
+QUERY can be a regular expression list of space-separated words
+\(e.g take while) which will be converted to a regular expression
+\(like take.+while) automatically behind the scenes. The search may be
+limited to the namespace NS, and may optionally search doc strings
+\(based on DOCS-P), include private vars (based on INCLUDE-PRIVATE-P),
+and be case-sensitive (based on CASE-SENSITIVE-P)."
(concat (if case-sensitive-p "Case-sensitive " "")
(if docs-p "Documentation " "")
(format "Apropos for %S" query)
@@ -104,8 +111,8 @@
QUERY can also be a list of space-separated words (e.g. take while) which
will be converted to a regular expression (like take.+while) automatically
behind the scenes. The search may be limited to the namespace NS, and may
-optionally search doc strings, include private vars, and be case
-sensitive."
+optionally search doc strings (based on DOCS-P), include private vars
+\(based on PRIVATES-P), and be case-sensitive (based on CASE-SENSITIVE-P)."
(interactive
(cons (read-string "Search for Clojure symbol (a regular expression): ")
(when current-prefix-arg
@@ -146,7 +153,14 @@ sensitive."
;;;###autoload
(defun cider-apropos-select (query &optional ns docs-p privates-p case-sensitive-p)
- "Similar to `cider-apropos', but presents the results in a completing read."
+ "Similar to `cider-apropos', but presents the results in a completing read.
+
+Show all symbols whose names match QUERY, a regular expression.
+QUERY can also be a list of space-separated words (e.g. take while) which
+will be converted to a regular expression (like take.+while) automatically
+behind the scenes. The search may be limited to the namespace NS, and may
+optionally search doc strings (based on DOCS-P), include private vars
+\(based on PRIVATES-P), and be case-sensitive (based on CASE-SENSITIVE-P)."
(interactive
(cons (read-string "Search for Clojure symbol (a regular expression): ")
(when current-prefix-arg
diff --git a/cider-client.el b/cider-client.el
index 4fd27d2a..204d48b0 100644
--- a/cider-client.el
+++ b/cider-client.el
@@ -103,7 +103,7 @@ If the list is empty and buffer-local, return the global value."
(defun cider-make-connection-default (connection-buffer)
"Make the nREPL CONNECTION-BUFFER the default connection.
-Moves CONNECTION-BUFFER to the front of `cider-connections'."
+Moves CONNECTION-BUFFER to the front of variable `cider-connections'."
(interactive (list (if (cider--in-connection-buffer-p)
(current-buffer)
(user-error "Not in a REPL buffer"))))
@@ -115,7 +115,7 @@ Moves CONNECTION-BUFFER to the front of `cider-connections'."
(declare-function cider--close-buffer "cider-interaction")
(defun cider--close-connection-buffer (conn-buffer)
- "Close CONN-BUFFER, removing it from `cider-connections'.
+ "Close CONN-BUFFER, removing it from variable `cider-connections'.
Also close associated REPL and server buffers."
(let ((buffer (get-buffer conn-buffer)))
(setq cider-connections
@@ -147,10 +147,11 @@ followed by any connection at all.
If PROJECT-DIRECTORY is provided act on that project instead.
-Only return nil if `cider-connections' is empty (there are no connections).
+Only return nil if variable `cider-connections' is empty,
+i.e there are no connections.
If more than one connection satisfy a given level of preference, return the
-connection buffer closer to the start of `cider-connections'. This is
+connection buffer closer to the start of variable `cider-connections'. This is
usally the connection that was more recently created, but the order can be
changed. For instance, the function `cider-make-connection-default' can be
used to move a connection to the head of the list, so that it will take
@@ -507,7 +508,7 @@ Do nothing if `cider-show-eval-spinner' is nil."
cider-eval-spinner-delay))))
(defun cider-eval-spinner-handler (eval-buffer original-callback)
- "Return a response handler that stops the spinner and calls ORIGINAL-CALLBACK.
+ "Return a response handler to stop the spinner and call ORIGINAL-CALLBACK.
EVAL-BUFFER is the buffer where the spinner was started."
(lambda (response)
;; buffer still exists and
@@ -1075,7 +1076,8 @@ INPUT, SESSION, and NS are passed to `nrepl--eval-request'."
The request is dispatched via CONNECTION and SESSION.
If NS is non-nil, include it in the request.
RIGHT-MARGIN specifies the maximum column width of the
-pretty-printed result, and is included in the request if non-nil."
+pretty-printed result, and is included in the request if non-nil.
+PPRINT-FN generates the pretty-printed result."
(cider-nrepl-request:eval input callback ns nil nil
(cider--nrepl-pprint-request-plist right-margin pprint-fn)))
(make-obsolete 'cider-nrepl-request:pprint-eval
diff --git a/cider-common.el b/cider-common.el
index 7bd8de51..910024e5 100644
--- a/cider-common.el
+++ b/cider-common.el
@@ -42,9 +42,16 @@ prompt if that throws an error."
:package-version '(cider . "0.9.0"))
(defun cider--should-prompt-for-symbol (&optional invert)
+ "Return the value of the variable `cider-prompt-for-symbol'.
+Optionally invert the value, if INVERT is truthy."
(if invert (not cider-prompt-for-symbol) cider-prompt-for-symbol))
(defun cider-prompt-for-symbol-function (&optional invert)
+ "Prompt for symbol if funcall `cider--should-prompt-for-symbol' is truthy.
+Otherwise attempt to use the symbol at point for the command, and only
+prompt if that throws an error.
+
+INVERT is used to invert the semantics of the function `cider--should-prompt-for-symbol'."
(if (cider--should-prompt-for-symbol invert)
#'cider-read-symbol-name
#'cider-try-symbol-at-point))
diff --git a/cider-debug.el b/cider-debug.el
index 46d94091..8f0b2412 100644
--- a/cider-debug.el
+++ b/cider-debug.el
@@ -100,7 +100,7 @@ configure `cider-debug-prompt' instead."
:package-version '(cider . "0.9.1"))
(defcustom cider-debug-print-level 10
- "print-level for values displayed by the debugger.
+ "The print-level for values displayed by the debugger.
This variable must be set before starting the repl connection."
:type '(choice (const :tag "No limit" nil)
(integer :tag "Max depth" 10))
@@ -108,7 +108,7 @@ This variable must be set before starting the repl connection."
:package-version '(cider . "0.10.0"))
(defcustom cider-debug-print-length 10
- "print-length for values displayed by the debugger.
+ "The print-length for values displayed by the debugger.
This variable must be set before starting the repl connection."
:type '(choice (const :tag "No limit" nil)
(integer :tag "Max depth" 10))
@@ -136,7 +136,7 @@ This variable must be set before starting the repl connection."
(message "No currently instrumented definitions")))
(defun cider--debug-response-handler (response)
- "Handle responses from the cider.debug middleware."
+ "Handles RESPONSE from the cider.debug middleware."
(nrepl-dbind-response response (status id causes)
(when (member "enlighten" status)
(cider--handle-enlighten response))
@@ -307,7 +307,7 @@ In order to work properly, this mode must be activated by
(add-hook 'kill-buffer-hook #'cider--debug-quit nil 'local)
(add-hook 'before-revert-hook #'cider--debug-quit nil 'local)
(unless (consp input-type)
- (error "debug-mode activated on a message not asking for commands: %s" cider--debug-mode-response))
+ (error "Activated debug-mode on a message not asking for commands: %s" cider--debug-mode-response))
;; Integrate with eval commands.
(setq cider-interactive-eval-override
(apply-partially #'cider--debug-lexical-eval
@@ -348,7 +348,7 @@ In order to work properly, this mode must be activated by
(define-key cider--debug-mode-map "h" #'cider-debug-move-here)
(defun cider--debug-remove-overlays (&optional buffer)
- "Remove CIDER debug overlays from BUFFER if `cider--debug-mode' is nil."
+ "Remove CIDER debug overlays from BUFFER if variable `cider--debug-mode' is nil."
(when (or (not buffer) (buffer-live-p buffer))
(with-current-buffer (or buffer (current-buffer))
(unless cider--debug-mode
@@ -418,6 +418,8 @@ message."
(defconst cider--debug-buffer-format "*cider-debug %s*")
(defun cider--debug-trim-code (code)
+ "Remove whitespace and reader macros from the start of the CODE.
+Return trimmed CODE."
(replace-regexp-in-string "\\`#[a-z]+[\n\r[:blank:]]*" "" code))
(declare-function cider-set-buffer-ns "cider-mode")
diff --git a/cider-doc.el b/cider-doc.el
index ee6ac5d3..9ca67bc8 100644
--- a/cider-doc.el
+++ b/cider-doc.el
@@ -229,6 +229,7 @@ opposite of what that option dictates."
(declare-function cider-grimoire-lookup "cider-grimoire")
(defun cider-docview-grimoire ()
+ "Return the grimoire documentation for `cider-docview-symbol'."
(interactive)
(if cider-buffer-ns
(cider-grimoire-lookup cider-docview-symbol)
@@ -237,6 +238,7 @@ opposite of what that option dictates."
(declare-function cider-grimoire-web-lookup "cider-grimoire")
(defun cider-docview-grimoire-web ()
+ "Open the grimoire documentation for `cider-docview-symbol' in a web browser."
(interactive)
(if cider-buffer-ns
(cider-grimoire-web-lookup cider-docview-symbol)
diff --git a/cider-grimoire.el b/cider-grimoire.el
index e0d246ad..3e9f1160 100644
--- a/cider-grimoire.el
+++ b/cider-grimoire.el
@@ -53,7 +53,7 @@
(concat base-url "search/v0/" ns "/" (cider-grimoire-replace-special name) "/"))))
(defun cider-grimoire-web-lookup (symbol)
- "Look up the grimoire documentation for SYMBOL."
+ "Open the grimoire documentation for SYMBOL in a web browser."
(if-let ((var-info (cider-var-info symbol)))
(let ((name (nrepl-dict-get var-info "name"))
(ns (nrepl-dict-get var-info "ns")))
diff --git a/cider-interaction.el b/cider-interaction.el
index 0781dd21..a632230a 100644
--- a/cider-interaction.el
+++ b/cider-interaction.el
@@ -73,8 +73,11 @@ navigate to this buffer."
:group 'cider)
(defcustom cider-auto-jump-to-error t
- "When non-nil automatically jump to error location during interactive compilation.
-When set to 'errors-only, don't jump to warnings."
+ "Control the cursor jump behaviour in compilation error buffer.
+
+When non-nil automatically jump to error location during interactive
+compilation. When set to 'errors-only, don't jump to warnings.
+When set to nil, don't jump at all."
:type '(choice (const :tag "always" t)
(const errors-only)
(const :tag "never" nil))
@@ -433,6 +436,8 @@ Invert meaning of `cider-prompt-for-symbol' if PREFIX indicates it should be."
(nrepl-dict-get "path")))
(defun cider--find-ns (ns &optional other-window)
+ "Find the file containing NS's definition.
+Optionally open it in a different window if OTHER-WINDOW is truthy."
(if-let ((path (cider-sync-request:ns-path ns)))
(cider-jump-to (cider-find-file path) nil other-window)
(user-error "Can't find %s" ns)))
@@ -608,8 +613,9 @@ The handler simply inserts the result value in BUFFER."
(defun cider--emit-interactive-eval-output (output repl-emit-function)
"Emit output resulting from interactive code evaluation.
-The output can be send to either a dedicated output buffer or the current REPL buffer.
-This is controlled via `cider-interactive-eval-output-destination'."
+The OUTPUT can be sent to either a dedicated output buffer or the current
+REPL buffer. This is controlled by `cider-interactive-eval-output-destination'.
+REPL-EMIT-FUNCTION emits the OUTPUT."
(pcase cider-interactive-eval-output-destination
(`output-buffer (let ((output-buffer (or (get-buffer cider-output-buffer)
(cider-popup-buffer cider-output-buffer t))))
@@ -732,7 +738,6 @@ Returns the position at which PROPERTY was found, or nil if not found."
(defun cider-jump-to-compilation-error (&optional _arg _reset)
"Jump to the line causing the current compilation error.
-
_ARG and _RESET are ignored, as there is only ever one compilation error.
They exist for compatibility with `next-error'."
(interactive)
@@ -1218,6 +1223,7 @@ If invoked with a prefix ARG eval the expression after inserting it."
(defun cider-insert-region-in-repl (start end &optional arg)
"Insert the curent region in the REPL buffer.
+START and END represent the region's boundaries.
If invoked with a prefix ARG eval the expression after inserting it."
(interactive "rP")
(cider-insert-in-repl
@@ -1239,7 +1245,7 @@ If invoked with a prefix ARG eval the expression after inserting it."
(defun cider-enable-on-existing-clojure-buffers ()
"Enable CIDER's minor mode on existing Clojure buffers.
-See command `cider-mode'."
+See `cider-mode'."
(interactive)
(add-hook 'clojure-mode-hook #'cider-mode)
(dolist (buffer (cider-util--clojure-buffers))
@@ -1248,7 +1254,7 @@ See command `cider-mode'."
(defun cider-disable-on-existing-clojure-buffers ()
"Disable `cider-mode' on existing Clojure buffers.
-See command `cider-mode'."
+See `cider-mode'."
(interactive)
(dolist (buffer (cider-util--clojure-buffers))
(with-current-buffer buffer
@@ -1512,8 +1518,8 @@ of the buffer into a formatted string."
(defun cider--format-region (start end formatter)
"Format the contents of the given region.
-START and END are the character positions of the start and end of the
-region. FORMATTER is a function of one argument which is used to convert
+START and END represent the region's boundaries.
+FORMATTER is a function of one argument which is used to convert
the string contents of the region into a formatted string."
(let* ((original (buffer-substring-no-properties start end))
(formatted (funcall formatter original))
@@ -1523,13 +1529,15 @@ the string contents of the region into a formatted string."
(insert indented))))
(defun cider-format-region (start end)
- "Format the Clojure code in the current region."
+ "Format the Clojure code in the current region.
+START and END represent the region's boundaries."
(interactive "r")
(cider-ensure-connected)
(cider--format-region start end #'cider-sync-request:format-code))
(defun cider-format-edn-region (start end)
- "Format the EDN data in the current region."
+ "Format the EDN data in the current region.
+START and END represent the region's boundaries."
(interactive "r")
(cider-ensure-connected)
(let* ((start-column (save-excursion (goto-char start) (current-column)))
diff --git a/cider-mode.el b/cider-mode.el
index 8ead245d..a01d7737 100644
--- a/cider-mode.el
+++ b/cider-mode.el
@@ -376,7 +376,7 @@ The value can also be t, which means to font-lock as much as possible."
value))
(defun cider--compile-font-lock-keywords (symbols-plist core-plist)
- "Return a list of font-lock rules for the symbols in SYMBOLS-PLIST."
+ "Return a list of font-lock rules for the symbols in SYMBOLS-PLIST and CORE-PLIST."
(let ((cider-font-lock-dynamically (if (eq cider-font-lock-dynamically t)
'(function var macro core deprecated)
cider-font-lock-dynamically))
@@ -401,7 +401,7 @@ The value can also be t, which means to font-lock as much as possible."
;; we catch that case too.
;; FIXME: This matches values too, not just keys.
(when (seq-find (lambda (k) (and (stringp k)
- (string-match (rx "clojure.tools.trace/traced" eos) k)))
+ (string-match (rx "clojure.tools.trace/traced" eos) k)))
meta)
(push sym traced))
(when (and do-deprecated (nrepl-dict-get meta "deprecated"))
@@ -586,7 +586,7 @@ before point."
(cider--parse-and-apply-locals end locals-above))))))
(defun cider--wrap-fontify-locals (func)
- "Return a function that calls FUNC after parsing local variables.
+ "Return a function that will call FUNC after parsing local variables.
The local variables are stored in a list under the `cider-locals' text
property."
(lambda (beg end &rest rest)
diff --git a/cider-overlays.el b/cider-overlays.el
index 56720152..1686ad86 100644
--- a/cider-overlays.el
+++ b/cider-overlays.el
@@ -255,8 +255,8 @@ focused."
(defun cider--overlay-destroy (ov &rest r)
"Delete overlay OV and its underlying text.
-If any other arguments are given, only actually do anything if the first
-one is non-nil. This is so it works in `modification-hooks'."
+If any other arguments are given (collected in R), only actually do anything
+if the first one is non-nil. This is so it works in `modification-hooks'."
(unless (and r (not (car r)))
(let ((inhibit-modification-hooks t)
(beg (copy-marker (overlay-start ov)))
diff --git a/cider-repl.el b/cider-repl.el
index 9a68e621..703464e7 100644
--- a/cider-repl.el
+++ b/cider-repl.el
@@ -425,12 +425,16 @@ If BACKWARD is non-nil search backward."
(set-marker cider-repl-output-end (point)))
(defun cider-repl-mode-beginning-of-defun (&optional arg)
+ "Move to the beginning of defun.
+If given a negative value of ARG, move to the end of defun."
(if (and arg (< arg 0))
(cider-repl-mode-end-of-defun (- arg))
(dotimes (_ (or arg 1))
(cider-repl-previous-prompt))))
(defun cider-repl-mode-end-of-defun (&optional arg)
+ "Move to the end of defun.
+If given a negative value of ARG, move to the beginning of defun."
(if (and arg (< arg 0))
(cider-repl-mode-beginning-of-defun (- arg))
(dotimes (_ (or arg 1))
@@ -1204,7 +1208,7 @@ constructs."
(let ((command-func (gethash command cider-repl-shortcuts)))
(if command-func
(call-interactively (gethash command cider-repl-shortcuts))
- (error "Unknown command %S. Available commands: %s"
+ (error "Unknown command %S. Available commands: %s"
command-func
(mapconcat 'identity (cider-repl--available-shortcuts) ", "))))
(error "No command selected")))))
@@ -1328,7 +1332,7 @@ constructs."
map))
(defun cider-repl-wrap-fontify-function (func)
- "Return a function that calls FUNC narrowed to input region."
+ "Return a function that will call FUNC narrowed to input region."
(lambda (beg end &rest rest)
(when (and cider-repl-input-start-mark
(> end cider-repl-input-start-mark))
diff --git a/cider-selector.el b/cider-selector.el
index fdd068b4..256176b8 100644
--- a/cider-selector.el
+++ b/cider-selector.el
@@ -46,7 +46,7 @@ DESCRIPTION is a one-line description of what the key selects.")
"If non-nil use `switch-to-buffer-other-window'.")
(defun cider--recently-visited-buffer (mode)
- "Return the most recently visited buffer whose `major-mode' is derived from MODE.
+ "Return the most recently visited buffer, deriving its `major-mode' from MODE.
Only considers buffers that are not already visible."
(cl-loop for buffer in (buffer-list)
when (and (with-current-buffer buffer
diff --git a/cider-stacktrace.el b/cider-stacktrace.el
index b3fa67ee..224d71ca 100644
--- a/cider-stacktrace.el
+++ b/cider-stacktrace.el
@@ -356,7 +356,7 @@ suppressed error type."
(defun cider-stacktrace-cycle-cause (num &optional level)
"Update element NUM of `cider-stacktrace-cause-visibility', optionally to LEVEL.
-If LEVEL is not specified, its current value is incremented. When it reaches 3,
+If LEVEL is not specified, its current value is incremented. When it reaches 3,
it wraps to 0."
(let ((level (or level (1+ (elt cider-stacktrace-cause-visibility num)))))
(aset cider-stacktrace-cause-visibility num (mod level 3))
@@ -505,7 +505,9 @@ Achieved by destructively manipulating the `cider-stacktrace-suppressed-errors'
(back-to-indentation)))
(defun cider-stacktrace-jump (&optional arg)
- "Like `cider-find-var', but uses the stack frame source at point, if available."
+ "Find definition for stack frame at point, if available.
+The prefix ARG and `cider-prompt-for-symbol' decide whether to
+prompt and whether to use a new window. Similar to `cider-find-var'."
(interactive "P")
(let ((button (button-at (point))))
(if (and button (button-get button 'line))
diff --git a/cider-test.el b/cider-test.el
index 86904bf4..6edc03b1 100644
--- a/cider-test.el
+++ b/cider-test.el
@@ -212,7 +212,9 @@
(goto-char pos))))))
(defun cider-test-jump (&optional arg)
- "Like `cider-find-var', but uses the test at point's definition, if available."
+ "Find definition for test at point, if available.
+The prefix ARG and `cider-prompt-for-symbol' decide whether to
+prompt and whether to use a new window. Similar to `cider-find-var'."
(interactive "P")
(let ((ns (get-text-property (point) 'ns))
(var (get-text-property (point) 'var))
@@ -469,8 +471,8 @@ The optional arg TEST denotes an individual test name."
(overlay-put overlay 'actual actual))))))))
(defun cider-find-var-file (ns var)
- "Return the buffer visiting the file in which the NS VAR is defined, or nil if
-not found."
+ "Return the buffer visiting the file in which the NS VAR is defined.
+Or nil if not found."
(cider-ensure-op-supported "info")
(when-let ((info (cider-var-info (concat ns "/" var)))
(file (nrepl-dict-get info "file")))
diff --git a/cider-util.el b/cider-util.el
index d0192cdb..6020a1e5 100644
--- a/cider-util.el
+++ b/cider-util.el
@@ -178,7 +178,7 @@ Can only error if SKIP is non-nil."
(cons (pop plist) (cider-intern-keys plist)))))
(defmacro cider-propertize-region (props &rest body)
- "Execute BODY and add PROPS to all the text it inserts.
+ "Execute BODY and add PROPS to all the inserted text.
More precisely, PROPS are added to the region between the point's
positions before and after executing BODY."
(declare (indent 1))
@@ -561,7 +561,8 @@ Any other value is just returned."
(message (cider-random-tip)))
(defun cider-column-number-at-pos (pos)
- "Analog to `line-number-at-pos'."
+ "Analog to `line-number-at-pos'.
+Return buffer column number at position POS."
(save-excursion (goto-char pos) (current-column)))
(defun cider-propertize (text kind)
diff --git a/cider.el b/cider.el
index 39a56918..6b9d958e 100644
--- a/cider.el
+++ b/cider.el
@@ -181,7 +181,8 @@ This variable is used by `cider-connect'."
(defvar cider-ps-running-nrepl-path-regexp-list
'("\\(?:leiningen.original.pwd=\\)\\(.+?\\) -D"
"\\(?:-classpath +:?\\(.+?\\)/self-installs\\)")
- "Regexp list to extract project paths from output of `cider-ps-running-nrepls-command'.
+ "Regexp list to get project paths.
+Extract project paths from output of `cider-ps-running-nrepls-command'.
Sub-match 1 must be the project path.")
(defvar cider-host-history nil
@@ -244,6 +245,7 @@ string is quoted for passing as argument to an inferior shell."
(concat "-d " (shell-quote-argument (format "%s:%s" (car list) (cadr list)))))
(defun boot-command-prefix (dependencies)
+ "Return a list of boot artifact strings created from DEPENDENCIES."
(concat (mapconcat #'cider--list-as-boot-artifact dependencies " ")
" "))
@@ -606,7 +608,8 @@ In case `default-directory' is non-local we assume the command is available."
cider-required-nrepl-version)))
(defun cider--check-middleware-compatibility-callback (buffer)
- "A callback to check if the middleware used is compatible with CIDER."
+ "A callback to check if the middleware used is compatible with CIDER.
+BUFFER specifies the connection buffer to be used."
(nrepl-make-response-handler
buffer
(lambda (_buffer result)
diff --git a/nrepl-client.el b/nrepl-client.el
index e1e8f05a..92ea5555 100644
--- a/nrepl-client.el
+++ b/nrepl-client.el
@@ -393,7 +393,8 @@ also alway return a sequence (since the result will be flattened)."
String values for non \"id\" and \"session\" keys are concatenated. Lists
are appended. nREPL dicts merged recursively. All other objects are
accumulated into a list. DICT1 is modified destructively and
-then returned."
+then returned.
+If NO-JOIN is given, return the first non nil dict."
(if no-join
(or dict1 dict2)
(cond ((null dict1) dict2)
@@ -610,15 +611,15 @@ older requests with \"done\" status."
(gethash id nrepl-completed-requests))))
(if callback
(funcall callback response)
- (error "nREPL: No response handler with id %s found" id)))))
+ (error "[nREPL] No response handler with id %s found" id)))))
(defun nrepl-client-sentinel (process message)
"Handle sentinel events from PROCESS.
Notify MESSAGE and if the process is closed run `nrepl-disconnected-hook'
and kill the process buffer."
(if (string-match "deleted\\b" message)
- (message "nREPL: Connection closed")
- (message "nREPL: Connection closed unexpectedly (%s)"
+ (message "[nREPL] Connection closed")
+ (message "[nREPL] Connection closed unexpectedly (%s)"
(substring message 0 -1)))
(when (equal (process-status process) 'closed)
(when-let ((client-buffer (process-buffer process)))
@@ -656,21 +657,21 @@ If NO-ERROR is non-nil, show messages instead of throwing an error."
(if (not (and host port))
(unless no-error
(error "Host (%s) and port (%s) must be provided" host port))
- (message "nREPL: Establishing direct connection to %s:%s ..." host port)
+ (message "[nREPL] Establishing direct connection to %s:%s ..." host port)
(condition-case nil
(prog1 (list :proc (open-network-stream "nrepl-connection" nil host port)
:host host :port port)
- (message "nREPL: Direct connection established"))
- (error (let ((mes "nREPL: Direct connection failed"))
+ (message "[nREPL] Direct connection established"))
+ (error (let ((mes "[nREPL] Direct connection failed"))
(if no-error (message mes) (error mes))
nil)))))
(defun nrepl--ssh-tunnel-connect (host port)
"Connect to a remote machine identified by HOST and PORT through SSH tunnel."
- (message "nREPL: Establishing SSH tunneled connection ...")
+ (message "[nREPL] Establishing SSH tunneled connection ...")
(let* ((remote-dir (if host (format "/ssh:%s:" host) default-directory))
(ssh (or (executable-find "ssh")
- (error "nREPL: Cannot locate 'ssh' executable")))
+ (error "[nREPL] Cannot locate 'ssh' executable")))
(cmd (nrepl--ssh-tunnel-command ssh remote-dir port))
(tunnel-buf (nrepl-tunnel-buffer-name))
(tunnel (start-process-shell-command "nrepl-tunnel" tunnel-buf cmd)))
@@ -680,8 +681,8 @@ If NO-ERROR is non-nil, show messages instead of throwing an error."
(process-get tunnel :waiting-for-port))
(accept-process-output nil 0.005))
(if (not (process-live-p tunnel))
- (error "nREPL: SSH port forwarding failed. Check the '%s' buffer" tunnel-buf)
- (message "nREPL: SSH port forwarding established to localhost:%s" port)
+ (error "[nREPL] SSH port forwarding failed. Check the '%s' buffer" tunnel-buf)
+ (message "[nREPL] SSH port forwarding established to localhost:%s" port)
(let ((endpoint (nrepl--direct-connect "localhost" port)))
(thread-first endpoint
(plist-put :tunnel tunnel)
@@ -1246,7 +1247,8 @@ Set this to nil to prevent truncation."
(delete-overlay button))
(defun nrepl--expand-button-mouse (event)
- "Expand the text hidden under overlay BUTTON."
+ "Expand the text hidden under overlay button.
+EVENT gives the button position on window."
(interactive "e")
(pcase (elt event 1)
(`(,window ,_ ,_ ,_ ,_ ,point . ,_)