]> git.eshelyaron.com Git - sweep.git/log
sweep.git
14 months agoAnnounce recent changes in NEWS.org and bump version to 0.25.5 V9.1.17-0.25.5
Eshel Yaron [Fri, 20 Oct 2023 18:31:14 +0000 (20:31 +0200)]
Announce recent changes in NEWS.org and bump version to 0.25.5

14 months agoExpand Top-level documentation
Eshel Yaron [Fri, 20 Oct 2023 18:14:01 +0000 (20:14 +0200)]
Expand Top-level documentation

* sweep.texi (Top-level Interaction): New section, replaces...
(Top-level Completion): Remove.
(The Prolog Top-level): Update menu and document ANSI
escape sequence handling.

14 months agoEmit highlighted messages in the top-level
Eshel Yaron [Fri, 20 Oct 2023 15:58:47 +0000 (17:58 +0200)]
Emit highlighted messages in the top-level

* sweep.pl: Ensure 'library(ansi_term)' gets loaded.
(sweep_top_level_client/4): Set the flag 'verbose' to 'normal' in
order to enable informational messages, and set 'color_term' to 'true'
to enable highlighting when using a pty.

14 months agoSet Prolog flag 'tty_control' to 'true' when using pty
Eshel Yaron [Fri, 20 Oct 2023 14:51:15 +0000 (17:51 +0300)]
Set Prolog flag 'tty_control' to 'true' when using pty

When 'sweeprolog-top-level-use-pty' is non-nil, let the Prolog
top-level thread know that it controls the tty.  This affects some
aspects of the top-level interaction, namely in the presence of choice
points.  A significant benefit is that Prolog ensures that the tty
does not echo input, so we can stop setting 'comint-process-echoes'
which had the adverse effect of blocking Emacs when output stalls on
non-echoing terminals.

* sweep.pl (sweep_top_level_client/3): Become
'sweep_top_level_client/4'.  New argument says whether the top-level
controls the tty.
(sweep_top_level_pty_client/1,sweep_top_level_server_loop_/2): Adjust.
* sweeprolog.el (sweeprolog-top-level-buffer): Stop setting
'comint-process-echoes'.
(sweeprolog-top-level--post-self-insert-function): When using a tty,
send single character responses directly and assume that the top-level
echoes them back.

14 months ago; * sweep.texi: Fix typo
Eshel Yaron [Thu, 19 Oct 2023 08:17:35 +0000 (10:17 +0200)]
; * sweep.texi: Fix typo

14 months ago* sweep.texi (Things To Do): Add new to-do items
Eshel Yaron [Sun, 15 Oct 2023 16:19:54 +0000 (18:19 +0200)]
* sweep.texi (Things To Do): Add new to-do items

14 months ago; Adapt tests following last change
Eshel Yaron [Sun, 15 Oct 2023 11:11:13 +0000 (13:11 +0200)]
; Adapt tests following last change

14 months agoSort predicate completion candidates by functor length
Eshel Yaron [Sun, 15 Oct 2023 10:37:36 +0000 (12:37 +0200)]
Sort predicate completion candidates by functor length

* sweeprolog.el (sweeprolog-predicate-completion-sort): New function.
(sweeprolog-predicate-completion-candidates): Use it as
`display-sort-function`.

14 months agoAnnounce recent changes in NEWS.org and bump version to 0.25.4 V9.1.16-sweep-0.25.4
Eshel Yaron [Sun, 8 Oct 2023 11:55:56 +0000 (13:55 +0200)]
Announce recent changes in NEWS.org and bump version to 0.25.4

14 months ago; Improve detection of unsafe goal extraction
Eshel Yaron [Sun, 8 Oct 2023 10:35:09 +0000 (12:35 +0200)]
; Improve detection of unsafe goal extraction

* sweep.pl (sweep_extract_goal_update_safety/4): Adjust.
* sweeprolog-tests.el: Add more tests.

14 months agoFix extracting goals in right associative operator chains
Eshel Yaron [Sun, 8 Oct 2023 10:13:38 +0000 (12:13 +0200)]
Fix extracting goals in right associative operator chains

* sweep.pl (push_assoc_arg/9): New helper predicate.
(sweep_extract_goal_term/21): Recognize and correctly handle right
associative operator chains.
(sweep_extract_goal_update_clause_string/7): Fix handling of nested
disjunctions.
* sweeprolog-tests.el: Add more goal extraction tests.
* sweeprolog.el (sweeprolog-extract-region-to-predicate): Add missing
call to 'format'.

14 months agoAnnounce recent changes in NEWS.org and bump version to 0.25.3 V9.1.16-sweep-0.25.3
Eshel Yaron [Sat, 7 Oct 2023 13:07:40 +0000 (15:07 +0200)]
Announce recent changes in NEWS.org and bump version to 0.25.3

14 months ago; Fix excluding new predicate body from replacement after extraction
Eshel Yaron [Sat, 7 Oct 2023 12:58:38 +0000 (14:58 +0200)]
; Fix excluding new predicate body from replacement after extraction

