Skip to content

Commit b401c82

Browse files
committed
[Fix #116] Set *inf-clojure* REPL type on detect
Now the code sets both buffer (the source and the REPL), when a REPL type is detected. This solves the weird errors that were happening when working off of the REPL buffer because inf-clojure-repl-type was always nil.
1 parent 8c27b06 commit b401c82

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
* [#83](https://github.com/clojure-emacs/inf-clojure/pull/85): No such namespace: complete.core in lumo REPL.
99
* [#93](https://github.com/clojure-emacs/inf-clojure/pull/93): Slow response from inf-clojure (completions, arglists, ...).
1010
* [#101](https://github.com/clojure-emacs/inf-clojure/pull/101): `inf-clojure-set-ns` hangs Emacs.
11+
* [#119](https://github.com/clojure-emacs/inf-clojure/pull/119): Repl buffer sometimes has different `inf-clojure-repl-type`.
1112

1213
### New Features
1314

inf-clojure.el

+4-3
Original file line numberDiff line numberDiff line change
@@ -292,9 +292,10 @@ See http://blog.jorgenschaefer.de/2014/05/race-conditions-in-emacs-process-filte
292292
(defun inf-clojure--set-repl-type (proc)
293293
"Set the REPL type if has not already been set.
294294
It requires a REPL PROC for inspecting the correct type."
295-
(if (not inf-clojure-repl-type)
296-
(setq inf-clojure-repl-type (inf-clojure--detect-repl-type proc))
297-
inf-clojure-repl-type))
295+
(with-current-buffer inf-clojure-buffer
296+
(if (not inf-clojure-repl-type)
297+
(setq inf-clojure-repl-type (inf-clojure--detect-repl-type proc))
298+
inf-clojure-repl-type)))
298299

299300
(defun inf-clojure--single-linify (string)
300301
"Convert a multi-line STRING in a single-line STRING.

0 commit comments

Comments
 (0)