emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[nongnu] elpa/inf-clojure 903dd73 196/313: Set explicitly inf-clojure-re


From: ELPA Syncer
Subject: [nongnu] elpa/inf-clojure 903dd73 196/313: Set explicitly inf-clojure-repl-type for REPL and source buffer
Date: Wed, 11 Aug 2021 10:00:15 -0400 (EDT)

branch: elpa/inf-clojure
commit 903dd739c575a1b0d5495a3f6a2baf9ccc23d174
Author: Andrea Richiardi <a.richiardi.work@gmail.com>
Commit: Bozhidar Batsov <bozhidar.batsov@gmail.com>

    Set explicitly inf-clojure-repl-type for REPL and source buffer
    
    Fixing a wrong behavior that was previously never setting it for source
    buffers.
---
 inf-clojure.el | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/inf-clojure.el b/inf-clojure.el
index 385b149..e9920f9 100644
--- a/inf-clojure.el
+++ b/inf-clojure.el
@@ -296,10 +296,14 @@ 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."
-  (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)))
+  (if (not inf-clojure-repl-type)
+      (let ((repl-type (inf-clojure--detect-repl-type proc)))
+        ;; set the REPL process buffer
+        (with-current-buffer inf-clojure-buffer
+          (setq-local inf-clojure-repl-type repl-type))
+        ;; set in the current buffer
+        (setq-local inf-clojure-repl-type repl-type))
+    inf-clojure-repl-type))
 
 (defun inf-clojure--single-linify (string)
   "Convert a multi-line STRING in a single-line STRING.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]