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

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

[nongnu] elpa/inf-clojure 7441d3b 120/313: Fix REPL type detection


From: ELPA Syncer
Subject: [nongnu] elpa/inf-clojure 7441d3b 120/313: Fix REPL type detection
Date: Wed, 11 Aug 2021 09:59:59 -0400 (EDT)

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

    Fix REPL type detection
    
    The problem was occurring when the first operation was not an
    `inf-clojure--send-string`. Now `inf-clojure--set-repl-type` is
    explicitely called in the form getters.
---
 inf-clojure.el | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/inf-clojure.el b/inf-clojure.el
index e47095a..fe6aa7d 100644
--- a/inf-clojure.el
+++ b/inf-clojure.el
@@ -202,9 +202,11 @@ either `setq-local` or an entry in `.dir-locals.el`." )
    (t 'clojure)))
 
 (defun inf-clojure--set-repl-type (proc)
-  "Set the REPL type if has not already been set."
-  (when (not inf-clojure-repl-type)
-    (setq inf-clojure-repl-type (inf-clojure--detect-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-type proc))
+    inf-clojure-repl-type))
 
 (defun inf-clojure--send-string (proc string)
   "A custom `comint-input-sender` / `comint-send-string`.
@@ -584,7 +586,7 @@ The prefix argument SWITCH-TO-REPL controls whether to 
switch to REPL after the
   "Return the form to query inferior Clojure for a var's documentation.
 If you are using REPL types, it will pickup the most approapriate
 `inf-clojure-var-doc-form` variant."
-  (pcase inf-clojure-repl-type
+  (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
     (`lumo inf-clojure-var-doc-form-lumo)
     (_ inf-clojure-var-doc-form)))
 
@@ -641,7 +643,7 @@ If you are using REPL types, it will pickup the most 
approapriate
   "Return the form to query inferior Clojure for a var's documentation.
 If you are using REPL types, it will pickup the most approapriate
 `inf-clojure-completion-form` variant."
-  (pcase inf-clojure-repl-type
+  (pcase (inf-clojure--set-repl-type (inf-clojure-proc))
     (`lumo inf-clojure-completion-form-lumo)
     (_ inf-clojure-completion-form)))
 



reply via email to

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