Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reindent #3723

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cider-browse-ns.el
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,10 @@ list of items."
(let* ((max-length (cider-browse-ns--column-width items)))
(cl-labels
((keys-from-pred
(pred items)
(nrepl-dict-keys (nrepl-dict-filter (lambda (_ var-meta)
(funcall pred var-meta))
items))))
(pred items)
(nrepl-dict-keys (nrepl-dict-filter (lambda (_ var-meta)
(funcall pred var-meta))
items))))
(cond
((eql cider-browse-ns-group-by 'type)
(let* ((func-keys (keys-from-pred #'cider-browse-ns--meta-function-p items))
Expand Down
8 changes: 4 additions & 4 deletions cider-doc.el
Original file line number Diff line number Diff line change
Expand Up @@ -447,10 +447,10 @@ in a COMPACT format is specified, FOR-TOOLTIP if specified."
(cider--help-setup-xref (list #'cider-doc-lookup (format "%s/%s" ns name)) nil buffer)
(with-current-buffer buffer
(cl-flet ((emit (text &optional face sep)
(insert (if face
(propertize text 'font-lock-face face)
text)
(or sep "\n"))))
(insert (if face
(propertize text 'font-lock-face face)
text)
(or sep "\n"))))
(emit (if class java-name clj-name) 'font-lock-function-name-face)
(when super
(emit (concat "Extends: " (cider-font-lock-as 'java-mode super))))
Expand Down
12 changes: 6 additions & 6 deletions cider-eval.el
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,12 @@ _ARG and _RESET are ignored, as there is only ever one compilation error.
They exist for compatibility with `next-error'."
(interactive)
(cl-labels ((goto-next-note-boundary
()
(let ((p (or (cider-find-property 'cider-note-p)
(cider-find-property 'cider-note-p t))))
(when p
(goto-char p)
(message "%s" (get-char-property p 'cider-note))))))
()
(let ((p (or (cider-find-property 'cider-note-p)
(cider-find-property 'cider-note-p t))))
(when p
(goto-char p)
(message "%s" (get-char-property p 'cider-note))))))
;; if we're already on a compilation error, first jump to the end of
;; it, so that we find the next error.
(when (get-char-property (point) 'cider-note-p)
Expand Down
68 changes: 34 additions & 34 deletions cider-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -789,40 +789,40 @@ with the given LIMIT."
deprecated enlightened
macros functions vars instrumented traced)
(cl-labels ((handle-plist
(plist)
;; Note that (memq 'function cider-font-lock-dynamically) and similar statements are evaluated differently
;; for `core' - they're always truthy for `core' (see related core-handling code some lines below):
(let ((do-function (memq 'function cider-font-lock-dynamically))
(do-var (memq 'var cider-font-lock-dynamically))
(do-macro (memq 'macro cider-font-lock-dynamically))
(do-deprecated (memq 'deprecated cider-font-lock-dynamically)))
(while plist
(let ((sym (pop plist))
(meta (pop plist)))
(pcase (nrepl-dict-get meta "cider/instrumented")
(`nil nil)
(`"\"breakpoint-if-interesting\""
(push sym instrumented))
(`"\"light-form\""
(push sym enlightened)))
;; The ::traced keywords can be inlined by MrAnderson, so
;; 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)))
meta)
(push sym traced))
(when (and do-deprecated (nrepl-dict-get meta "deprecated"))
(push sym deprecated))
(let ((is-macro (nrepl-dict-get meta "macro"))
(is-function (or (nrepl-dict-get meta "fn")
(nrepl-dict-get meta "arglists"))))
(cond ((and do-macro is-macro)
(push sym macros))
((and do-function is-function)
(push sym functions))
((and do-var (not is-function) (not is-macro))
(push sym vars)))))))))
(plist)
;; Note that (memq 'function cider-font-lock-dynamically) and similar statements are evaluated differently
;; for `core' - they're always truthy for `core' (see related core-handling code some lines below):
(let ((do-function (memq 'function cider-font-lock-dynamically))
(do-var (memq 'var cider-font-lock-dynamically))
(do-macro (memq 'macro cider-font-lock-dynamically))
(do-deprecated (memq 'deprecated cider-font-lock-dynamically)))
(while plist
(let ((sym (pop plist))
(meta (pop plist)))
(pcase (nrepl-dict-get meta "cider/instrumented")
(`nil nil)
(`"\"breakpoint-if-interesting\""
(push sym instrumented))
(`"\"light-form\""
(push sym enlightened)))
;; The ::traced keywords can be inlined by MrAnderson, so
;; 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)))
meta)
(push sym traced))
(when (and do-deprecated (nrepl-dict-get meta "deprecated"))
(push sym deprecated))
(let ((is-macro (nrepl-dict-get meta "macro"))
(is-function (or (nrepl-dict-get meta "fn")
(nrepl-dict-get meta "arglists"))))
(cond ((and do-macro is-macro)
(push sym macros))
((and do-function is-function)
(push sym functions))
((and do-var (not is-function) (not is-macro))
(push sym vars)))))))))
;; For core members, we override `cider-font-lock-dynamically', since all core members should get the same treatment:
(when (memq 'core cider-font-lock-dynamically)
(let ((cider-font-lock-dynamically '(function var macro core deprecated)))
Expand Down
10 changes: 5 additions & 5 deletions cider-ns.el
Original file line number Diff line number Diff line change
Expand Up @@ -166,13 +166,13 @@ presenting the error message as an overlay."
"Refresh LOG-BUFFER with RESPONSE."
(nrepl-dbind-response response (out err reloading progress status error error-ns after before)
(cl-flet* ((log (message &optional face)
(cider-emit-into-popup-buffer log-buffer message face t))
(cider-emit-into-popup-buffer log-buffer message face t))

(log-echo (message &optional face)
(log message face)
(unless cider-ns-refresh-show-log-buffer
(let ((message-truncate-lines t))
(message "cider-ns-refresh: %s" message)))))
(log message face)
(unless cider-ns-refresh-show-log-buffer
(let ((message-truncate-lines t))
(message "cider-ns-refresh: %s" message)))))
(cond
(out
(log out))
Expand Down
10 changes: 5 additions & 5 deletions cider-repl.el
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,11 @@ description transform) where transform is called with the param-value if
present."
(cl-labels
((emit-comment
(contents)
(insert-before-markers
(propertize
(if (string-blank-p contents) ";;\n" (concat ";; " contents "\n"))
'font-lock-face 'font-lock-comment-face))))
(contents)
(insert-before-markers
(propertize
(if (string-blank-p contents) ";;\n" (concat ";; " contents "\n"))
'font-lock-face 'font-lock-comment-face))))
(let ((jack-in-command (plist-get cider-launch-params :jack-in-cmd))
(cljs-repl-type (plist-get cider-launch-params :cljs-repl-type))
(cljs-init-form (plist-get cider-launch-params :repl-init-form)))
Expand Down
56 changes: 28 additions & 28 deletions cider-selector.el
Original file line number Diff line number Diff line change
Expand Up @@ -121,56 +121,56 @@ is chosen. The returned buffer is selected with
#'< :key #'car))))

(def-cider-selector-method ?? "Selector help buffer."
(ignore-errors (kill-buffer cider-selector-help-buffer))
(with-current-buffer (get-buffer-create cider-selector-help-buffer)
(insert "CIDER Selector Methods:\n\n")
(cl-loop for (key line nil) in cider-selector-methods
do (insert (format "%c:\t%s\n" key line)))
(goto-char (point-min))
(help-mode)
(display-buffer (current-buffer) t))
(cider-selector)
(current-buffer))
(ignore-errors (kill-buffer cider-selector-help-buffer))
(with-current-buffer (get-buffer-create cider-selector-help-buffer)
(insert "CIDER Selector Methods:\n\n")
(cl-loop for (key line nil) in cider-selector-methods
do (insert (format "%c:\t%s\n" key line)))
(goto-char (point-min))
(help-mode)
(display-buffer (current-buffer) t))
(cider-selector)
(current-buffer))

(cl-pushnew (list ?4 "Select in other window" (lambda () (cider-selector t)))
cider-selector-methods :key #'car)

(def-cider-selector-method ?c
"Most recently visited clojure-mode buffer."
(cider-selector--recently-visited-buffer '(clojure-mode clojure-ts-mode)))
"Most recently visited clojure-mode buffer."
(cider-selector--recently-visited-buffer '(clojure-mode clojure-ts-mode)))

(def-cider-selector-method ?e
"Most recently visited emacs-lisp-mode buffer."
(cider-selector--recently-visited-buffer 'emacs-lisp-mode))
"Most recently visited emacs-lisp-mode buffer."
(cider-selector--recently-visited-buffer 'emacs-lisp-mode))

(def-cider-selector-method ?q "Abort."
(top-level))
(top-level))

(def-cider-selector-method ?r
"Current REPL buffer or as a fallback, the most recently
"Current REPL buffer or as a fallback, the most recently
visited cider-repl-mode buffer."
(or (cider-current-repl)
(cider-selector--recently-visited-buffer 'cider-repl-mode)))
(or (cider-current-repl)
(cider-selector--recently-visited-buffer 'cider-repl-mode)))

(def-cider-selector-method ?m
"Current connection's *nrepl-messages* buffer."
(nrepl-messages-buffer (cider-current-repl)))
"Current connection's *nrepl-messages* buffer."
(nrepl-messages-buffer (cider-current-repl)))

(def-cider-selector-method ?x
"*cider-error* buffer."
cider-error-buffer)
"*cider-error* buffer."
cider-error-buffer)

(def-cider-selector-method ?p
"*cider-profile* buffer."
cider-profile-buffer)
"*cider-profile* buffer."
cider-profile-buffer)

(def-cider-selector-method ?d
"*cider-doc* buffer."
cider-doc-buffer)
"*cider-doc* buffer."
cider-doc-buffer)

(def-cider-selector-method ?s
"*cider-scratch* buffer."
(cider-scratch-find-or-create-buffer))
"*cider-scratch* buffer."
(cider-scratch-find-or-create-buffer))

(provide 'cider-selector)

Expand Down
6 changes: 3 additions & 3 deletions cider-stacktrace.el
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,9 @@ filters for the resulting machinery."
(save-excursion
(goto-char (point-min))
(cl-flet ((next-detail (end)
(when-let* ((pos (next-single-property-change (point) 'detail)))
(when (< pos end)
(goto-char pos)))))
(when-let* ((pos (next-single-property-change (point) 'detail)))
(when (< pos end)
(goto-char pos)))))
(let ((inhibit-read-only t))
;; For each cause...
(while (cider-stacktrace-next-cause)
Expand Down
6 changes: 3 additions & 3 deletions nrepl-client.el
Original file line number Diff line number Diff line change
Expand Up @@ -1402,9 +1402,9 @@ If ID is nil, return nil."
"Pretty print nREPL list like OBJECT.
FOREGROUND and BUTTON are as in `nrepl-log-pp-object'."
(cl-flet ((color (str)
(propertize str 'face
(append '(:weight ultra-bold)
(when foreground `(:foreground ,foreground))))))
(propertize str 'face
(append '(:weight ultra-bold)
(when foreground `(:foreground ,foreground))))))
(let ((head (format "(%s" (car object))))
(insert (color head))
(if (null (cdr object))
Expand Down
Loading