Skip to content

Commit 47b7b1e

Browse files
committed
Extract a read-and-inspect command from cider-inspect
1 parent 6816216 commit 47b7b1e

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

cider-inspector.el

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,14 @@ The page size can be also changed interactively within the inspector."
9696
(interactive)
9797
(cider-inspect-expr (cider-defun-at-point) (cider-current-ns)))
9898

99+
;;;###autoload
100+
(defun cider-inspect-read-and-inspect ()
101+
"Read an expression from the minibuffer and inspect its result."
102+
(interactive)
103+
(when-let ((expression (cider-read-from-minibuffer "Inspect expression: "
104+
(cider-sexp-at-point))))
105+
(cider-inspect-expr expression (cider-current-ns))))
106+
99107
;;;###autoload
100108
(defun cider-inspect (&optional arg)
101109
"Inspect the result of the preceding sexp.
@@ -106,9 +114,7 @@ With a second prefix argument it prompts for an expression to eval and inspect."
106114
(pcase arg
107115
(1 (cider-inspect-last-sexp))
108116
(4 (cider-inspect-defun-at-point))
109-
(16 (when-let ((expression (cider-read-from-minibuffer "Inspect expression: "
110-
(cider-sexp-at-point))))
111-
(cider-inspect-expr expression (cider-current-ns))))))
117+
(16 (cider-inspect-read-and-inspect))))
112118

113119
;; Operations
114120
(defun cider-inspector--value-handler (_buffer value)

0 commit comments

Comments
 (0)