** =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=
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=
;; 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.
: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.")
(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"
(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)