Skip to content

Commit

Permalink
Fix checkdoc errors
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongtx committed Jul 22, 2017
1 parent d24228f commit 2617617
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 17 deletions.
9 changes: 6 additions & 3 deletions cider-client.el
Original file line number Diff line number Diff line change
Expand Up @@ -976,22 +976,25 @@ CONTEXT represents a completion context for compliment."
eldoc)))

(defun cider-sync-request:spec-list (&optional filter-regex)
"Get a list of the available specs in the registry."
"Get a list of the available specs in the registry.
Optional argument FILTER-REGEX filters specs. By default, all specs are
returned."
(setq filter-regex (or filter-regex ""))
(thread-first `("op" "spec-list"
"filter-regex" ,filter-regex)
(cider-nrepl-send-sync-request)
(nrepl-dict-get "spec-list")))

(defun cider-sync-request:spec-form (spec)
"Get spec form from registry"
"Get SPEC's form from registry."
(thread-first `("op" "spec-form"
"spec-name" ,spec)
(cider-nrepl-send-sync-request)
(nrepl-dict-get "spec-form")))

(defun cider-sync-request:spec-example (spec)
"Get a spec example"
"Get an example for SPEC."
(thread-first `("op" "spec-example"
"spec-name" ,spec)
(cider-nrepl-send-sync-request)
Expand Down
11 changes: 5 additions & 6 deletions cider-interaction.el
Original file line number Diff line number Diff line change
Expand Up @@ -1068,8 +1068,8 @@ evaluation command. Honor `cider-auto-jump-to-error'."
(defun cider--prep-interactive-eval (form connection)
"Prepare the environment for an interactive eval of FORM in CONNECTION.
Ensure the current ns declaration has been evaluated (so that the ns
containing FORM exists). Cache ns-form in the current buffer unless FORM is
ns declaration itself. Clear any compilation highlights and kill the error
containing FORM exists). Cache ns-form in the current buffer unless FORM is
ns declaration itself. Clear any compilation highlights and kill the error
window."
(cider--clear-compilation-highlights)
(cider--quit-error-window)
Expand Down Expand Up @@ -1366,23 +1366,22 @@ 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 `cider-mode'."
See command `cider-mode'."
(interactive)
(add-hook 'clojure-mode-hook #'cider-mode)
(dolist (buffer (cider-util--clojure-buffers))
(with-current-buffer buffer
(cider-mode +1))))

(defun cider-disable-on-existing-clojure-buffers ()
"Disable `cider-mode' on existing Clojure buffers.
See `cider-mode'."
"Disable command `cider-mode' on existing Clojure buffers."
(interactive)
(dolist (buffer (cider-util--clojure-buffers))
(with-current-buffer buffer
(cider-mode -1))))

(defun cider-possibly-disable-on-existing-clojure-buffers ()
"If not connected, disable `cider-mode' on existing Clojure buffers."
"If not connected, disable command `cider-mode' on existing Clojure buffers."
(unless (cider-connected-p)
(cider-disable-on-existing-clojure-buffers)))

Expand Down
2 changes: 1 addition & 1 deletion cider-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ that of the namespace in the Clojure source buffer."

(defun cider-switch-to-repl-buffer (&optional set-namespace)
"Select the REPL buffer, when possible in an existing window.
The buffer chosen is based on the file open in the current buffer. If
The buffer chosen is based on the file open in the current buffer. If
multiple REPL buffers are associated with current connection the most
recent is used.
Expand Down
20 changes: 14 additions & 6 deletions cider-stacktrace.el
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,19 @@ The error types are represented as strings."

(defvar cider-stacktrace--all-negative-filters
'(clj tooling dup java repl)
"Filters that remove stackframes")
"Filters that remove stackframes.")

(defvar cider-stacktrace--all-positive-filters
'(project)
"Filters that ensure stackframes are shown")
"Filters that ensure stackframes are shown.")

(defun cider-stacktrace--face-for-filter (filter neg-filters pos-filters)
"Return whether we should mark the filter is active or not."
"Return whether we should mark the FILTER is active or not.
NEG-FILTERS and POS-FILTERS are lists of filters to check FILTER's type.
NEG-FILTERS dictate which frames should be hidden while POS-FILTERS can
override this and ensure that those frames are shown."
(cond ((member filter cider-stacktrace--all-negative-filters)
(if (member filter neg-filters)
'cider-stacktrace-filter-active-face
Expand All @@ -273,7 +278,7 @@ The error types are represented as strings."
Find buttons with a 'filter property; if filter is a member of FILTERS, or
if filter is nil ('show all') and the argument list is non-nil, fontify the
button as disabled. Upon finding text with a 'hidden-count property, stop
searching and update the hidden count text. POS-FILTERS is the list of
searching and update the hidden count text. POS-FILTERS is the list of
positive filters to always include."
(with-current-buffer cider-error-buffer
(save-excursion
Expand Down Expand Up @@ -606,7 +611,10 @@ prompt and whether to use a new window. Similar to `cider-find-var'."
(fill-region beg (point)))))

(defun cider-stacktrace-render-filters (buffer special-filters filters)
"Emit into BUFFER toggle buttons for each of the FILTERS."
"Emit into BUFFER toggle buttons for each of the FILTERS.
SPECIAL-FILTERS are filters that show stack certain stack frames, hiding
others."
(with-current-buffer buffer
(insert " Show: ")
(dolist (filter special-filters)
Expand All @@ -627,7 +635,7 @@ prompt and whether to use a new window. Similar to `cider-find-var'."
'help-echo (format "Toggle %s stack frames"
(car filter)))
(insert " "))

(let ((hidden "(0 frames hidden)"))
(put-text-property 0 (length hidden) 'hidden-count t hidden)
(insert " " hidden "\n"))))
Expand Down
5 changes: 4 additions & 1 deletion cider-util.el
Original file line number Diff line number Diff line change
Expand Up @@ -475,7 +475,10 @@ the buffer."

;; Taken from: https://github.com/emacs-mirror/emacs/blob/65c8c7cb96c14f9c6accd03cc8851b5a3459049e/lisp/help-mode.el#L551-L565
(defun cider--make-back-forward-xrefs (&optional buffer)
"Insert special references `back' and `forward', as in `help-make-xrefs'"
"Insert special references `back' and `forward', as in `help-make-xrefs'.
Optional argument BUFFER is the buffer in which to insert references.
Default is current buffer."
(with-current-buffer (or buffer (current-buffer))
(insert "\n")
(when (or help-xref-stack help-xref-forward-stack)
Expand Down

0 comments on commit 2617617

Please sign in to comment.