summaryrefslogtreecommitdiff
path: root/cider-mode.el
diff options
context:
space:
mode:
authorVitalie Spinu <spinuvit@gmail.com>2018-06-18 00:45:40 +0200
committerBozhidar Batsov <bozhidar.batsov@gmail.com>2018-06-18 07:37:17 +0300
commit026ac3d5e5d868058633857d7ab6c54f5630aa0b (patch)
tree3e3e693e8d0c5eecd78358652ceb6be28a8812d6 /cider-mode.el
parent36e51106911978f7a776c437393cb63ef1aba55e (diff)
Check for missing repls in cider-switch-to-repl-buffer
Situation that should occur with broken links during development only.
Diffstat (limited to 'cider-mode.el')
-rw-r--r--cider-mode.el23
1 files changed, 12 insertions, 11 deletions
diff --git a/cider-mode.el b/cider-mode.el
index 1426688b..93a2a191 100644
--- a/cider-mode.el
+++ b/cider-mode.el
@@ -108,17 +108,18 @@ Hint: You can use `display-buffer-reuse-frames' and
`special-display-buffer-names' to customize the frame in which
the buffer should appear."
(interactive "P")
- (let* ((repls (sesman-ensure-linked-session 'CIDER))
- (type (cider-repl-type-for-buffer))
- (a-repl)
- (the-repl (seq-find (lambda (buf)
- (when (member buf repls)
- (unless a-repl
- (setq a-repl buf))
- (equal type (cider-repl-type-for-buffer buf))))
- (buffer-list))))
- (let ((repl (or the-repl a-repl)))
- (cider--switch-to-repl-buffer repl set-namespace))))
+ (if-let* ((repls (cider-repls)))
+ (let* ((type (cider-repl-type-for-buffer))
+ (a-repl)
+ (the-repl (seq-find (lambda (buf)
+ (when (member buf repls)
+ (unless a-repl
+ (setq a-repl buf))
+ (equal type (cider-repl-type-for-buffer buf))))
+ (buffer-list))))
+ (let ((repl (or the-repl a-repl)))
+ (cider--switch-to-repl-buffer repl set-namespace)))
+ (user-error "No linked REPL")))
(declare-function cider-load-buffer "cider-interaction")