-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
Eval in buffer and pretty-print result in REPL as output #2617
Comments
I was planning to do this, but I realised that |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding! |
This is a solution for issue-2617 on cider github. clojure-emacs#2617
Hi @bbatsov and @stathissideris , As @paulojean has mentioned, Do we still want to have a separate function for doing this? Should I create a pull request with this? |
I've added a small remark to your commit. In general it seems we need to have more of the special function behaviors added to menu bars and documented properly at docs.cider.mx. |
Okay, I will do that. Thanks! :) |
This is a solution for issue-2617 on cider github. clojure-emacs#2617
- Add an entry in CHANGELOG.md. This is a solution for issue-2617 on cider github. clojure-emacs#2617
Hello again, |
Here's something that works for my current setup, you can modify it to suit your need; I can't say it's pretty! (defun cider-recenter (&rest args)
(interactive)
(other-frame 1)
(goto-char (point-max))
(recenter -2)
(other-frame -1))
(define-key cider-mode-map (kbd "s-e")
#'(lambda () (interactive)
(advice-add 'make-progress-reporter :override (lambda (&rest args)))
(save-window-excursion (cider-insert-last-sexp-in-repl 1))
(cider-recenter)
(advice-remove 'make-progress-reporter (lambda (&rest args))))) |
For anyone reading through -- the above commit with Here's the user level code that worked for me to override the default (defun cider-insert-and-eval-last-sexp-in-repl (&rest args)
"Insert the expression preceding point in the REPL buffer and eval."
(interactive)
(cider-insert-last-sexp-in-repl t))
(define-key cider-mode-map (kbd "C-x C-e") #'cider-insert-and-eval-last-sexp-in-repl)
|
Is your feature request related to a problem? Please describe.
The workflow I’d like to try is typing long multi-line expressions in a .clj file and eval+pretty-print their results in the REPL where the results accumulate.
Describe the solution you'd like
I would like a function that is similar to
cider-pprint-eval-last-sexp-to-repl
but instead of inserting the result into the REPL as input, I would like it to be inserted as pretty-printed output instead. If the eval'ed expression is also added as if it was typed in the prompt of the REPL I think it would be even more usable (because then you'd see alternating input and output and it would be easier to follow what was executed and in what order) but I’d be happy with just the outputs.Describe alternatives you've considered
I saw that something similar would be possible with getting the results in a popup buffer, but I prefer to see a “log” of results which accumulate.
Additional context
This mockup shows what the result of running this new command might look like. My cursor is on the left in
dev.clj
, and I've just ran the new command, which resulted in my s-exp being added as input in the REPL prompt and the result of the expression being pretty-printed just below.The text was updated successfully, but these errors were encountered: