clojure-emacs / cider

The Clojure Interactive Development Environment that Rocks for Emacs
https://cider.mx
GNU General Public License v3.0
3.55k stars 645 forks source link

cider-pprint-eval-last-sexp not working #989

Closed lsgrep closed 9 years ago

lsgrep commented 9 years ago
OS X 10.10.2 (14C109)
Emacs Version 24.4 (9.0)
CIDER 0.9.0snapshot (package: 20150223.2207) (Java 1.8.0_25, Clojure 1.7.0-alpha5, nREPL 0.2.6)
(ns scholar.fun
  (:require [clojure.string :as str]
            [clojure.data.json :as json]
            [clojure.java.io :as io]
            [cemerick.url :refer (url url-encode)]
            [crypto.random :as random])
  (:require
            [environ.core :refer [env]]
            [yesql.core :refer [defquery defqueries]]
            [clj-http.client :as http-client])

  (:use
        [clojure.java.shell :only [sh]]
        [scholar.util.tricks :only [conf get-now]]))

(sh "ls" "-aul")
lsgrep commented 9 years ago

maybe this is caused by cnREPL version 0.2.6. I am checking my deps tree.

cichli commented 9 years ago

nREPL 0.2.6 will be pulled in by your lein version - there shouldn't be a problem with it even though CIDER snapshot does currently warn for < 0.2.7.

So just to clarify: cider-eval-last-sexp works, but cider-pprint-eval-last-sexp does not? Please will you see if evaluating the same expression at the REPL works, with cider-repl-use-pretty-printing set to both nil and t?

lsgrep commented 9 years ago

cider-eval-last-sexp works, but cider-pprint-eval-last-sexp does not. Yes. This is my problem.

  1. REPL throws error just as cider-pprint-eval-last-sexp
scholar.main> (sh "ls" "-aul")
CompilerException java.lang.RuntimeException: Unable to resolve symbol: sh in this context, compiling:(/private/var/folders/z9/tyv17gbs1cj8p0tp7d2y_fph0000gn/T/form-init6708467975754434630.clj:1:1) 

2.Setting "cider-repl-use-pretty-printing" t or nil didnot make any difference. Nothing changed, including REPL.

lsgrep commented 9 years ago

it's 11:50 here. I have to sleep. Thanks for your response. @cichli If anything else required for this issue, please leave a comment. I will reply in the morning.

cichli commented 9 years ago

You should load the buffer (C-c C-b or C-c C-k) and then switch to its namespace in the REPL (C-c M-n) first :-).

lsgrep commented 9 years ago

This is not an issue then .Got it. Thanks for you help.

lsgrep commented 9 years ago

Problem solved. It is merely my own misunderstanding of loading process.

cichli commented 9 years ago

Glad to be of help!