14 months agoENHANCED: Improve 'sweeprolog-extract-region-to-predicate'
Eshel Yaron [Sat, 7 Oct 2023 12:38:45 +0000 (14:38 +0200)]
ENHANCED: Improve 'sweeprolog-extract-region-to-predicate'

Teach 'sweeprolog-extract-region-to-predicate' about existentially
quantified goals and lambda terms.

* sweep.pl (sweep_term_variable_names/2): Remove from export list.
* sweep.pl (sweep_extract_goal/2): New public predicate.
* sweeprolog.el (sweeprolog-extract-region-to-predicate): Use it.
* sweeprolog-tests.el: Test it.
* sweep.texi (Extract Goal): Update documentation.

14 months ago; Improve user option docstring
Eshel Yaron [Sat, 7 Oct 2023 12:37:13 +0000 (14:37 +0200)]
; Improve user option docstring

* sweeprolog.el
(sweeprolog-query-replace-term-include-match-function): Improve docstring.

14 months ago; * sweeprolog.el (sweeprolog-query-replace-term): Update comment
Eshel Yaron [Sat, 7 Oct 2023 12:36:51 +0000 (14:36 +0200)]
; * sweeprolog.el (sweeprolog-query-replace-term): Update comment

14 months ago; Remove unused function 'sweeprolog-token-boundaries'
Eshel Yaron [Sat, 7 Oct 2023 12:30:11 +0000 (14:30 +0200)]
; Remove unused function 'sweeprolog-token-boundaries'

14 months ago; New helper predicate 'pos_bounds/3'
Eshel Yaron [Sat, 7 Oct 2023 12:29:50 +0000 (14:29 +0200)]
; New helper predicate 'pos_bounds/3'

14 months ago; Fix precedence calculation for unary operator arguments
Eshel Yaron [Sat, 7 Oct 2023 12:24:30 +0000 (14:24 +0200)]
; Fix precedence calculation for unary operator arguments

14 months ago; Recognize ext-quantified goal positions as callable
Eshel Yaron [Sat, 7 Oct 2023 12:21:31 +0000 (14:21 +0200)]
; Recognize ext-quantified goal positions as callable

14 months ago; Add missing ':type' for 'sweeprolog-top-level-use-pty'
Eshel Yaron [Wed, 27 Sep 2023 17:02:52 +0000 (19:02 +0200)]
; Add missing ':type' for 'sweeprolog-top-level-use-pty'

14 months ago; Silence some byte-complier warnings
Eshel Yaron [Wed, 27 Sep 2023 17:01:33 +0000 (19:01 +0200)]
; Silence some byte-complier warnings

15 months ago; Fix off-by-one in end of next token position for parentheses
Eshel Yaron [Tue, 26 Sep 2023 21:30:42 +0000 (23:30 +0200)]
; Fix off-by-one in end of next token position for parentheses

* sweeprolog.el (sweeprolog-next-token-boundaries): Return correct end
of token position for parentheses.

* sweeprolog-tests.el (up-list): New test.

15 months ago; Avoid relying on 'diff-mode' faces
Eshel Yaron [Sun, 24 Sep 2023 20:24:01 +0000 (22:24 +0200)]
; Avoid relying on 'diff-mode' faces

* sweeprolog.el (sweeprolog-query-replace-term-prompt-old)
(sweeprolog-query-replace-term-prompt-new): New faces.
(sweeprolog-query-replace-term): Use them instead of 'diff-mode'
faces.

15 months ago; Fix filtering of the just created body when extracting goal
Eshel Yaron [Sun, 24 Sep 2023 19:53:13 +0000 (21:53 +0200)]
; Fix filtering of the just created body when extracting goal

* sweeprolog (sweeprolog-extract-region-to-predicate): When searching
and replacing other goals subsumed by the extracted goal, use a more
robust check to filter out the newly created body term from the search
matches.

15 months ago; (sweep_replace_term_r/12): Fix qualified head classification
Eshel Yaron [Sun, 24 Sep 2023 15:17:20 +0000 (17:17 +0200)]
; (sweep_replace_term_r/12): Fix qualified head classification

15 months ago; (sweep_replace_update_state/7): Fix SSU guard classification
Eshel Yaron [Sat, 23 Sep 2023 20:09:19 +0000 (22:09 +0200)]
; (sweep_replace_update_state/7): Fix SSU guard classification

15 months agoAnnounce recent changes in NEWS.org and bump version to 0.25.2 V9.1.15-sweep-0.25.2
Eshel Yaron [Sat, 23 Sep 2023 14:42:22 +0000 (16:42 +0200)]
Announce recent changes in NEWS.org and bump version to 0.25.2

15 months agoExtract subsumed goals when extracting goal to predicate
Eshel Yaron [Sat, 23 Sep 2023 13:31:07 +0000 (15:31 +0200)]
Extract subsumed goals when extracting goal to predicate

