[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/sweeprolog 12bddb3f75 117/166: ENHANCED: don't record one-
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/sweeprolog 12bddb3f75 117/166: ENHANCED: don't record one-character inputs in the top level history |
Date: |
Fri, 30 Sep 2022 04:59:30 -0400 (EDT) |
branch: elpa/sweeprolog
commit 12bddb3f75a21cb4b07b99c30757b51344b8c232
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>
ENHANCED: don't record one-character inputs in the top level history
---
NEWS.org | 8 ++++++++
sweep.el | 20 ++++++++++++++++----
2 files changed, 24 insertions(+), 4 deletions(-)
diff --git a/NEWS.org b/NEWS.org
index 0e459a18d2..9ce726fe15 100644
--- a/NEWS.org
+++ b/NEWS.org
@@ -27,6 +27,7 @@ Follows file specifications in =sweep-mode= buffers.
** =C-c C-o= is now bound to =sweep-find-file-at-point=.
+
* New user options available in =sweep= {{{version({{{input-file}}})}}}
** New user option =sweep-colourise-buffer-on-idle=
@@ -45,6 +46,13 @@ buffer.
This option determines the maximum size of a =sweep-mode= buffer for
which =sweep= will periodically update semantic highlighting on idle.
+** New user option =sweep-top-level-min-history-length=
+
+This option, set by default to 3, determines a minimum length for
+inputs inserted into =sweep= top-level history ring. The default value,
+3, avoids one character top-level responses from clobbering the
+history ring. This kind of inputs includes, for example, the =;=
+character typed to invoke backtracking.
* New keybindings in =sweep-prefix-map=
diff --git a/sweep.el b/sweep.el
index 8a30ea6831..7d0bfd0a6d 100644
--- a/sweep.el
+++ b/sweep.el
@@ -6,7 +6,7 @@
;; Maintainer: Eshel Yaron <me(at)eshelyaron(dot)com>
;; Keywords: prolog languages extensions
;; URL: https://git.sr.ht/~eshel/sweep
-;; Package-Version: 0.2.0
+;; Package-Version: 0.2.1
;; Package-Requires: ((emacs "28"))
;; This file is NOT part of GNU Emacs.
@@ -95,6 +95,15 @@ is used to find a the swipl executable."
:type 'function
:group 'sweep)
+(defcustom sweep-top-level-min-history-length 3
+ "Minimum input length to record in the `sweep-top-level' history.
+
+Inputs shorther than the value of this variable will not be
+inserted to the input history in `sweep-top-level-mode' buffers."
+ :package-version '((sweep . "0.2.1"))
+ :type 'string
+ :group 'sweep)
+
(defvar sweep-install-buffer-name "*Install sweep*"
"Name of the buffer used for compiling sweep-module.")
@@ -881,9 +890,9 @@ module name, F is a functor name and N is its arity."
(defun sweep-colourise-query (buffer)
(when (buffer-live-p buffer)
(with-current-buffer buffer
- (let* ((beg (cdr comint-last-prompt))
- (end (point-max))
- (query (buffer-substring-no-properties beg end)))
+ (when-let ((beg (cdr comint-last-prompt))
+ (end (point-max))
+ (query (buffer-substring-no-properties beg end)))
(with-silent-modifications
(font-lock-unfontify-region beg end))
(sweep-open-query "user"
@@ -976,6 +985,9 @@ Interactively, a prefix arg means to prompt for BUFFER."
(setq-local comint-prompt-regexp (rx line-start "?- ")
comint-input-ignoredups t
comint-prompt-read-only t
+ comint-input-filter (lambda (s)
+ (<
sweep-top-level-min-history-length
+ (length s)))
comint-delimiter-argument-list '(?,)
comment-start "%")
(add-hook 'post-self-insert-hook
#'sweep-top-level--post-self-insert-function nil t)
- [nongnu] elpa/sweeprolog 85ca3a5dc2 067/166: FIXED: bind SourceId in xref based completions, (continued)
- [nongnu] elpa/sweeprolog 85ca3a5dc2 067/166: FIXED: bind SourceId in xref based completions, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 21a4475306 112/166: Makefile: Allow specifying the path to emacs, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog ec01154a41 102/166: PORT: sweep.el: require Emacs version 28 for RTLD_GLOBAL, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog e991b1a92c 097/166: ENHANCED: (sweep-load-buffer): use read-buffer to choose a buffer, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog c69c6bad3c 084/166: FIXED: correctly identify the predicate defined at start of clause, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 586521712e 110/166: DOC: README.org: add ^:{} option, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 0b545cc192 114/166: ADDED: (sweep-indent-line-ends-with-prefix-operator): New function, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog c60df8e7e3 101/166: DOC: Loading buffers: new section, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 4c1e510bbf 125/166: FIXED: handle some more color terms, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 588cfb0f63 130/166: BUILD: Inline sweep.h in sweep.c, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 12bddb3f75 117/166: ENHANCED: don't record one-character inputs in the top level history,
ELPA Syncer <=
- [nongnu] elpa/sweeprolog f82827fdb0 093/166: ENHANCED: Display message if unable to find predicate location, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 0f1119fb75 118/166: FIXED: indentation after with inline comments, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog f9218dc461 123/166: PORT: use (eql sweep) instead of (eql 'sweep) in cl-defmethods..., ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 0db900634f 120/166: DOC: update commentary section in sweep.el, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 6f7aa88050 100/166: ENHANCED: (sweep-load-buffer): report results, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog 12fbadf13b 137/166: sweep.el: remove outdated sweep--compile-module function, ELPA Syncer, 2022/09/30
- [nongnu] elpa/sweeprolog c6066eabb9 144/166: ADDED: support imenu in sweep-mode buffers, ELPA Syncer, 2022/09/30
- [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