-
-
Notifications
You must be signed in to change notification settings - Fork 645
Add command to print the current value of the inspector. #3810
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
base: master
Are you sure you want to change the base?
Conversation
6350c4c
to
34637f1
Compare
I'm fine with this suggestion. @alexander-yakushev what do you think? |
With pretty-printing mode now merged, do you still desire to have this feature, @r0man? If so, we'll need some other key binding. |
Hi @alexander-yakushev and @bbatsov, yes, I'm still interested in it. I take a look at it later or tomorrow and look for a new keybinding. |
6e82e37
to
ea70033
Compare
cider-inspector.el
Outdated
@@ -146,6 +147,7 @@ Can be turned to nil once the user sees and acknowledges the feature." | |||
(define-key map [(shift tab)] #'cider-inspector-previous-inspectable-object) | |||
(define-key map "p" #'cider-inspector-previous-inspectable-object) | |||
(define-key map "P" #'cider-inspector-toggle-pretty-print) | |||
(define-key map "x" #'cider-inspector-print-current-value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😬
I was actually eyeing x
for another pretty-printing functionality we might do in the future – eXpanding arbitrary values at the cursor point, pretty-printing just that value in an otherwise regular inspector view.
What do you think about C-p
? It will still be Printing-related this way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, C-p
is usually bound to previous-line
. So maybe better not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd go with something like r
(I guess render
can be a mnemonic for it) - in the absence of meaningful names I go for those that are easy to type.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
M-p
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about C-c C-p
? We use that keybinding in cider-mode
:
cider-mode.el:502: (define-key map (kbd "C-c C-p") #'cider-pprint-eval-last-sexp)
It's not used in inspector mode, and its similar to that command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's a great suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went with C-c C-p
now. Are you fine with this @bbatsov ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's normally a minor mode keybinding (C-c something
), so it's a bit weird IMO, but I don't have strong reservations for it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very clean now!
This PR adds the interactive `cider-inspector-print-current-value` command that prints the current value of the inspector to the `cider-inspector-value-buffer` with the usual pretty printing machinery.
d312f55
to
0b90313
Compare
This PR adds the interactive
cider-inspector-print-current-value
command that prints the current value of the inspector to thecider-inspector-value-buffer
with the usual pretty printing machinery.The NREPL part is here: clojure-emacs/cider-nrepl#933
When pressing "P" in the inspector the currently inspected value is printed in a new popup buffer (on the left side in the picture).
I see it as the inspectors brother of
cider-pprint-eval-last-sexp
which I use all the time.This is the functionality I initially suggested, before working on the pretty mode. I think it is still useful. What I would like to have is a quick way to pretty print the current value of the inspector in the same familiar way my eye is used to, as the Clojure pretty printer (or what we are using in CIDER).
The new pretty mode does print more pretty, but differently, it uses "inspector mode" printing.
That's why I think this could be a useful addition.
Wdyt?
Before submitting the PR make sure the following things have been done (and denote this
by checking the relevant checkboxes):
eldev test
)eldev lint
) which is based onelisp-lint
and includescheckdoc
, check-declare, packaging metadata, indentation, and trailing whitespace checks.