]> git.eshelyaron.com Git - dict.git/commitdiff
ENHANCED: make the prompts used in sweep-find-* customizable
authorEshel Yaron <me@eshelyaron.com>
Sat, 27 Aug 2022 18:19:01 +0000 (21:19 +0300)
committerEshel Yaron <me@eshelyaron.com>
Sat, 27 Aug 2022 18:19:01 +0000 (21:19 +0300)
sweep.el

index ed8c7af17a0e2781ec643073eb046fab89128cb2..012bd05abded8213854949eac6805018634a457e 100644 (file)
--- a/sweep.el
+++ b/sweep.el
   "SWI-Prolog Embedded in Emacs."
   :group 'prolog)
 
+(defcustom sweep-read-module-prompt "Module: "
+  "Prompt used for reading a Prolog module name from the minibuffer."
+  :package-version '((sweep . "0.1.0"))
+  :type 'string
+  :group 'sweep)
+
+(defcustom sweep-read-predicate-prompt "Predicate: "
+  "Prompt used for reading a Prolog precicate name from the minibuffer."
+  :package-version '((sweep . "0.1.0"))
+  :type 'string
+  :group 'sweep)
+
 (defvar sweep-install-buffer-name "*Install sweep*"
   "Name of the buffer used for compiling sweep-module.")
 
                   (expand-file-name "sweep.pl"
                                     (sweep-home-directory)))
 
-(declare-function sweep-initialize "sweep-module")
+(declare-function sweep-initialize    "sweep-module")
 (declare-function sweep-initialized-p "sweep-module")
-(declare-function sweep-open-query "sweep-module")
-(declare-function sweep-cut-query "sweep-module")
-(declare-function sweep-close-query "sweep-module")
-(declare-function sweep-cleanup "sweep-module")
+(declare-function sweep-open-query    "sweep-module")
+(declare-function sweep-cut-query     "sweep-module")
+(declare-function sweep-close-query   "sweep-module")
+(declare-function sweep-next-solution "sweep-module")
+(declare-function sweep-cleanup       "sweep-module")
 
 (defun sweep-predicates-collection ()
   (sweep-open-query "user" "sweep" "sweep_predicates_collection" nil)
                     (if val
                         (concat (make-string (- 64 (length key)) ? ) (car val))
                       nil))))))
-    (completing-read "Predicate: " col)))
+    (completing-read sweep-read-predicate-prompt col)))
 
 ;;;###autoload
 (defun sweep-find-predicate (mfn)
@@ -134,7 +147,7 @@ module name, F is a functor name and N is its arity."
                             (if des
                                 (concat pat (make-string (max 0 (- 80 (length pat))) ? ) des)
                               pat)))))))
-    (completing-read "Module: " col)))
+    (completing-read sweep-read-module-prompt col)))
 
 ;;;###autoload
 (defun sweep-find-module (mod)