diff --git a/CHANGELOG.md b/CHANGELOG.md index 1eca521..da62ab5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ * [#83](https://github.com/clojure-emacs/inf-clojure/pull/85): No such namespace: complete.core in lumo REPL. * [#93](https://github.com/clojure-emacs/inf-clojure/pull/93): Slow response from inf-clojure (completions, arglists, ...). * [#101](https://github.com/clojure-emacs/inf-clojure/pull/101): `inf-clojure-set-ns` hangs Emacs. +* [#119](https://github.com/clojure-emacs/inf-clojure/pull/119): Set inf-clojure-buffer REPL type on detect. * [#120](https://github.com/clojure-emacs/inf-clojure/pull/120): Send REPL string always, even if empty. ### New Features diff --git a/inf-clojure.el b/inf-clojure.el index ed6058e..c16f913 100644 --- a/inf-clojure.el +++ b/inf-clojure.el @@ -292,9 +292,10 @@ See http://blog.jorgenschaefer.de/2014/05/race-conditions-in-emacs-process-filte (defun inf-clojure--set-repl-type (proc) "Set the REPL type if has not already been set. It requires a REPL PROC for inspecting the correct type." - (if (not inf-clojure-repl-type) - (setq inf-clojure-repl-type (inf-clojure--detect-repl-type proc)) - inf-clojure-repl-type)) + (with-current-buffer inf-clojure-buffer + (if (not inf-clojure-repl-type) + (setq inf-clojure-repl-type (inf-clojure--detect-repl-type proc)) + inf-clojure-repl-type))) (defun inf-clojure--single-linify (string) "Convert a multi-line STRING in a single-line STRING.