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

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

[nongnu] elpa/idris-mode 80861674a6 08/18: Debug CI idris2 failure 2 - t


From: ELPA Syncer
Subject: [nongnu] elpa/idris-mode 80861674a6 08/18: Debug CI idris2 failure 2 - try retry to wait for idris version in idris-switch-working-directory
Date: Thu, 8 Dec 2022 05:59:07 -0500 (EST)

branch: elpa/idris-mode
commit 80861674a64f4ccb4a5ee23f7fabe76b3c19cdb3
Author: Marek L <nospam.keram@gmail.com>
Commit: Marek L <nospam.keram@gmail.com>

    Debug CI idris2 failure 2 - try retry to wait for idris version in 
idris-switch-working-directory
---
 idris-commands.el | 41 +++++++++++++++++++++++++----------------
 1 file changed, 25 insertions(+), 16 deletions(-)

diff --git a/idris-commands.el b/idris-commands.el
index 5074131425..f69f2d00b6 100644
--- a/idris-commands.el
+++ b/idris-commands.el
@@ -90,24 +90,33 @@
   (idris-run)
   (idris-repl-buffer))
 
+(defvar idris-retry 0)
+
 (defun idris-switch-working-directory (new-working-directory)
   "Switch working directory to NEW-WORKING-DIRECTORY."
-  (unless (string= idris-process-current-working-directory 
new-working-directory)
-    (idris-ensure-process-and-repl-buffer)
-    (let* ((path (if (> idris-protocol-version 1)
-                     (prin1-to-string new-working-directory)
-                   new-working-directory))
-           (eval-result (idris-eval `(:interpret ,(concat ":cd " path))))
-           (result-msg (or (car-safe eval-result) "")))
-      ;; Check if the message from Idris contains the new directory path.
-      ;; Before check drop the last character (slash) in the path
-      ;; as the message does not include it.
-      (if (string-match-p (file-truename (substring new-working-directory 0 
-1))
-                          result-msg)
-          (progn
-            (message result-msg)
-            (setq idris-process-current-working-directory 
new-working-directory))
-        (error "Failed to switch the working directory %s" eval-result)))))
+  (if (= idris-protocol-version 0)
+      (progn
+        (message "-t- idris-switch-working-directory connection not yet 
complete %s" idris-retry)
+        (sit-for 0.05)
+        (if (< 1 5)
+            (setq idris-retry (1+ idris-retry))
+          (idris-switch-working-directory new-working-directory)))
+    (setq idris-retry 0)
+    (unless (string= idris-process-current-working-directory 
new-working-directory)
+      (let* ((path (if (> idris-protocol-version 1)
+                       (prin1-to-string new-working-directory)
+                     new-working-directory))
+             (eval-result (idris-eval `(:interpret ,(concat ":cd " path))))
+             (result-msg (or (car-safe eval-result) "")))
+        ;; Check if the message from Idris contains the new directory path.
+        ;; Before check drop the last character (slash) in the path
+        ;; as the message does not include it.
+        (if (string-match-p (file-truename (substring new-working-directory 0 
-1))
+                            result-msg)
+            (progn
+              (message result-msg)
+              (setq idris-process-current-working-directory 
new-working-directory))
+          (error "Failed to switch the working directory %s" eval-result))))))
 
 (defun idris-list-holes-on-load ()
   "Use the user's settings from customize to determine whether to list the 
holes."



reply via email to

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