Extend 'sweeprolog-extract-region-to-predicate' with the ability to
replace other goals in the current buffer that are subsumed by the
extracted goal with calls to the predicate this command creates.
'sweeprolog-extract-region-to-predicate' now does this when it is
called with a prefix argument.  Also make
'sweeprolog-insert-term-dwim' propagate the prefix argument to
functions in 'sweeprolog-insert-term-functions'.

* sweeprolog.el (sweeprolog-insert-term-dwim): Add ARG argument and
pass it to functions listed...
(sweeprolog-insert-term-functions): ...here.  Adjust docstring.
(sweeprolog-maybe-insert-next-clause)
(sweeprolog-maybe-define-predicate)
(sweeprolog-maybe-extract-region-to-predicate): Adjust accordingly.
(sweeprolog-default-new-predicate-location): Go to end of line in case
there's a comment on the last line of the current predicate
definition.
(sweeprolog-query-replace-term-include-match-function): New variable.
(sweeprolog-query-replace-term): Use it.
(sweeprolog-extract-region-to-predicate): Add ALL argument.  When
non-nil, suggest replacing all goals in the buffer that are subsumbed
by the extracted goal with calls to the newly defined predicate.

15 months ago; Improve documentation about shutting down Prolog
Eshel Yaron [Fri, 22 Sep 2023 20:21:34 +0000 (22:21 +0200)]
; Improve documentation about shutting down Prolog

* sweeprolog.el (sweeprolog-shutdown): Tweak and make interactive.
* sweep.texi (Initialization): Document it, reorganize.

15 months ago; Documentation fixes
Eshel Yaron [Fri, 22 Sep 2023 20:18:37 +0000 (22:18 +0200)]
; Documentation fixes

* sweep.texi (Top, Editing Prolog Code): Mention "Term Replace" in
menus.
(Main Features, Architecture, Alternatives): Mark as sections rather
than chapters.

15 months agoAnnounce recent changes in NEWS.org and bump version to 0.25.1 V9.1.15-sweep-0.25.1
Eshel Yaron [Fri, 22 Sep 2023 15:04:26 +0000 (17:04 +0200)]
Announce recent changes in NEWS.org and bump version to 0.25.1

15 months agoADDED: new command 'sweeprolog-query-replace-term'
Eshel Yaron [Wed, 20 Sep 2023 11:00:00 +0000 (13:00 +0200)]
ADDED: new command 'sweeprolog-query-replace-term'

This patch extends the Term Search infrastructure to support
search-and-replace operations.  Namely, we replace the predicate
'sweep_term_search/2' with a new predicate 'sweep_term_replace/2' that
subsumes the functionality of the former.  The command
'sweeprolog-term-search' is greatly simplified and adjusted to work
with this new predicate, and we introduce a new command,
'sweeprolog-query-replace-term', that exposes the new
search-and-replace facility of 'sweep_term_replace/2' in an
interactive UI inspired by 'query-replace'.

* sweep.pl (sweep_term_search/2): Remove in favor of...
(sweep_term_replace/2): New predicate.
* sweeprolog.el: (sweeprolog-term-replace-edits): New function.
(sweeprolog-term-search): Rewrite.
(sweeprolog-term-search-last-search)
(sweeprolog-term-search-overlays)
(sweeprolog-term-search-repeat-count)
(sweeprolog-term-search-repeat-backward)
(sweeprolog-term-search-repeat-forward)
(sweeprolog-term-search-abort)
(sweeprolog-term-search-in-buffer)
(sweeprolog-term-search-next)
(sweeprolog-term-search-map): Remove, unused.
(sweeprolog-query-replace-term): New command.
(sweeprolog-mode-map): Bind it.
* sweeprolog-tests.el (term-search)
* sweep.texi (Term Search): Adjust.
(Term Replace): New section.

15 months agoAnnounce recent changes in NEWS.org and bump version to 0.25.0 V9.1.15-sweep-0.25.0
Eshel Yaron [Sun, 17 Sep 2023 07:44:12 +0000 (09:44 +0200)]
Announce recent changes in NEWS.org and bump version to 0.25.0

15 months ago; * sweeprolog.el: Add docstrings for recently added functions
Eshel Yaron [Sun, 17 Sep 2023 06:44:56 +0000 (08:44 +0200)]
; * sweeprolog.el: Add docstrings for recently added functions

15 months agoSet 'comint-process-echoes' for top-levels that use a tty
Eshel Yaron [Sat, 16 Sep 2023 21:00:06 +0000 (23:00 +0200)]
Set 'comint-process-echoes' for top-levels that use a tty

15 months agoImprove top-level input fontification
Eshel Yaron [Sat, 16 Sep 2023 20:28:02 +0000 (22:28 +0200)]
Improve top-level input fontification

15 months agoImprove top-level threads management and cleanup
Eshel Yaron [Sat, 16 Sep 2023 18:50:47 +0000 (20:50 +0200)]
Improve top-level threads management and cleanup

