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

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

[nongnu] elpa/sweeprolog 6434715829 149/166: FIXED: use a more robust me


From: ELPA Syncer
Subject: [nongnu] elpa/sweeprolog 6434715829 149/166: FIXED: use a more robust mechanism for finding sweep-module
Date: Fri, 30 Sep 2022 04:59:34 -0400 (EDT)

branch: elpa/sweeprolog
commit 6434715829b7044081f319cd260dedef7135991b
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>

    FIXED: use a more robust mechanism for finding sweep-module
---
 sweep.el | 21 ++++++++++-----------
 sweep.pl |  9 ++++++++-
 2 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/sweep.el b/sweep.el
index 7ba846beb1..8ba8cabf0c 100644
--- a/sweep.el
+++ b/sweep.el
@@ -138,17 +138,16 @@ inserted to the input history in `sweep-top-level-mode' 
buffers."
 (declare-function sweep-cleanup       "sweep-module")
 
 (defun sweep--ensure-module ()
-  (let ((swipl-lib-dir (car
-                        (split-string-and-unquote
-                         (shell-command-to-string
-                          (concat
-                           (or sweep-swipl-path (executable-find "swipl"))
-                           " --dump-runtime-variables |"
-                           " grep PLLIBDIR |"
-                           " cut -f 2 -d = |"
-                           " cut -f 1 -d ';'"))))))
-    (load (expand-file-name "sweep-module" swipl-lib-dir))))
-
+  (let ((sweep-module-path (car
+                            (string-lines
+                             (shell-command-to-string
+                              (concat
+                               (or sweep-swipl-path (executable-find "swipl"))
+                               " -g"
+                               " write_sweep_module_location"
+                               " -t"
+                               " halt"))))))
+    (load sweep-module-path)))
 
 (defface sweep-debug-prefix-face
   '((default :inherit shadow))
diff --git a/sweep.pl b/sweep.pl
index de9be3e20e..844bd36f18 100644
--- a/sweep.pl
+++ b/sweep.pl
@@ -54,7 +54,8 @@
             sweep_prefix_ops/2,
             sweep_op_info/2,
             sweep_imenu_index/2,
-            sweep_module_path/2
+            sweep_module_path/2,
+            write_sweep_module_location/0
           ]).
 
 :- use_module(library(pldoc)).
@@ -738,3 +739,9 @@ sweep_imenu_index(Path, Index) :-
               term_string(PI, String)
             ),
             Index).
+
+write_sweep_module_location :-
+    absolute_file_name(foreign('sweep-module'),
+                       Path,
+                       [file_type(executable), access(read)]),
+    writeln(Path).



reply via email to

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