Skip to content

Commit

Permalink
Let *1 be set properly when pretty-printing, fixes clojure-emacsgh-468
Browse files Browse the repository at this point in the history
  • Loading branch information
cemerick committed Feb 5, 2014
1 parent edfefda commit 0c5d18d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions cider-interaction.el
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,7 @@ Print its value into the current buffer."
(interactive)
(let ((form (cider-last-sexp))
(result-buffer (cider-popup-buffer cider-result-buffer nil)))
(cider-tooling-eval (format "(clojure.pprint/pprint %s)" form)
(cider-tooling-eval (format "(let [x %s] (clojure.pprint/pprint x) x)" form)
(cider-popup-eval-out-handler result-buffer)
(cider-current-ns))))

Expand All @@ -1003,7 +1003,7 @@ Print its value into the current buffer."
(interactive)
(let ((form (cider-defun-at-point))
(result-buffer (cider-popup-buffer cider-result-buffer nil)))
(cider-tooling-eval (format "(clojure.pprint/pprint %s)" form)
(cider-tooling-eval (format "(let [x %s] (clojure.pprint/pprint x) x)" form)
(cider-popup-eval-out-handler result-buffer)
(cider-current-ns))))

Expand Down
5 changes: 3 additions & 2 deletions cider-repl.el
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,8 @@ the symbol."
"Make a nREPL evaluation handler for the REPL BUFFER."
(nrepl-make-response-handler buffer
(lambda (buffer value)
(cider-repl-emit-result buffer value t))
(when (not cider-repl-use-pretty-printing)
(cider-repl-emit-result buffer value t)))
(lambda (buffer out)
(cider-repl-emit-output buffer out))
(lambda (buffer err)
Expand Down Expand Up @@ -551,7 +552,7 @@ If NEWLINE is true then add a newline at the end of the input."
(let* ((input (cider-repl--current-input))
(form (if (and (not (string-match "\\`[ \t\r\n]*\\'" input))
cider-repl-use-pretty-printing)
(format "(clojure.pprint/pprint %s)" input)
(format "(let [x %s] (clojure.pprint/pprint x) x)" input)
input)))
(goto-char (point-max))
(cider-repl--mark-input-start)
Expand Down

0 comments on commit 0c5d18d

Please sign in to comment.