]> git.eshelyaron.com Git - dict.git/commitdiff
ADDED: new command for signaling a top-level from the Top-level Menu
authorEshel Yaron <me@eshelyaron.com>
Tue, 4 Oct 2022 11:21:42 +0000 (14:21 +0300)
committerEshel Yaron <me@eshelyaron.com>
Tue, 4 Oct 2022 19:56:19 +0000 (22:56 +0300)
* sweeprolog.el:
- sweeprolog-top-level-menu-signal: new command
- sweeprolog-top-level-menu-mode-map: bind it to s

sweeprolog.el

index ef34ae88669a0d46786180b9b0dd804329dab0b3..8d4d373424726d247d5398738c899f59d2bf54a9 100644 (file)
@@ -2572,6 +2572,14 @@ variable at point, if any."
                sweeprolog-top-level-menu-mode)
   (sweeprolog-top-level name))
 
+(defun sweeprolog-top-level-menu-signal (goal)
+  "Signal the thread of to Top-level Menu entry at point to run GOAL."
+  (interactive (list (read-string "Signal goal: ?- "))
+               sweeprolog-top-level-menu-mode)
+  (if-let ((tid (tabulated-list-get-id)))
+      (sweeprolog-signal-thread tid goal)
+    (user-error "No top-level menu entry here")))
+
 (defun sweeprolog-top-level-menu-kill ()
   "Kill the buffer of to the `sweep' Top-level Menu entry at point."
   (interactive "" sweeprolog-top-level-menu-mode)
@@ -2595,7 +2603,8 @@ variable at point, if any."
   :doc "Local keymap for `sweeprolog-top-level-menu-mode' buffers."
   "RET" #'sweeprolog-top-level-menu-go-to
   "k"   #'sweeprolog-top-level-menu-kill
-  "t"   #'sweeprolog-top-level-menu-new)
+  "t"   #'sweeprolog-top-level-menu-new
+  "s"   #'sweeprolog-top-level-menu-signal)
 
 (define-derived-mode sweeprolog-top-level-menu-mode
   tabulated-list-mode "sweep Top-level Menu"