]> git.eshelyaron.com Git - dict.git/commitdiff
Cleanup
authorEshel Yaron <me@eshelyaron.com>
Sat, 27 Aug 2022 07:05:10 +0000 (10:05 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sat, 27 Aug 2022 07:05:10 +0000 (10:05 +0300)
sweep.el
sweep.h

index 961eac912803b70e5085bc890b68131c9920cedc..5e8791f53f848f2e0c8d739b6e199e5f97c2c3eb 100644 (file)
--- a/sweep.el
+++ b/sweep.el
 (defvar sweep-install-buffer-name "*Install sweep*"
   "Name of the buffer used for compiling sweep-module.")
 
+(defun sweep-home-directory ()
+  (file-name-directory (locate-library "sweep.el" t)))
+
 ;;;###autoload
 (defun sweep-module-compile ()
   "Compile sweep-module."
   (interactive)
   (let* ((sweep-directory
-          (shell-quote-argument
-           (file-name-directory (locate-library "sweep.el" t))))
+          (shell-quote-argument (sweep-home-directory)))
          (make-commands
           (concat
            "cd " sweep-directory "; make; cd -"))
   (if (y-or-n-p "Sweep needs `sweep-module' to work.  Compile it now? ")
       (progn
         (sweep-module-compile)
-        (require 'sweep-module))
-    (error "Sweep will not work until `sweep-module' is compiled!")))
+        (require 'sweep-module)
+        (sweep-initialize (expand-file-name "bin/swipl"
+                                            (sweep-home-directory))
+                          "-q"
+                          (expand-file-name "sweep.pl"
+                                            (sweep-home-directory))))
+  (error "Sweep will not work until `sweep-module' is compiled!")))
 
 (declare-function sweep-initialize "sweep-module")
 (declare-function sweep-initialized-p "sweep-module")
   (interactive (list (sweep-read-module-name)))
   (find-file (sweep-module-path mod)))
 
-;; (add-to-list 'load-path (expand-file-name  "~/checkouts/sweep/"))
+;;;; Testing:
 
+;; (add-to-list 'load-path (file-name-directory (buffer-file-name)))
 ;; (require 'sweep)
 
-;; (sweep-initialized-p)
-;; (sweep-initialize (executable-find "swipl") "-q" (expand-file-name "sweep.pl" (file-name-directory (locate-library "sweep.el" t))))
-
-
 (provide 'sweep)
+
 ;;; sweep.el ends here
diff --git a/sweep.h b/sweep.h
index d1e1efcdd31f5852b5e08b59c279e23666dd1575..03d7324cae02a9118d6ef35f6fbfd980285de52c 100644 (file)
--- a/sweep.h
+++ b/sweep.h
@@ -5,11 +5,11 @@
 #include <SWI-Prolog.h>
 #include <SWI-Stream.h>
 
-static int value_to_term(emacs_env*, emacs_value, term_t);
+static int         value_to_term(emacs_env*, emacs_value, term_t);
 static emacs_value term_to_value(emacs_env*, term_t);
 static char *      estring_to_cstring(emacs_env*, emacs_value, ptrdiff_t*);
-static int         estring_to_atom(emacs_env*, emacs_value, term_t);
-static IOSTREAM *  estring_to_stream(emacs_env*, emacs_value);
 static void        ethrow(emacs_env*, const char*);
+/* static int         estring_to_atom(emacs_env*, emacs_value, term_t); */
+/* static IOSTREAM *  estring_to_stream(emacs_env*, emacs_value); */
 
 #endif /*_SWEEP_H*/