From: Eshel Yaron Date: Tue, 4 Oct 2022 11:20:05 +0000 (+0300) Subject: ADDED: new command for signaling the current top-level X-Git-Tag: v0.5.0~4 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5913f010b69a88d845492bbe3e5f23f78ba32d64;p=dict.git ADDED: new command for signaling the current top-level * sweeprolog.el: - sweeprolog-top-level-signal-current: new command - sweeprolog-top-level-mode-map: bind it to C-c C-c --- diff --git a/sweeprolog.el b/sweeprolog.el index 51e7522..ef34ae8 100644 --- a/sweeprolog.el +++ b/sweeprolog.el @@ -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."