[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/sweeprolog 353ef846fb 035/166: ENHANCED: Pass keystrokes t
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/sweeprolog 353ef846fb 035/166: ENHANCED: Pass keystrokes to the top-level directly when appropriate |
Date: |
Fri, 30 Sep 2022 04:59:23 -0400 (EDT) |
branch: elpa/sweeprolog
commit 353ef846fb4df9ea49f486f7ba06d392df5d8791
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>
ENHANCED: Pass keystrokes to the top-level directly when appropriate
---
sweep.el | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/sweep.el b/sweep.el
index ba4e34240f..2fd69541a2 100644
--- a/sweep.el
+++ b/sweep.el
@@ -257,6 +257,17 @@ module name, F is a functor name and N is its arity."
sweep-prolog-server-port))
(select-window (display-buffer buf))))
+(defun sweep-top-level--post-self-insert-function ()
+ (when-let ((pend (cdr comint-last-prompt)))
+ (let* ((pstart (car comint-last-prompt))
+ (prompt (buffer-substring-no-properties pstart pend)))
+ (when (and (= (point) (1+ pend))
+ (not (string-empty-p prompt))
+ (not (string= "?- " (substring prompt
+ (- pend pstart 3)
+ (- pend pstart))))
+ (not (string= "| " prompt)))
+ (comint-send-input)))))
;;;###autoload
(define-derived-mode sweep-top-level-mode comint-mode "sweep Top-level"
@@ -266,7 +277,8 @@ module name, F is a functor name and N is its arity."
comint-input-ignoredups t
comint-prompt-read-only t
comint-delimiter-argument-list '(?,)
- comment-start "%"))
+ comment-start "%")
+ (add-hook 'post-self-insert-hook
#'sweep-top-level--post-self-insert-function nil t))
(sweep--ensure-module)
- [nongnu] elpa/sweeprolog 8179cb4204 135/166: FIXED: qualify calls to sweep_funcall/2, (continued)
- [nongnu] elpa/sweeprolog 8179cb4204 135/166: FIXED: qualify calls to sweep_funcall/2, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 7085c2e830 142/166: ADDED: sweep-mode: make sexp-based commands work on Prolog terms, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 6434715829 149/166: FIXED: use a more robust mechanism for finding sweep-module, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 69be982c41 150/166: FIXED: don't rely on string-lines added in Emacs 28.1, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 3e6fae1244 146/166: DOC: fix typos in README.org, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 6517af47b3 134/166: FIXED: sweep-init-args separate arguments, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 24a1e14ee9 151/166: MODIFIED: Breaking change: rename sweep.el to sweeprolog.el..., ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 13c7551015 156/166: ENHANCED: only fontify visible sweeprolog-mode buffers on idle, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog cada0d3871 166/166: DOC: document quasi-quotation highlighting in the manual, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 85af4010e8 158/166: Use a public mailing list in the Maintainer package header, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 353ef846fb 035/166: ENHANCED: Pass keystrokes to the top-level directly when appropriate,
ELPA Syncer <=
- [nongnu] elpa/sweeprolog 72cc4d516b 014/166: PORT: detect linux vs macOS shared object extension in Makefile, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog e029eb3e3c 016/166: update .build.yml, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 0aa0a46631 017/166: PORT: don't use clang's -fdiagnostics-absolute-paths, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog d4a501e9af 020/166: PORT: use rpath linker option, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog b75179cc6e 022/166: Revert rpath tweaks, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 2f5dd9f13c 024/166: FIXED: Use more robust Prolog to C string conversion, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 5f0f223318 023/166: Use LD_PRELOAD for testing, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog ea04f467b9 027/166: ADDED: sweep-pack-install for interactively installing packs, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 25bda86c48 032/166: Use load-file-path instead of custom hack, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog c5b1504ca8 033/166: ADDED: sweep-top-level command and appropriate mode, ELPA Syncer, 2022/09/30