Option to use *cider-result* popup-buffer
Expected behavior
Display result of evaluation commands and debugging steps in *cider-result* popup-buffer just like cider--pprint-eval-form does.
- An option to pprint into
*cider-result*when debugging and deactivate displaying result in an overlay. - An option to pprint into
*cider-result*when evaluating interactively and deactivate displaying result in an overlay.
Actual behavior
Some commands use overlays, some use minibuffer. Overlays can be deactivated but a pprint-popup-buffer can not be activated globally.
Implementation
Looking for spots in the code suitable for such an option ...
So, you want something similar to:
(defcustom cider-interactive-eval-output-destination 'repl-buffer
"The destination for stdout and stderr produced from interactive evaluation."
:type '(choice (const output-buffer)
(const repl-buffer))
:group 'cider
:package-version '(cider . "0.7.0"))
Yes, a defcustom to activate the usage of a cider-popup-buffer as the default output-target for interactive evaluations and during debugging.
Currently I am using variants of cider--pprint-eval-form which creates a cider-popup-buffer with the name taken from cider-result-buffer in specialized eval-commands.
I might be interested in taking this up. Does this request still make sense despite whatever changes were made to cider in the last year?
It looks like there's a current convention of having separate "pprint" functions that pprint to a popup buffer while the original function prints to the minibuffer/overlay (e.g. cider-eval-last-sexp -> cider-pprint-eval-last-sexp), but that's not implemented for all functions (e.g. cider-eval-region and cider-eval-sexp-at-point). I'm not sure whether it's better to continue adding pprint functions for whichever eval functions don't yet have them or go the originally proposed route of configuring this via a variable. I think just the former wouldn't let us pprint debug evaluation results in a popup buffer, but just the latter might not be good for users who want to pprint to a popup for some evaluations without doing it for all. WDYT?
The problem with existing pprint functions (if I recall correctly, as I rarely use them) is that they are not a transparent replacement for the regular eval functions - namely using pprint produces output, not a prettified results. That's why we ended up with pairs of functions with similar behaviour.
If we altered pprint to behave transparently (which will likely have to happen in nREPL), then the second set of functions will not the needed. Then we can just have a config for whether to use pprint or not and whether to show results and output in the minibuffer, inline, in the repl, or in dedicated buffers.
Anyways, this is just as relevant as it was when the ticket was created. Very little has changed in this area.
Here's also the related nREPL enhancement ticket https://github.com/nrepl/nREPL/issues/12