Closed mgrubb closed 5 years ago
Doesn't cider-nrepl have some sort of support for this? Can we tap into it?
There is a cider.nrepl.middleware.pprint/wrap-pprint
middleware that will return a :pprint-out
key in the response if the the :eval
message is sent with the :pprint
key set to 1
.
See
https://github.com/clojure-emacs/cider-nrepl#supplied-nrepl-middleware
https://github.com/clojure-emacs/cider-nrepl/blob/master/src/cider/nrepl/middleware/pprint.clj#L99
Though in doing some more thinking about this, it might be more useful to have the general ability to create a mapping to send/modify a nrepl message with the same semantics of cpp or c!! etal.
I think it would be fine to make this the default behavior for cpp
. Maybe c!!
too if you can get the indenting correct.
@mgrubb did you ever impl anything on this? pprint would be awesome.
This has been implemented and can be closed.
It would be nice to be able to either set an option or get separate keybinds for cpp and c!! to use pretty printed format. This would make using clojure code to refactor existing code nicer.