]> git.eshelyaron.com Git - sweep.git/commitdiff
ENHANCED: allow user to specify location of swipl binary
authorJames N. V. Cash <james.cash@occasionallycogent.com>
Tue, 6 Sep 2022 19:30:01 +0000 (22:30 +0300)
committerEshel Yaron <me@eshelyaron.com>
Tue, 6 Sep 2022 19:30:01 +0000 (22:30 +0300)
sweep.el

index 0a3fc19b4e23a96480e50f5e5570632daedc34ee..37371ea18b09cff2f039da4e5ad26846c8cdcded 100644 (file)
--- a/sweep.el
+++ b/sweep.el
   "SWI-Prolog Embedded in Emacs."
   :group 'prolog)
 
+(defcustom sweep-swipl-path nil
+  "Path to the swipl binary.
+When non-nil, this is used by the embedded SWI-Prolog runtime to
+locate its \"home\" directory."
+  :package-version '((sweep . "0.1.1"))
+  :type 'string
+  :group 'sweep)
+
 (defcustom sweep-messages-buffer-name "*sweep Messages*"
   "The name of the buffer to use for logging Prolog messages."
   :package-version '((sweep . "0.1.1"))
 
 (defun sweep-init ()
   (apply #'sweep-initialize
-         (cons (expand-file-name "bin/swipl" (file-name-directory
-                                              load-file-name))
+         (cons (or sweep-swipl-path
+                   (expand-file-name "bin/swipl" (file-name-directory
+                                                  load-file-name)))
                (cons "-q" (cons "--no-signals" sweep-init-args))))
   (sweep-setup-message-hook)
   (sweep-start-prolog-server))