(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))
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)).
term_string(PI, String)
),
Index).
+
+write_sweep_module_location :-
+ absolute_file_name(foreign('sweep-module'),
+ Path,
+ [file_type(executable), access(read)]),
+ writeln(Path).