You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rich results were REPL-prompt-only since 2018 (#2476): evaluating a
form returning an image from a source buffer just printed the object.
Interactive evals now opt in to content-typed responses, and the new
cider-eval-rich-content-destination controls where rich results render:
inline in the result overlay (the default), in the REPL (reusing its
content-type handlers, buttons included), in the *cider-result* popup,
or nil for the old plain-value behavior.
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,7 @@
4
4
5
5
### New features
6
6
7
+
- Honor content types for interactive evaluations too ([#2476](https://github.com/clojure-emacs/cider/issues/2476)): a `cider-eval-last-sexp` returning an image can now render it, per the new `cider-eval-rich-content-destination` - `inline` (the default, in the result overlay at point), `repl` (like results of forms typed at the prompt, with the `[show content]` button for external references), `popup` (the `*cider-result*` buffer) or `nil` (plain values, the previous behavior).
7
8
- Add a transient menu to the debugger (`cider-debug-menu`, bound to `?` during a debug session), grouping all the debugger's single-key commands; they are also proper named commands now (e.g. `cider-debug-next`, `cider-debug-quit`), so they can be invoked via `M-x` as well.
8
9
- Add a transient menu to the inspector (`cider-inspector-menu`, bound to `m` in the inspector buffer), grouping all the inspector commands.
9
10
-[#4065](https://github.com/clojure-emacs/cider/pull/4065): Add a `--print-fn=` flag to the pretty-print transient menu (`cider-eval-pprint-menu`) to pick the printer (pr/pprint/fipp/puget/zprint or a custom var) per invocation.
Copy file name to clipboardExpand all lines: doc/modules/ROOT/pages/usage/code_evaluation.adoc
+25Lines changed: 25 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -411,7 +411,32 @@ Additionally, there's the variable `cider-redirect-server-output-to-repl` that c
411
411
412
412
NOTE: The redirection functionality is implemented in `cider-nrepl` as nREPL middleware. If you're using CIDER without `cider-nrepl` no output redirection is going to take place.
413
413
414
+
=== Rich Results
415
+
416
+
When an interactive evaluation produces a value with a recognized content
417
+
type - an image, or a reference to external content such as a file or URL -
418
+
CIDER can render it instead of just printing the value. Where it renders is
419
+
controlled by `cider-eval-rich-content-destination`:
420
+
421
+
* `inline` (the default) - directly displayable content (images) shows in
422
+
the result overlay at point, just like a regular evaluation result;
423
+
anything that can't render inline falls back to its plain-text
424
+
representation.
425
+
* `repl` - rich results render in the current REPL buffer, exactly like the
426
+
results of forms entered at the prompt; references to external content get
427
+
a `[show content]` button there.
428
+
* `popup` - rich results render in the `+*cider-result*+` popup buffer,
429
+
where external references also get a fetch button.
430
+
* `nil` - disable the feature; results display as plain printed values.
414
431
432
+
[source,lisp]
433
+
----
434
+
(setq cider-eval-rich-content-destination 'repl)
435
+
----
436
+
437
+
This is the interactive-evaluation counterpart of the REPL's rich content
438
+
support (see xref:repl/configuration.adoc[REPL Configuration]) and likewise
0 commit comments