* sweep.pl (sweep_top_level_thread_buffer/2): Remove predicate.
(sweep_top_level_threads/2): Remove in favor of...
(sweep_list_threads/2): New predicate.
(sweep_accept_top_level_client/2)
(sweep_top_level_start_pty/2): Return new thread id.
(sweep_cleanup_threads/0,2)
(sweep_create_thread/2,3)
(sweep_thread_start/0)
(sweep_thread_at_exit/0)
(sweep_supervisor_start/1)
(sweep_supervisor_loop/1)
(sweep_kill_thread/2)
(sweep_cleanup_thread/1): New predicates.

* sweeprolog.el (sweeprolog-init): Arrange for Sweep to shutdown
gracefully when Emacs is killed.
(sweeprolog-maybe-kill-top-levels)
(sweeprolog-maybe-shutdown)
(sweeprolog-shutdown)
(sweeprolog-top-level-maybe-delete-process)
(sweeprolog-top-level-delete-process): New functions.
(sweeprolog-restart)
(sweeprolog-top-level-buffer): Adapt.
(sweeprolog-top-level--populate-thread-id): Remove function.

15 months agoCheck that top-level thread is alive when signaling it
Eshel Yaron [Fri, 15 Sep 2023 08:08:04 +0000 (10:08 +0200)]
Check that top-level thread is alive when signaling it

* sweeprolog.el (sweeprolog-top-level-signal-current): Delete stale
pty "process" when trying to signal a top-level thread that has
already exited.

15 months ago; Don't refuse to kill top-level buffer with deleted process
Eshel Yaron [Thu, 14 Sep 2023 20:48:30 +0000 (22:48 +0200)]
; Don't refuse to kill top-level buffer with deleted process

15 months ago; Fix error on Emacs 27 with no 'font-lock-keywords'
Eshel Yaron [Thu, 14 Sep 2023 20:47:07 +0000 (22:47 +0200)]
; Fix error on Emacs 27 with no 'font-lock-keywords'

15 months agoENHANCED: Support pty top-level communication instead of TCP
Eshel Yaron [Thu, 14 Sep 2023 16:28:16 +0000 (18:28 +0200)]
ENHANCED: Support pty top-level communication instead of TCP

Add the ability for top-level buffers to communicate with their
backing threads via pty instead of a local TCP connection.  This is
controlled by a new user option, enabled by default on systems where
Emacs can creates a pty.

* sweep.pl (sweep_top_level_start_pty/2): New predicate.
* sweeprolog.el (sweeprolog-top-level-use-pty): New user option.
(sweeprolog-top-level-buffer): Use it.
* sweep.texi (The Prolog Top-level): Document it.

15 months agoProvide basic 'prettify-symbols-alist' in Sweep Prolog mode
Eshel Yaron [Thu, 14 Sep 2023 16:23:48 +0000 (18:23 +0200)]
Provide basic 'prettify-symbols-alist' in Sweep Prolog mode

* sweeprolog.el (sweeprolog-mode): set a local value for
'prettify-symbols-alist' that renders the neck operator as a unicode
left arrow.

15 months agoSupport Prettify Symbols and similar minor modes
Eshel Yaron [Thu, 14 Sep 2023 16:20:33 +0000 (18:20 +0200)]
Support Prettify Symbols and similar minor modes

* sweeprolog.el (sweeprolog-analyze-some-terms): Call
'font-lock-fontify-keywords-region' to support minor modes that
rely on 'font-lock-keywords'.

15 months ago; * sweeprolog.el (sweeprolog-hole): Avoid increasing text size
Eshel Yaron [Thu, 14 Sep 2023 16:18:19 +0000 (18:18 +0200)]
; * sweeprolog.el (sweeprolog-hole): Avoid increasing text size

15 months ago; * sweep.texi (Extract Goal): Improve indexing
Eshel Yaron [Sat, 9 Sep 2023 14:36:55 +0000 (16:36 +0200)]
; * sweep.texi (Extract Goal): Improve indexing

15 months agoAnnounce recent changes in NEWS.org and bump version to 0.24.1 V9.1.15-sweep-0.24.1
Eshel Yaron [Sat, 9 Sep 2023 07:57:31 +0000 (09:57 +0200)]
Announce recent changes in NEWS.org and bump version to 0.24.1

15 months agoOnly extract goals to separate predicates, not data terms
Eshel Yaron [Sat, 9 Sep 2023 07:32:38 +0000 (09:32 +0200)]
Only extract goals to separate predicates, not data terms

* sweeprolog.el (sweeprolog-context-menu-for-region)
(sweeprolog-maybe-extract-region-to-predicate): Check that the region
starts in a callable position.
(sweeprolog-extract-region-to-predicate): Reanalyze the buffer as a
last step.
* sweep.texi: Adjust.

15 months agoOnly enable right-click actions on region when click is in region
Eshel Yaron [Fri, 8 Sep 2023 20:29:06 +0000 (22:29 +0200)]
Only enable right-click actions on region when click is in region

* sweeprolog.el (sweeprolog-context-menu-region-beg-at-click)
(sweeprolog-context-menu-region-end-at-click): New variables.
(sweeprolog-context-menu-function): Let-bind them.
(sweeprolog-context-menu-for-region): Use them to reliably check that
click is actually inside the selected region.

