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

cider-pprint-eval-last-sexp doesn't play nicely with infinite sequences #454

Closed
johnwalker opened this issue Jan 17, 2014 · 2 comments
Closed
Labels

Comments

@johnwalker
Copy link
Contributor

; CIDER 0.5.0alpha (Clojure 1.5.1, nREPL 0.2.3)

First, do something that won't terminate:

(interpose (repeat #{}) (list 1 2))

Evaluate the expression with cider-eval-last-sexp (C-x C-e). Wait a few seconds, and abort with cider-interrupt (C-c C-b). Emacs will not crash.

On the other hand, if you use cider-pprint-eval-last-sexp (C-c C-p), the cider-result buffer will start filling with evaluation results. Cider-interrupt appears to halt evaluation, but doesn't prevent cider-eval-last-sexp from printing. Finally, killing the cider-result buffer will prevent Emacs from crashing, but cider-pprint-eval-last-sexp will no longer print future evaluations to cider-result.

@bbatsov
Copy link
Member

bbatsov commented Jan 21, 2014

Hmm, that's nasty. Not sure what the best way to handle this would be. After all - printing infinite sequences is bound to be problematic. let binding print-length seems like the best idea to me, but that'll look kind of ugly in the Emacs Lisp code. A pretty printing middleware seems like a good alternative.

@bbatsov bbatsov added the bug label Mar 6, 2014
@johnwalker
Copy link
Contributor Author

Wow thanks!

dgtized pushed a commit to dgtized/cider that referenced this issue Jun 24, 2014
This way it will respect the *print-length* setting of the main session.

This also fixes clojure-emacs#454.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants