cider icon indicating copy to clipboard operation
cider copied to clipboard

`cider-eval`: support re-rendering the Inspector buffer when `cider-inspector-auto-select-buffer` is set to nil and there's a `*cider-inspect*` buffer shown in a non-visible frame

Open vemv opened this issue 1 year ago • 5 comments

My overall intent is the possibility to have the *cider-inspect* buffer permanently on a background frame. cider-eval would have that frame's cider-inspect buffer re-rendered, without switching to it, given that I personally find that only a fraction of evals deserve inspection.

This wasn't possible before, as CIDER would detect that my frame wasn't visible, so it would render the buffer in a random window of the visible frame.

Commits:

  • cider-popup-buffer-display: Do nothing if the intended buffer is visible in another frame and select is nil
    • This seems the right thing to do, for a wide variety of use cases.
  • cider-eval: support re-rendering the Inspector buffer when cider-inspector-auto-select-buffer is set to nil and there's a *cider-inspect* buffer shown in a non-visible frame
    • This supports the workflow of using the inspector occasionally (less intrusively), but ready to be shown anytime.
  • cider-overlays: Make Result truncated message more accurate
    • If there's already a *cider-inspect* buffer visible, we shouldn't suggest the user to inspect the value again.

Cheers - V

vemv avatar Mar 14 '24 07:03 vemv

I reworked this PR to not introduce any defcustoms - ready now!

vemv avatar Mar 14 '24 11:03 vemv

Thanks for the update, I'll review it tomorrow.

bbatsov avatar Mar 14 '24 20:03 bbatsov

I checked the cider-inspector.el code and it seems the dependency on cider-eval.el is there just to access a single variable from there. Perhaps a better fix would be a simple declare or removing that prefix. After all we're not really doing an eval here anyways.

bbatsov avatar Apr 21 '24 14:04 bbatsov