15 months ago; * sweep.texi: Minor improvements
Eshel Yaron [Fri, 8 Sep 2023 19:57:41 +0000 (21:57 +0200)]
; * sweep.texi: Minor improvements

15 months ago; * sweep.texi (Extract Goal): Fix typos
Eshel Yaron [Fri, 8 Sep 2023 17:54:17 +0000 (19:54 +0200)]
; * sweep.texi (Extract Goal): Fix typos

15 months ago; * sweep.texi: Update menus
Eshel Yaron [Fri, 8 Sep 2023 17:45:59 +0000 (19:45 +0200)]
; * sweep.texi: Update menus

15 months agoAnnounce recent changes in NEWS.org and bump version to 0.24.0 V9.1.15-sweep-0.24.0
Eshel Yaron [Fri, 8 Sep 2023 17:35:34 +0000 (19:35 +0200)]
Announce recent changes in NEWS.org and bump version to 0.24.0

15 months agoADDED: New command 'sweeprolog-extract-region-to-predicate'
Eshel Yaron [Fri, 8 Sep 2023 17:25:44 +0000 (19:25 +0200)]
ADDED: New command 'sweeprolog-extract-region-to-predicate'

Add a command for extracting a part of a clause body into a separate
predicate.

* sweep.pl (sweep_term_variable_names/2)
(sweep_goal_may_cut/2): New helper predicates.
* sweeprolog.el (sweeprolog-extract-region-to-predicate): New command.
(sweeprolog-maybe-extract-region-to-predicate): New function.
(sweeprolog-insert-term-functions): Add it.
* sweep.texi (Insert Term DWIM, Extract Goal): Document it.

15 months agoCleanup 'defcustom' types and docstrings
Eshel Yaron [Mon, 4 Sep 2023 11:58:26 +0000 (13:58 +0200)]
Cleanup 'defcustom' types and docstrings

* sweeprolog.el (sweeprolog-swipl-sources)
(sweeprolog-module-header-comment-skeleton)
(sweeprolog-indent-offset, sweeprolog-qq-mode-alist)
(sweeprolog-enable-cycle-spacing)
(sweeprolog-analyze-buffer-on-idle)
(sweeprolog-analyze-buffer-max-size)
(sweeprolog-analyze-buffer-min-interval)
(sweeprolog-swipl-path)
(sweeprolog-messages-buffer-name)
(sweeprolog-read-flag-prompt)
(sweeprolog-read-module-prompt)
(sweeprolog-read-predicate-prompt)
(sweeprolog-read-exportable-predicate-prompt)
(sweeprolog-read-pack-prompt)
(sweeprolog-top-level-display-action)
(sweeprolog-top-level-min-history-length)
(sweeprolog-init-args)
(sweeprolog-enable-flymake)
(sweeprolog-note-implicit-autoloads)
(sweeprolog-enable-eldoc)
(sweeprolog-enable-cursor-sensor)
(sweeprolog-new-predicate-location-function)
(sweeprolog-top-level-signal-default-goal)
(sweeprolog-highlight-holes)
(sweeprolog-read-predicate-documentation-function)
(sweeprolog-enable-help-echo)
(sweeprolog-rename-variable-allow-existing)
(sweeprolog-dependency-directive)
(sweeprolog-highlight-breakpoints)
(sweeprolog-top-level-persistent-history): Minor docstring and ':type'
touch ups.
(sweeprolog-init-on-load): Remove obsolete option.
(sweeprolog-libswipl-path): Remove unused option.
(sweeprolog-menu)
(sweeprolog-start-prolog-server)
(sweeprolog-message)
(sweeprolog-top-level-menu-kill)
(sweeprolog-top-level-menu-go-to)
(sweeprolog-top-level-menu-mode): Minor docstring improvements.
(sweeprolog-submit-bug-report): Stop including
'sweeprolog-libswipl-path' in bug reports.

15 months agoAdd included copy of 'emacs-module.h' to '.elpaignore'
Eshel Yaron [Sun, 3 Sep 2023 09:46:37 +0000 (11:46 +0200)]
Add included copy of 'emacs-module.h' to '.elpaignore'

15 months agoPORT: MSVC V9.1.15 V9.1.16 V9.1.17 V9.1.18
Jan Wielemaker [Fri, 1 Sep 2023 15:57:19 +0000 (17:57 +0200)]
PORT: MSVC

Need to get DLL linkage correct.  This also requires a change in
SWI-Prolog.h

15 months agoPORT: Include local copy of emacs-module.h in case this is not provided.
Jan Wielemaker [Fri, 1 Sep 2023 15:28:18 +0000 (17:28 +0200)]
PORT: Include local copy of emacs-module.h in case this is not provided.

15 months agoDelete README.org (superseded by sweep.texi and README.md)
Eshel Yaron [Thu, 31 Aug 2023 11:10:54 +0000 (13:10 +0200)]
Delete README.org (superseded by sweep.texi and README.md)

