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

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

[nongnu] elpa/sweeprolog 25bda86c48 032/166: Use load-file-path instead


From: ELPA Syncer
Subject: [nongnu] elpa/sweeprolog 25bda86c48 032/166: Use load-file-path instead of custom hack
Date: Fri, 30 Sep 2022 04:59:23 -0400 (EDT)

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

    Use load-file-path instead of custom hack
---
 Makefile |  2 +-
 sweep.c  |  2 +-
 sweep.el | 11 ++++-------
 3 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/Makefile b/Makefile
index 6544f4ecb7..f5758a24be 100644
--- a/Makefile
+++ b/Makefile
@@ -33,7 +33,7 @@ CMAKE_OPTIONS += -DSWIPL_INSTALL_IN_LIB=ON
 
 .PHONY: clean all swipl check
 
-all: $(TARGET) $(BASENAME).info
+all: $(TARGET)
 
 $(OBJECT): $(SOURCE) lib/libswipl.$(SOEXT)
        $(CC) $(CFLAGS) -o $@ -c $(SOURCE)
diff --git a/sweep.c b/sweep.c
index bbb3f99b71..df14b49db1 100644
--- a/sweep.c
+++ b/sweep.c
@@ -495,7 +495,7 @@ ARG1 is a string denoting the context module for the 
query.\n\
 ARG2 and ARG3 are strings designating the module and predicate name of the 
Prolog predicate to invoke, which must be of arity 2.\n\
 ARG4 is any object that can be converted to a Prolog term, and will be passed 
as the first argument of the invoked predicate.\n\
 The second argument of the predicate is left unbound and is assumed to treated 
by the invoked predicate as an output variable.\n\
-If ARG5 is non-nil, reverse the order of the predicate arguments such that the 
first argument is the output variable and the second argument is the input term 
derived from ARG4.
+If ARG5 is non-nil, reverse the order of the predicate arguments such that the 
first argument is the output variable and the second argument is the input term 
derived from ARG4.\n\
 Further instantiations of the output variable can be examined via 
`sweep-next-solution'.",
                        NULL);
   emacs_value args_open_query[] = {symbol_open_query, func_open_query};
diff --git a/sweep.el b/sweep.el
index 4b21eb130f..0ba1589161 100644
--- a/sweep.el
+++ b/sweep.el
@@ -26,10 +26,6 @@
 
 ;;; Code:
 
-(defun sweep-home-directory ()
-  "Return the installation directory of `sweep'."
-  (file-name-directory (locate-library "sweep.el" t)))
-
 (defgroup sweep nil
   "SWI-Prolog Embedded in Emacs."
   :group 'prolog)
@@ -63,7 +59,7 @@
 
 (defcustom sweep-init-args (list (expand-file-name
                                   "sweep.pl"
-                                  (sweep-home-directory)))
+                                  (file-name-directory load-file-name)))
   "List of strings used as initialization arguments for Prolog."
   :package-version '((sweep "0.1.0"))
   :type '(list string)
@@ -74,7 +70,7 @@
   "Compile sweep-module."
   (interactive)
   (let* ((sweep-directory
-          (shell-quote-argument (sweep-home-directory)))
+          (shell-quote-argument (file-name-directory load-file-name)))
          (make-commands
           (concat
            "cd " sweep-directory "; make; cd -"))
@@ -96,7 +92,8 @@
 
 (defun sweep-init ()
   (apply #'sweep-initialize
-         (cons (expand-file-name "bin/swipl" (sweep-home-directory))
+         (cons (expand-file-name "bin/swipl" (file-name-directory
+                                              load-file-name))
                (cons "-q" sweep-init-args))))
 
 (defun sweep-predicates-collection ()



reply via email to

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