clojure-emacs/nrepl.el — pull request #361 by vedang (2013-08-18 10:44:43+00:00)
Title: Fix `nrepl-switch-to-repl-buffer' to work with all connections

Commit 12558e8 breaks `nrepl-switch-to-repl-buffer' functionality by
assuming that all nrepl connections will be made using
`nrepl-jack-in'.

Using `nrepl-jack-in' sets the variable `nrepl-project-dir' to the
correct value, but this information cannot be retrieved when we
connect to an existing nRepl server using `nrepl-connect'. Since
`nrepl-project-dir' is unbound, the function `file-truename' throws a
null value exception.

This commit checks if `nrepl-project-dir' is set before calling
`file-truename'. Further, the message "nREPL connection not found"
does not make sense and thus should not be displayed.