15 months ago* .elpaignore: Exclude more files from package tarball
Eshel Yaron [Thu, 31 Aug 2023 11:05:12 +0000 (13:05 +0200)]
* .elpaignore: Exclude more files from package tarball

15 months agoDelete unused .gitmodules file
Eshel Yaron [Thu, 31 Aug 2023 11:04:37 +0000 (13:04 +0200)]
Delete unused .gitmodules file

15 months ago* sweeprolog.el: Update commentary.
Eshel Yaron [Thu, 31 Aug 2023 11:03:50 +0000 (13:03 +0200)]
* sweeprolog.el: Update commentary.

15 months agoAdd a small README file in Markdown format
Eshel Yaron [Thu, 31 Aug 2023 11:02:15 +0000 (13:02 +0200)]
Add a small README file in Markdown format

* README.md: New file.

15 months agoAnnounce recent changes in NEWS.org and bump version to 0.23.1 V9.1.14-sweep-0.23.1
Eshel Yaron [Wed, 30 Aug 2023 20:28:50 +0000 (22:28 +0200)]
Announce recent changes in NEWS.org and bump version to 0.23.1

15 months ago* sweep.texi (Main Features): Refine main features table
Eshel Yaron [Wed, 30 Aug 2023 19:11:12 +0000 (21:11 +0200)]
* sweep.texi (Main Features): Refine main features table

15 months ago* sweep.texi: Minor markup fixes
Eshel Yaron [Wed, 30 Aug 2023 17:58:28 +0000 (19:58 +0200)]
* sweep.texi: Minor markup fixes

15 months agoRewrite the manual in Texinfo format
Eshel Yaron [Mon, 28 Aug 2023 18:26:39 +0000 (20:26 +0200)]
Rewrite the manual in Texinfo format

* sweep.texi: New file.
* sweep.pl (sweep_match_term/6): Demote expections in user supplied
goal to failure.
* sweeprolog.el (sweeprolog-messages-buffer-name)
(sweeprolog-top-level-mode): Capitalize "Sweep".

16 months agoPrefer plain "Sweep" over "\texttt{sweep}"
Eshel Yaron [Mon, 21 Aug 2023 18:05:22 +0000 (20:05 +0200)]
Prefer plain "Sweep" over "\texttt{sweep}"

* sweep.doc: Say "Sweep" instead of "\texttt{sweep}".

16 months agoRefine "Getting Started" section of the manual
Eshel Yaron [Mon, 21 Aug 2023 17:56:06 +0000 (19:56 +0200)]
Refine "Getting Started" section of the manual

* README.org (Getting Started): Refine.
* sweep.doc (Installation, Getting Started): Update.

16 months agoRespect PROMPT argument in 'sweeprolog-read-existing-variable'
Eshel Yaron [Sun, 20 Aug 2023 07:39:21 +0000 (09:39 +0200)]
Respect PROMPT argument in 'sweeprolog-read-existing-variable'

This fixes an omission from the recent Compat integration.

* sweeprolog.el (sweeprolog-read-existing-variable): Use PROMPT.

16 months agoAnnounce Compat dependency and bump version to 0.23.0 V9.1.14-sweep-0.23.0
Eshel Yaron [Thu, 17 Aug 2023 21:47:35 +0000 (23:47 +0200)]
Announce Compat dependency and bump version to 0.23.0

* NEWS.org (Version 0.23.0 on 2023-08-18): New entry.
* README.org (Installation): Reword.
* sweeprolog.el: Bump minor version.

16 months agoRemove compatibility functions for buttonizing text.
Eshel Yaron [Thu, 17 Aug 2023 21:41:39 +0000 (23:41 +0200)]
Remove compatibility functions for buttonizing text.

* sweeprolog.el (sweeprolog-render-html-span)
(sweeprolog-render-html-a)
(sweeprolog--describe-module)
(sweeprolog--describe-predicate): Use 'buttonize' and
'buttonize-region' instead of...
(sweeprolog--buttonize, sweeprolog--buttonize-region): Removed.

16 months agoUse 'without-restriction'.
Eshel Yaron [Thu, 17 Aug 2023 21:39:58 +0000 (23:39 +0200)]
Use 'without-restriction'.

* sweeprolog.el (sweeprolog-analyze-buffer)
(sweeprolog--buffer-string)
(sweeprolog-export-predicate): Use 'without-restriction' instead of
'save-restriction' and 'widen'.

16 months agoPrefer 'pos-bol/eol' over 'line-beginning/end-position'.
Eshel Yaron [Thu, 17 Aug 2023 21:38:08 +0000 (23:38 +0200)]
Prefer 'pos-bol/eol' over 'line-beginning/end-position'.

* sweeprolog.el (sweeprolog--quoted-atom-or-functor-completion-at-point):
(sweeprolog-end-of-top-term)
(sweeprolog-export-predicate)
(sweeprolog-align-spaces)
(sweeprolog-infer-indent-style)
(sweeprolog-indent-line-after-infix)
(sweeprolog-create-index-function): Use 'pos-bol/eol' instead of
'line-beginning/end-position'.

