]> git.eshelyaron.com Git - dict.git/commitdiff
ADDED: new command for signaling the current top-level
authorEshel Yaron <me@eshelyaron.com>
Tue, 4 Oct 2022 11:20:05 +0000 (14:20 +0300)
committerEshel Yaron <me@eshelyaron.com>
Tue, 4 Oct 2022 19:56:19 +0000 (22:56 +0300)
* sweeprolog.el:
- sweeprolog-top-level-signal-current: new command
- sweeprolog-top-level-mode-map: bind it to C-c C-c

sweeprolog.el

index 51e75221003e66c9643a2ba0e184c3ea7ffcb8f1..ef34ae88669a0d46786180b9b0dd804329dab0b3 100644 (file)
@@ -1585,6 +1585,17 @@ Interactively, a prefix arg means to prompt for BUFFER."
                                                 (get-buffer buffer))
                             goal))
 
+(defun sweeprolog-top-level-signal-current (goal)
+  "Signal the current top-level thread to run GOAL."
+  (interactive "MSignal goal: ?- " sweeprolog-top-level-mode)
+  (sweeprolog-signal-thread sweeprolog-top-level-thread-id goal))
+
+(defvar sweeprolog-top-level-mode-map
+  (let ((map (make-sparse-keymap)))
+    (define-key map (kbd "C-c C-c") #'sweeprolog-top-level-signal-current)
+    map)
+  "Keymap for `sweeprolog-top-level-mode'.")
+
 ;;;###autoload
 (define-derived-mode sweeprolog-top-level-mode comint-mode "sweep Top-level"
   "Major mode for interacting with an inferior Prolog interpreter."