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

[Fix #493] Rotate nREPL connection handles no nREPL connection. #494

Merged
merged 1 commit into from
Mar 3, 2014
Merged

[Fix #493] Rotate nREPL connection handles no nREPL connection. #494

merged 1 commit into from
Mar 3, 2014

Conversation

jonpither
Copy link
Contributor

Fixes #493

@jonpither
Copy link
Contributor Author

Perhaps at some stage:

if (not (cider-connected-p)) (message "No active nREPL connection.")

Could be pulled out into a macro as it's used frequently.

@@ -28,6 +28,7 @@ visually distinctive from `cider-repl-output-face` (used for STDOUT output).

### Bugs fixed

* [#493](https://github.com/clojure-emacs/cider/issues/493) Fix
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems to me you forgot something here :-)

@bbatsov
Copy link
Member

bbatsov commented Mar 3, 2014

I don't think a macro is required. A simple function like this should do:

(defun cider-ensure-connected ()
   (unless (cider-connected-p)
     (error "No active nREPL connection")))

error will halt the execution of subsequent forms.

@jonpither
Copy link
Contributor Author

The changelog I'll fix :-)

I'll use the fn you suggest and use it in the other locations where cider-connected-p is checked.

@jonpither
Copy link
Contributor Author

Changes made. I could edit to commit msg to read "and introducing cider-ensure-connected" if you want.

@bbatsov
Copy link
Member

bbatsov commented Mar 3, 2014

Yep, that'd be nice. Alternatively you can have this split into two commits, as they are unrelated.

@jonpither
Copy link
Contributor Author

I changed the commit msg :-)

bbatsov added a commit that referenced this pull request Mar 3, 2014
[Fix #493] Rotate nREPL connection handles no nREPL connection.
@bbatsov bbatsov merged commit 41b4608 into clojure-emacs:master Mar 3, 2014
@bbatsov
Copy link
Member

bbatsov commented Mar 3, 2014

Thanks!

@jonpither jonpither deleted the rotate-no-connection branch March 3, 2014 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rotate nrepl connection when no nrepl connections breaks cider
2 participants