16 months agoUse 'format-prompt'.
Eshel Yaron [Thu, 17 Aug 2023 21:36:08 +0000 (23:36 +0200)]
Use 'format-prompt'.

* sweeprolog.el (sweeprolog-read-predicate)
(sweeprolog-plunit-testset-skeleton)
(sweeprolog-read-existing-variable)
(sweeprolog-read-breakpoint): Use 'format-prompt' instead of manual
prompt formatting.

16 months agoUse 'process-lines-handling-status'.
Eshel Yaron [Thu, 17 Aug 2023 21:33:46 +0000 (23:33 +0200)]
Use 'process-lines-handling-status'.

* sweeprolog.el (sweeprolog--ensure-module): Use
'process-lines-handling-status' instead of 'split-string'-based
approach.

16 months agoUse 'defvar-keymap' to define keymap variables.
Eshel Yaron [Thu, 17 Aug 2023 21:30:47 +0000 (23:30 +0200)]
Use 'defvar-keymap' to define keymap variables.

* sweeprolog.el (sweeprolog-mode-map)
(sweeprolog-forward-hole-repeat-map)
(sweeprolog-top-level-mode-map)
(sweeprolog-top-level-menu-mode-map)
(sweeprolog-help-prefix-map)
(sweeprolog-prefix-map)
(sweeprolog-forward-hole-on-tab-mode-map)
(sweeprolog-top-level-example-mode-map)
(sweeprolog-term-search-map)
(sweeprolog-read-term-map)
(sweeprolog-read-goal-map): Convert to 'defvar-keymap'.

16 months agoUse 'natnum' custom type
Eshel Yaron [Thu, 17 Aug 2023 21:28:45 +0000 (23:28 +0200)]
Use 'natnum' custom type

* sweeprolog.el (sweeprolog-indent-offset):
(sweeprolog-analyze-buffer-max-size):
(sweeprolog-pack-description-max-width): Update type to 'natnum'.

16 months ago* sweeprolog.el: Require 'compat'
Eshel Yaron [Thu, 17 Aug 2023 21:25:58 +0000 (23:25 +0200)]
* sweeprolog.el: Require 'compat'

Add a dependency on the GNU ELPA compatibility package Compat.

16 months agoAnnounce recent changes in NEWS.org and bump version to 0.22.2 V9.1.14-sweep-0.22.2
Eshel Yaron [Mon, 14 Aug 2023 18:09:57 +0000 (20:09 +0200)]
Announce recent changes in NEWS.org and bump version to 0.22.2

16 months agoWorkaround issue with Xwidgets and XPCE in older SWI-Prolog
Eshel Yaron [Mon, 14 Aug 2023 17:54:50 +0000 (19:54 +0200)]
Workaround issue with Xwidgets and XPCE in older SWI-Prolog

* sweeprolog.el (sweeprolog-init-args): Disable XPCE if Emacs is built
with Xwidgets and SWI-Prolog version is earlier then 9.1.14.

* README.org (Prolog Initialization and Cleanup): Reword
'sweeprolog-init-args' documentation.

16 months agoPORT: Explicitly export the symbols we need V9.1.14
Jan Wielemaker [Fri, 11 Aug 2023 09:33:14 +0000 (11:33 +0200)]
PORT: Explicitly export the symbols we need

By default, plugins are now compiled with hidden visibility for
internal symbols.

16 months agoMinor documentation improvements
Eshel Yaron [Tue, 8 Aug 2023 18:30:45 +0000 (21:30 +0300)]
Minor documentation improvements

* README.org: Prefer present over future tense, extend and reword.

16 months agoFix feedback in 'sweeprolog-set-prolog-flag'
Eshel Yaron [Tue, 8 Aug 2023 18:29:35 +0000 (21:29 +0300)]
Fix feedback in 'sweeprolog-set-prolog-flag'

Similarly to the previous fix for 'sweeprolog-pack-install', this
makes 'sweeprolog-set-prolog-flag' actually report its result, instead
of reporting failure even when successful.

* sweep.pl (sweep_set_prolog_flag/2): Bind the output argument to
non-nil on success.

16 months ago* README.org: Fix typos
Eshel Yaron [Mon, 7 Aug 2023 18:06:31 +0000 (21:06 +0300)]
* README.org: Fix typos

16 months agoDocumentation improvements for 'sweeprolog-prefix-map'
Eshel Yaron [Mon, 7 Aug 2023 17:55:57 +0000 (20:55 +0300)]
Documentation improvements for 'sweeprolog-prefix-map'

* sweeprolog.el (sweeprolog-prefix-map): Move binding for
'sweeprolog-view-messages' to...
(sweeprolog-help-prefix-map): ...here.  Also bind
'sweeprolog-view-news'.

* README.org (Discovering Sweep): Document 'sweeprolog-view-news'.
(Quick access to Sweep commands): Update.
(Examining Prolog messages): Reword.
(Installing Prolog Packages): Capitalize.

