Skip to content

Commit 6e55048

Browse files
committed
[Fix #42] Add a defcustom controlling the window in which the REPL buffer is displayed
1 parent 166b077 commit 6e55048

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
* [#34](https://github.com/clojure-emacs/inf-clojure/pull/34): Add support for socket REPL connections.
88
* [#46](https://github.com/clojure-emacs/inf-clojure/pull/46): Make it possible to disable prompt on `inf-clojure-set-ns`.
99
* New interactive command `inf-clojure-display-version`.
10+
* [#42](https://github.com/clojure-emacs/inf-clojure/issues/42): Add a defcustom controlling the window in which the REPL buffer is displayed (`inf-clojure-repl-use-same-window`).
11+
12+
### Changes
13+
14+
* Display the REPL in a different window by default (it used to be displayed in the current window).
1015

1116
### Bugs Fixed
1217

inf-clojure.el

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ This should usually be a combination of `inf-clojure-prompt' and
185185
(const :tag "never" nil))
186186
:group 'inf-clojure)
187187

188+
(defcustom inf-clojure-repl-use-same-window nil
189+
"Controls whether to display the REPL buffer in the current window or not."
190+
:type '(choice (const :tag "same" t)
191+
(const :tag "different" nil))
192+
:group 'inf-clojure)
193+
188194
(defvar inf-clojure-buffer nil
189195
"The current inf-clojure process buffer.
190196
@@ -348,7 +354,9 @@ of `inf-clojure-program'). Runs the hooks from
348354
"inf-clojure" (car cmdlist) nil (cdr cmdlist)))
349355
(inf-clojure-mode)))
350356
(setq inf-clojure-buffer "*inf-clojure*")
351-
(pop-to-buffer-same-window "*inf-clojure*"))
357+
(if inf-clojure-repl-use-same-window
358+
(pop-to-buffer-same-window "*inf-clojure*")
359+
(pop-to-buffer "*inf-clojure*")))
352360

353361
;;;###autoload
354362
(defalias 'run-clojure 'inf-clojure)

0 commit comments

Comments
 (0)