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

Option to use *cider-result* popup-buffer #1999

Open
drorbemet opened this issue May 29, 2017 · 4 comments
Open

Option to use *cider-result* popup-buffer #1999

drorbemet opened this issue May 29, 2017 · 4 comments
Assignees
Labels
feature request good first issue A simple tasks suitable for first-time contributors

Comments

@drorbemet
Copy link

drorbemet commented May 29, 2017

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 ...

@drorbemet drorbemet changed the title Option to use *cider-result* popup-buffer only Option to use *cider-result* popup-buffer May 29, 2017
@bbatsov
Copy link
Member

bbatsov commented May 30, 2017

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"))

@drorbemet
Copy link
Author

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.

@bbatsov bbatsov added the good first issue A simple tasks suitable for first-time contributors label Jun 25, 2018
@benjaminran
Copy link

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?

@bbatsov
Copy link
Member

bbatsov commented Aug 12, 2018

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 nrepl/nrepl#12

@bbatsov bbatsov added good first issue A simple tasks suitable for first-time contributors and removed good first issue A simple tasks suitable for first-time contributors low hanging fruit labels May 8, 2019
@vemv vemv self-assigned this Jul 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request good first issue A simple tasks suitable for first-time contributors
Projects
None yet
Development

No branches or pull requests

4 participants