16 months agoFix feedback in 'sweeprolog-pack-install'
Eshel Yaron [Mon, 7 Aug 2023 15:48:48 +0000 (18:48 +0300)]
Fix feedback in 'sweeprolog-pack-install'

Have 'sweeprolog-pack-install' actually report its result, instead of
reporting failure even when successful.

* sweep.pl (sweep_pack_install/2): Bind the output argument to non-nil
on success.
* sweeprolog.el (sweeprolog-pack-description-max-width): New user
option.
(sweeprolog-read-pack-name): Use display text properties for alignment
instead of repeated spaces.

16 months agoAnnounce recent changes in NEWS.org and bump version to 0.22.1 V9.1.13-sweep-0.22.1
Eshel Yaron [Mon, 7 Aug 2023 12:43:53 +0000 (15:43 +0300)]
Announce recent changes in NEWS.org and bump version to 0.22.1

* sweeprolog.el: Bump patch version.
* NEWS.org (Version 0.22.1 on 2023-08-07): New section.

16 months agoAdd missing 'sweeprolog-submit-bug-report' command
Eshel Yaron [Mon, 7 Aug 2023 12:35:53 +0000 (15:35 +0300)]
Add missing 'sweeprolog-submit-bug-report' command

This command has been documented since Sweep version 0.6.0 but its
implementation was unintentionally committed.  This fixes that.

* sweeprolog.el (sweeprolog-submit-bug-report): New command.
(sweeprolog-menu): Add entry for 'sweeprolog-submit-bug-report'.
* README.org (Setting up Sweep for local development): Capitalize.
(Submitting patches and bug reports): Update.

16 months agoAdd autoloaded 'defalias' for prefix keymaps
Eshel Yaron [Fri, 4 Aug 2023 18:05:05 +0000 (21:05 +0300)]
Add autoloaded 'defalias' for prefix keymaps

* sweeprolog.el (sweeprolog-prefix-map)
(sweeprolog-help-prefix-map): New 'defalias' for respective keymaps.

* README.org (Quick Access Keymap): Adapt.

16 months agoDo not autoload keymaps
Philip Kaludercic [Thu, 3 Aug 2023 19:42:55 +0000 (19:42 +0000)]
Do not autoload keymaps

When a keymap is autoloaded (and the definition is copied over to the
-autoloads.el file), and the function are sharp-quoted, Emacs can
complain about undefined symbols, especially in combination with
'package-quickstart'.

17 months agoBump version to 0.22.0 V9.1.11-sweep-0.22.0
Eshel Yaron [Thu, 20 Jul 2023 10:17:16 +0000 (13:17 +0300)]
Bump version to 0.22.0

17 months ago; Use 'sweeprolog-deftest' more widely to isolate unit tests
Eshel Yaron [Wed, 19 Jul 2023 12:40:20 +0000 (15:40 +0300)]
; Use 'sweeprolog-deftest' more widely to isolate unit tests

17 months ago; Only load 'library(macros)' if available
Eshel Yaron [Tue, 18 Jul 2023 14:10:33 +0000 (17:10 +0300)]
; Only load 'library(macros)' if available

17 months agoRefactor and enhance 'completion-at-point' support
Eshel Yaron [Tue, 18 Jul 2023 13:48:13 +0000 (16:48 +0300)]
Refactor and enhance 'completion-at-point' support

Replace 'sweeprolog-completion-at-point-functions' with a single
function 'sweeprolog-completion-at-point' that implements a much more
refined context-sensitive decision tree to determine what kind of
completion to perform.

17 months ago; Fix typo
Eshel Yaron [Tue, 18 Jul 2023 13:45:16 +0000 (16:45 +0300)]
; Fix typo

* sweeprolog.el (sweeprolog-terms-at-point): Fix typo.

17 months ago; Simplify list notation
Eshel Yaron [Tue, 18 Jul 2023 13:37:21 +0000 (16:37 +0300)]
; Simplify list notation

* sweeprolog.el (sweeprolog-module-completion-table): Simplify list
notation of completion 'metadata' list.

17 months ago; Fix unused argument
Eshel Yaron [Tue, 18 Jul 2023 13:36:04 +0000 (16:36 +0300)]
; Fix unused argument

* sweeprolog.el (sweeprolog-module-minibuffer-annotation-1): Use 'pad'
argument.

17 months ago; Remove stale reference to 'sweeprolog-debug-prefix-face'
Eshel Yaron [Tue, 18 Jul 2023 13:33:41 +0000 (16:33 +0300)]
; Remove stale reference to 'sweeprolog-debug-prefix-face'

* sweeprolog.el (sweeprolog-message): Remove stale reference to
'sweeprolog-debug-prefix-face'.

17 months agoBump version to 0.21.0 V9.1.10-sweep-0.21.0
Eshel Yaron [Tue, 27 Jun 2023 18:43:40 +0000 (21:43 +0300)]
Bump version to 0.21.0