Skip to content

Commit 903dd73

Browse files
arichiardibbatsov
authored andcommitted
Set explicitly inf-clojure-repl-type for REPL and source buffer
Fixing a wrong behavior that was previously never setting it for source buffers.
1 parent be3e2e7 commit 903dd73

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

inf-clojure.el

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,14 @@ See http://blog.jorgenschaefer.de/2014/05/race-conditions-in-emacs-process-filte
296296
(defun inf-clojure--set-repl-type (proc)
297297
"Set the REPL type if has not already been set.
298298
It requires a REPL PROC for inspecting the correct type."
299-
(with-current-buffer inf-clojure-buffer
300-
(if (not inf-clojure-repl-type)
301-
(setq inf-clojure-repl-type (inf-clojure--detect-repl-type proc))
302-
inf-clojure-repl-type)))
299+
(if (not inf-clojure-repl-type)
300+
(let ((repl-type (inf-clojure--detect-repl-type proc)))
301+
;; set the REPL process buffer
302+
(with-current-buffer inf-clojure-buffer
303+
(setq-local inf-clojure-repl-type repl-type))
304+
;; set in the current buffer
305+
(setq-local inf-clojure-repl-type repl-type))
306+
inf-clojure-repl-type))
303307

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

0 commit comments

Comments
 (0)