Skip to content

Commit 3186afa

Browse files
committed
Remove distinct REPL-switching commands
They are now redundant as you could get the old behaviour just by customizing the request dispatch logic. If it's set to static you'd always go to the default REPL and otherwise you'd get the "relevant" REPL behaviour.
1 parent f37db43 commit 3186afa

File tree

3 files changed

+3
-43
lines changed

3 files changed

+3
-43
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
* Clearing the REPL buffer is now bound to `C-u C-C C-o`.
5959
* [#1422](https://github.com/clojure-emacs/cider/issues/1422): Don't display mismatching parens error on incomplete expressions in REPL buffers.
6060
* [#1412](https://github.com/clojure-emacs/cider/issues/1412): nREPL messages for separate sessions are tracked in separate buffers.
61+
* Removed `cider-switch-to-repl-command`.
6162

6263
### Bugs fixed
6364

README.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -904,17 +904,6 @@ font-locked as in `clojure-mode` use the following:
904904
(setq cider-font-lock-dynamically '(macro core function var))
905905
```
906906

907-
* You can control the <kbd>C-c C-z</kbd> key behavior of switching to the REPL buffer
908-
with the `cider-switch-to-repl-command` variable. While the default command
909-
`cider-switch-to-relevant-repl-buffer` should be an adequate choice for
910-
most users, `cider-switch-to-current-repl-buffer` offers a simpler alternative
911-
where CIDER will not attempt to match the correct REPL buffer based on
912-
underlying project directories:
913-
914-
```el
915-
(setq cider-switch-to-repl-command #'cider-switch-to-current-repl-buffer)
916-
```
917-
918907
* You can configure known endpoints used by the cider command offered via a
919908
completing read. This is useful if you have a list of common host/ports you
920909
want to establish remote nREPL connections to. Using an optional label is

cider-mode.el

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -85,15 +85,6 @@ entirely."
8585
`cider-switch-to-last-clojure-buffer' uses this variable to jump
8686
back to last Clojure source buffer.")
8787

88-
(defcustom cider-switch-to-repl-command 'cider-switch-to-relevant-repl-buffer
89-
"Select the command to be invoked when switching-to-repl.
90-
The default option is `cider-switch-to-relevant-repl-buffer'. If
91-
you'd like to not use smart matching of repl buffer based on
92-
project directory, you can assign it to `cider-switch-to-current-repl-buffer'
93-
which will use the default REPL connection."
94-
:type 'symbol
95-
:group 'cider)
96-
9788
(defun cider-remember-clojure-buffer (buffer)
9889
"Try to remember the BUFFER from which the user jumps.
9990
The BUFFER needs to be a Clojure buffer and current major mode needs
@@ -105,11 +96,6 @@ to jump back to the last Clojure source buffer."
10596
(derived-mode-p 'cider-repl-mode))
10697
(setq cider-last-clojure-buffer buffer)))
10798

108-
(defun cider-switch-to-repl-buffer (&optional arg)
109-
"Invoke `cider-switch-to-repl-command'."
110-
(interactive "P")
111-
(funcall cider-switch-to-repl-command arg))
112-
11399
(defun cider--switch-to-repl-buffer (repl-buffer &optional set-namespace)
114100
"Select the REPL-BUFFER, when possible in an existing window.
115101
@@ -131,22 +117,7 @@ that of the namespace in the Clojure source buffer."
131117
(cider-remember-clojure-buffer buffer)
132118
(goto-char (point-max))))
133119

134-
(defun cider-switch-to-default-repl-buffer (&optional set-namespace)
135-
"Select the default REPL buffer, when possible in an existing window.
136-
137-
Hint: You can use `display-buffer-reuse-frames' and
138-
`special-display-buffer-names' to customize the frame in which
139-
the buffer should appear.
140-
141-
With a prefix argument SET-NAMESPACE, sets the namespace in the REPL buffer to
142-
that of the namespace in the Clojure source buffer."
143-
(interactive "P")
144-
(cider--switch-to-repl-buffer (cider-default-connection) set-namespace))
145-
146-
(define-obsolete-function-alias 'cider-switch-to-current-repl-buffer
147-
'cider-switch-to-default-repl-buffer "0.10")
148-
149-
(defun cider-switch-to-relevant-repl-buffer (&optional set-namespace)
120+
(defun cider-switch-to-repl-buffer (&optional set-namespace)
150121
"Select the REPL buffer, when possible in an existing window.
151122
The buffer chosen is based on the file open in the current buffer.
152123
@@ -169,7 +140,7 @@ of the namespace in the Clojure source buffer."
169140
"Load the current buffer into the relevant REPL buffer and switch to it."
170141
(interactive "P")
171142
(cider-load-buffer)
172-
(cider-switch-to-relevant-repl-buffer set-namespace))
143+
(cider-switch-to-repl-buffer set-namespace))
173144

174145
(defun cider-switch-to-last-clojure-buffer ()
175146
"Switch to the last Clojure buffer.
@@ -285,7 +256,6 @@ Returns to the buffer in which the command was invoked."
285256
"--"
286257
["Set ns" cider-repl-set-ns]
287258
["Switch to REPL" cider-switch-to-repl-buffer]
288-
["Switch to Relevant REPL" cider-switch-to-relevant-repl-buffer]
289259
["Toggle REPL Pretty Print" cider-repl-toggle-pretty-printing]
290260
["Clear REPL output" cider-find-and-clear-repl-output]
291261
"--"

0 commit comments

Comments
 (0)