Skip to content

Commit cf8d695

Browse files
committed
Shorten over-long docstrings to fit within 80 columns
End users compiling CIDER from MELPA see "docstring wider than 80 characters" warnings because the byte compiler defaults to a 80-col limit (the project's Eldev sets it to 100 internally, which masked these locally). Reword or wrap the offending lines so they're clean for end users too.
1 parent 194c132 commit cf8d695

8 files changed

Lines changed: 19 additions & 15 deletions

File tree

lisp/cider-docstring.el

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,21 +79,22 @@ otherwise, it's included as-is."
7979
""))))
8080

8181
(defcustom cider-docstring-max-lines 20
82-
"The maximum number of docstring lines that will be rendered in a UI widget (or the echo area).
82+
"Maximum number of docstring lines rendered in a UI widget or the echo area.
8383
8484
Note that `cider-docstring' will trim thing smartly, for Java doc comments:
8585
* First, the whole doc comment will be attempted to be rendered.
8686
* If that exceeds `cider-docstring-max-lines',
8787
we will use only the first sentence and the block tags
8888
(that is, the params/throws/returns info).
8989
* If that exceeds `cider-docstring-max-lines', we will use only the block tags.
90-
* If that exceeds `cider-docstring-max-lines', we will use only the first sentence."
90+
* If that exceeds `cider-docstring-max-lines', we will use only the first
91+
sentence."
9192
:type 'integer
9293
:group 'cider
9394
:package-version '(cider . "1.8.0"))
9495

9596
(defun cider--attempt-invalid? (attempt)
96-
"Check if ATTEMPT is either nil or exceeds `cider-docstring-max-lines' in line count."
97+
"Check if ATTEMPT is nil or has more lines than `cider-docstring-max-lines'."
9798
(or (not attempt)
9899
(and attempt
99100
(> (length (split-string attempt "\n"))
@@ -106,7 +107,8 @@ Note that `cider-docstring' will trim thing smartly, for Java doc comments:
106107

107108
(defun cider--render-docstring (eldoc-info)
108109
"Renders the docstring from ELDOC-INFO based on its length and content.
109-
Prioritize rendering as much as possible while staying within `cider-docstring-max-lines'."
110+
Prioritize rendering as much as possible while staying within
111+
`cider-docstring-max-lines'."
110112
(let* ((first-sentence-fragments (cider-plist-get eldoc-info "doc-first-sentence-fragments"))
111113
(body-fragments (cider-plist-get eldoc-info "doc-fragments"))
112114
(block-tags-fragments (cider-plist-get eldoc-info "doc-block-tags-fragments"))

lisp/cider-eval.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,8 @@ Show error overlay in BUFFER if needed."
484484
"A few example values that will match:
485485
\"Reflection warning, /tmp/foo/src/foo/core.clj:14:1 - \"
486486
\"Syntax error compiling at (src/workspace_service.clj:227:3).\"
487-
\"Unexpected error (ClassCastException) macroexpanding defmulti at (src/haystack/parser.cljc:21:1).\"")
487+
\"Unexpected error (ClassCastException) macroexpanding defmulti at
488+
(src/haystack/parser.cljc:21:1).\"")
488489

489490

490491
(defconst cider-module-info-regexp

lisp/cider-find.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ integer on successful finds, nil otherwise."
255255
"Find the namespace of the keyword at point and its primary occurrence there.
256256
257257
For instance - if the keyword at point is \":cider.demo/keyword\", this command
258-
would find the namespace \"cider.demo\" and afterwards find the primary (most relevant or first)
259-
mention of \"::keyword\" there.
258+
would find the namespace \"cider.demo\" and afterwards find the primary
259+
\(most relevant or first) mention of \"::keyword\" there.
260260
261261
Prompt according to prefix ARG and `cider-prompt-for-symbol'.
262262
A single or double prefix argument inverts the meaning of

lisp/cider-inspector.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ current buffer's namespace."
261261
(cider-inspector--render-value result :next-inspectable))))
262262

263263
(defun cider-inspect-expr-from-inspector ()
264-
"Performs `cider-inspect-expr' in a way that is suitable from the Inspector itself.
264+
"Run `cider-inspect-expr' in a way that's suitable from the Inspector itself.
265265
In particular, it does not read `cider-sexp-at-point'."
266266
(interactive)
267267
(let* ((ns (cider-current-ns))

lisp/cider-macroexpansion.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Possible values are:
4242
4343
`qualified' ;=> Vars are fully-qualified in the expansion
4444
`none' ;=> Vars are displayed without namespace qualification
45-
`tidy' ;=> Vars that are :refer-ed or defined in the current namespace are
45+
`tidy' ;=> Vars that are :refer-ed or in the current namespace are
4646
displayed with their simple name, non-referred vars from other
4747
namespaces are referred using the alias for that namespace (if
4848
defined), other vars are displayed fully qualified."

lisp/cider-mode.el

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -648,9 +648,10 @@ that should be font-locked:
648648
`var': Any non-local var gets the `font-lock-variable-name-face'.
649649
`deprecated' (default): Any deprecated var gets the `cider-deprecated-face'
650650
face.
651-
`core' (default): Any symbol from clojure.core/cljs.core. The selected face will depend on type.
652-
Note that while rendering `core', all types of vars (`macro', `function', `var', `deprecated')
653-
will be honored, regardless of the user's customization value.
651+
`core' (default): Any symbol from clojure.core/cljs.core. The selected
652+
face will depend on type. Note that while rendering `core', all types of
653+
vars (`macro', `function', `var', `deprecated') will be honored,
654+
regardless of the user's customization value.
654655
655656
The value can also be t, which means to font-lock as much as possible."
656657
:type '(choice (set :tag "Fine-tune font-locking"

lisp/cider-repl.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1773,7 +1773,7 @@ constructs."
17731773
17741774
The checking is done as follows:
17751775
1776-
* If the current buffer's name equals to the value of `cider-test-report-buffer',
1776+
* If the current buffer's name equals the value of `cider-test-report-buffer',
17771777
only accept the given session's repl if it equals `cider-test--current-repl'
17781778
* Consider if the buffer belongs to `cider-ancillary-buffers'
17791779
* Consider the buffer's filename, strip any Docker/TRAMP details from it

lisp/cider.el

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,8 +1422,8 @@ These are used as arguments to the commands `cider-connect-clj',
14221422
the corresponding user prompts.
14231423
14241424
This defcustom is intended for use with .dir-locals.el on a per-project basis.
1425-
See `cider-connect-default-cljs-params' in order to specify a separate set of params
1426-
for cljs REPL connections.
1425+
See `cider-connect-default-cljs-params' in order to specify a separate set
1426+
of params for cljs REPL connections.
14271427
14281428
Note: it is recommended to set the variable `cider-default-cljs-repl'
14291429
instead of specifying the :cljs-repl-type key."

0 commit comments

Comments
 (0)