]> git.eshelyaron.com Git - dict.git/log
dict.git
19 months agoAnnounce recent changes in NEWS.org and bump version to 0.17.0 V9.1.6-sweep-0.17.0
Eshel Yaron [Thu, 16 Feb 2023 13:45:25 +0000 (15:45 +0200)]
Announce recent changes in NEWS.org and bump version to 0.17.0

19 months agoFIXED: beginning-of-clause detection with quoted head functors
Eshel Yaron [Thu, 16 Feb 2023 13:00:49 +0000 (15:00 +0200)]
FIXED: beginning-of-clause detection with quoted head functors

* sweeprolog.el (sweeprolog-beginning-of-top-term): don't skip quoted
functors in clause heads.

19 months agoADDED: Support setting breakpoints in sweeprolog-mode
Eshel Yaron [Thu, 16 Feb 2023 12:54:44 +0000 (14:54 +0200)]
ADDED: Support setting breakpoints in sweeprolog-mode

* sweep.pl (sweep_set_breakpoint/2)
(sweep_delete_breakpoint/2)
(sweep_set_breakpoint_condition/2): new predicates.

* sweeprolog.el (sweeprolog-dependency-directive): update
package-version field.
(sweeprolog-set-breakpoint)
(sweeprolog-set-breakpoint-condition)
(sweeprolog-delete-breakpoint)
(sweeprolog-list-breakpoints): new commands.
(sweeprolog-highlight-breakpoints): new user option.
(sweeprolog-mode-map): bind sweeprolog-set-breakpoint.

* README.org (Setting Breakpoints): new manual section.

19 months agoADDED: mode line indication for loaded buffers
Eshel Yaron [Thu, 16 Feb 2023 12:34:45 +0000 (14:34 +0200)]
ADDED: mode line indication for loaded buffers

* sweep.pl (sweep_source_file_load_time/2): new predicate.
(sweep_load_buffer/2): also update source modification time based.
* sweeprolog.el (sweeprolog-buffer-load-time)
(sweeprolog-buffer-loaded-since-last-modification-p): new functions.
(sweeprolog-load-buffer): use it.
(sweeprolog-mode): add mode line indication if buffer is loaded.

19 months ago* (sweeprolog-context-menu-for-variable): fix docstring
Eshel Yaron [Thu, 16 Feb 2023 12:21:17 +0000 (14:21 +0200)]
* (sweeprolog-context-menu-for-variable): fix docstring

19 months agoMODIFIED: sweeprolog-update-dependencies choice of directives
Eshel Yaron [Mon, 13 Feb 2023 18:35:10 +0000 (20:35 +0200)]
MODIFIED: sweeprolog-update-dependencies choice of directives

* sweeprolog.el (sweeprolog-dependency-directive): New user option.
Determines which directive to use in...
(sweeprolog-update-dependencies): Fix edge cases in finding where to
insert new directives. Optionally infer directive to add based on
current buffer contents.

* README.org (Managing Dependencies): Update section.

19 months agoAnnounce recent changes in NEWS.org and bump version to 0.16.0 V9.1.4-sweep-0.16.0
Eshel Yaron [Sat, 11 Feb 2023 16:26:30 +0000 (18:26 +0200)]
Announce recent changes in NEWS.org and bump version to 0.16.0

19 months ago* (sweeprolog-insert-term-dwim): add undo-inhibit-region property
Eshel Yaron [Sat, 11 Feb 2023 11:59:43 +0000 (13:59 +0200)]
* (sweeprolog-insert-term-dwim): add undo-inhibit-region property

19 months ago* README.org (Discovering Sweep): new manual section
Eshel Yaron [Sat, 11 Feb 2023 11:58:55 +0000 (13:58 +0200)]
* README.org (Discovering Sweep): new manual section

19 months ago* sweeprolog.el: allow info-lookup to recognize Sweep commands
Eshel Yaron [Sat, 11 Feb 2023 11:57:53 +0000 (13:57 +0200)]
* sweeprolog.el: allow info-lookup to recognize Sweep commands

19 months ago* README.org: add explicit indexing directive
Eshel Yaron [Sat, 11 Feb 2023 11:57:30 +0000 (13:57 +0200)]
* README.org: add explicit indexing directive

19 months agoFIXED: end-of-term detection after a fullstop turns to a dict dot V9.1.5 V9.1.6
Eshel Yaron [Tue, 7 Feb 2023 20:16:44 +0000 (22:16 +0200)]
FIXED: end-of-term detection after a fullstop turns to a dict dot

This fixes an issue with finding clause bounds after changing e.g.:

    foo(Bar, Baz) :- Baz = Bar.
                              ^ read as fullstop

to:

    foo(Bar, Baz) :- Baz = Bar.foo.
                              ^ read as dict dot

19 months agoADDED: new commands for managing numbered variables
Eshel Yaron [Tue, 7 Feb 2023 19:57:30 +0000 (21:57 +0200)]
ADDED: new commands for managing numbered variables

* sweeprolog.el (sweeprolog-increment-numbered-variables)
(sweeprolog-decrement-numbered-variables): new commands.
(sweeprolog-mode-map): bind them to C-c C-+ and C-c C--.
(sweeprolog-context-menu-for-variable): allow calling these new
commands from context menus for numbered variables.
* sweeprolog-tests.el: add test for incrementing numbered variables.
* README.org (Numbered Variables): new manual section.

19 months ago* (sweeprolog-rename-variable-allow-existing): refine custom type
Eshel Yaron [Sun, 5 Feb 2023 09:41:15 +0000 (11:41 +0200)]
* (sweeprolog-rename-variable-allow-existing): refine custom type

19 months agoENHANCED: handle renaming variables to existing variable names
Eshel Yaron [Sat, 4 Feb 2023 21:09:23 +0000 (23:09 +0200)]
ENHANCED: handle renaming variables to existing variable names

* sweeprolog.el (sweeprolog-rename-variable-allow-existing): new user
option, used by...
(sweeprolog-read-new-variable-try): new command, exists the minibuffer
if it contains a valid variable name.  It checks if the selected
variable name already exists.  Used by...
(sweeprolog-read-new-variable): new function, reads a Prolog variable
name in the minibuffer with a dedicated exit command.
(sweeprolog-rename-variable): use it.

19 months agoAnnounce recent changes in NEWS.org and bump version to 0.15.0 V9.1.4-sweep-0.15.0
Eshel Yaron [Wed, 1 Feb 2023 18:21:54 +0000 (20:21 +0200)]
Announce recent changes in NEWS.org and bump version to 0.15.0

19 months agoAvoid moving cursor while renaming variables from context menu
Eshel Yaron [Wed, 1 Feb 2023 18:09:39 +0000 (20:09 +0200)]
Avoid moving cursor while renaming variables from context menu

* sweeprolog.el (sweeprolog-analyze-term-at-point): new optional
argument POINT.
(sweeprolog-rename-variable): use it instead of moving point during
prompting to avoid the cursor being displayed at the click position
when called from the context menu.

19 months ago* (xref-backend-references): report progress while formatting refs
Eshel Yaron [Wed, 1 Feb 2023 17:57:43 +0000 (19:57 +0200)]
* (xref-backend-references): report progress while formatting refs

19 months agoENHANCED: provide exact buffer positions for cross references
Eshel Yaron [Wed, 1 Feb 2023 16:28:09 +0000 (18:28 +0200)]
ENHANCED: provide exact buffer positions for cross references

* sweep.pl (reference_span/5): new predicate.
(sweep_predicate_references/2): use it to find exact character offset of
predicate references.
* sweeprolog.el (xref-backend-references): adapt accordingly.

19 months ago* (sweeprolog-rename-variable): report results if interactive
Eshel Yaron [Mon, 30 Jan 2023 06:43:09 +0000 (08:43 +0200)]
* (sweeprolog-rename-variable): report results if interactive

19 months agoADDED: command for renaming a variable in Prolog term
Eshel Yaron [Sun, 29 Jan 2023 21:35:33 +0000 (23:35 +0200)]
ADDED: command for renaming a variable in Prolog term

* sweeprolog.el (sweeprolog-rename-variable): new command.
(sweeprolog-context-menu-rename-variable): new command used in context
menus for variables.
(sweeprolog-context-menu-for-variable): new function, used in...
(sweeprolog-context-menu-functions): add it to the list.
(sweeprolog-mode-map): bind it to C-c C-r.
* README.org (Renaming Variables): new section.

19 months agoAnnounce recent changes in NEWS.org and bump version to 0.14.1 V9.1.4-sweep-0.14.1
Eshel Yaron [Sat, 28 Jan 2023 18:07:03 +0000 (20:07 +0200)]
Announce recent changes in NEWS.org and bump version to 0.14.1

19 months agoENHANCED: use docs from the SWI-Prolog manual to guess hole names
Eshel Yaron [Sat, 28 Jan 2023 16:38:00 +0000 (18:38 +0200)]
ENHANCED: use docs from the SWI-Prolog manual to guess hole names

* sweep.pl (predicate_argument_names/2): also consult the SWI-Prolog
manual via pldoc_man:load_man_object/4 to find argument names for
built-in predicates.

19 months agoADDED: numeric argument for sweeprolog-forward/backward-hole
Eshel Yaron [Thu, 26 Jan 2023 15:21:09 +0000 (17:21 +0200)]
ADDED: numeric argument for sweeprolog-forward/backward-hole

* sweeprolog.el (sweeprolog-count-holes): new command, counts holes
in the current buffer.
(sweeprolog-forward-hole, sweeprolog-backward-hole): new numeric
argument, corresponding to the prefix argument when called
interactively.  With positive/negative numeric argument, move over
that many holes.  With zero numeric argument, call
sweeprolog-count-holes instead.

19 months agoDOC: improve documentation for holes V9.0.4 V9.1.4
Eshel Yaron [Mon, 23 Jan 2023 20:33:15 +0000 (22:33 +0200)]
DOC: improve documentation for holes

19 months ago* README.org (Holes): Fix wording and index directives
Eshel Yaron [Mon, 23 Jan 2023 18:35:15 +0000 (20:35 +0200)]
* README.org (Holes): Fix wording and index directives

19 months agoyank holes back as plain variables
Eshel Yaron [Mon, 23 Jan 2023 18:20:02 +0000 (20:20 +0200)]
yank holes back as plain variables

* sweeprolog.el (sweeprolog-mode): add sweeprolog-hole to
yank-excluded-properties buffer-locally.
* sweeprolog-tests.el: test it.
* README.org (Holes): mention it.

19 months agoAdd sweeprolog-view-news command and bump version to 0.14.0 V9.1.3-sweep-0.14.0
Eshel Yaron [Mon, 23 Jan 2023 09:07:22 +0000 (11:07 +0200)]
Add sweeprolog-view-news command and bump version to 0.14.0

* sweeprolog.el (sweeprolog-view-news): new command for viewing the
Sweep News file.

19 months agoDocument sweeprolog-file-at-point, file-name-at-point-functions
Eshel Yaron [Sun, 22 Jan 2023 20:04:15 +0000 (22:04 +0200)]
Document sweeprolog-file-at-point, file-name-at-point-functions

19 months ago* (sweeprolog-xref-project-source-files): add progress reporting
Eshel Yaron [Sun, 22 Jan 2023 19:05:01 +0000 (21:05 +0200)]
* (sweeprolog-xref-project-source-files): add progress reporting

19 months agodon't use file-name-split for compatibility with older Emacsen
Eshel Yaron [Sun, 22 Jan 2023 08:20:13 +0000 (10:20 +0200)]
don't use file-name-split for compatibility with older Emacsen

19 months ago* sweeprolog.el: capitalize "Sweep" in major mode names
Eshel Yaron [Sun, 22 Jan 2023 06:24:40 +0000 (08:24 +0200)]
* sweeprolog.el: capitalize "Sweep" in major mode names

19 months agoADDED: command to pipe output of Prolog goals to Emacs buffers
Eshel Yaron [Sun, 22 Jan 2023 06:13:15 +0000 (08:13 +0200)]
ADDED: command to pipe output of Prolog goals to Emacs buffers

* sweep.c (sweep_open_channel(), sweep_fd_open()): new helper
functions for obtaining Prolog streams from Emacs pipe buffers.
* sweep.pl (sweep_async_goal/2, sweep_interrupt_async_goal/2): new
predicates.
* sweeprolog.el (sweeprolog-async-goal): new command, executes a goal
in a separate thread and redirects its output to a buffer with mode..
(sweeprolog-async-goal-output-mode): new major mode, derived from
Compilation mode.
(sweeprolog-mode-map, sweeprolog-prefix-map, sweeprolog-menu): bind
sweeprolog-async-goal.
* README.org (Executing Prolog Asynchronously): new manual section.

19 months agoFIXED: possible race condition when signaling new top-level threads
Eshel Yaron [Sat, 21 Jan 2023 20:46:35 +0000 (22:46 +0200)]
FIXED: possible race condition when signaling new top-level threads

19 months agoAnnounce recent changes in NEWS.org and bump version to 0.13.0 V9.1.3-sweep-0.13.0
Eshel Yaron [Fri, 20 Jan 2023 19:47:47 +0000 (21:47 +0200)]
Announce recent changes in NEWS.org and bump version to 0.13.0

19 months agoENHANCED: consult with library index for finding predicate defs
Eshel Yaron [Fri, 20 Jan 2023 18:45:14 +0000 (20:45 +0200)]
ENHANCED: consult with library index for finding predicate defs

* sweep.pl (sweep_predicate_location_/4): also check library_index/3.
* sweeprolog-tests.el: add test for finding the source location of a
predicate in the package clib.

20 months agoexpose new arithmetic functions support in library(prolog_colour)
Eshel Yaron [Fri, 20 Jan 2023 11:50:55 +0000 (13:50 +0200)]
expose new arithmetic functions support in library(prolog_colour)

20 months agoFIXED: stale xref data when jumping across files with M-.
Eshel Yaron [Fri, 20 Jan 2023 11:49:51 +0000 (13:49 +0200)]
FIXED: stale xref data when jumping across files with M-.

20 months agoADDED: right-click context menus in sweeprolog-mode
Eshel Yaron [Thu, 19 Jan 2023 09:15:35 +0000 (11:15 +0200)]
ADDED: right-click context menus in sweeprolog-mode

* sweeprolog.el (sweeprolog-context-menu-find-module)
(sweeprolog-context-menu-find-module-other-window)
(sweeprolog-context-menu-describe-module)
(sweeprolog-context-menu-find-file)
(sweeprolog-context-menu-find-file-other-window)
(sweeprolog-context-menu-describe-predicate): new commands, add to context menus by...
(sweeprolog-context-menu-for-predicate)
(sweeprolog-context-menu-for-module)
(sweeprolog-context-menu-for-file): new functions, used in...
(sweeprolog-context-menu-functions): new abnormal hook, used by...
(sweeprolog-context-menu-function): new function.
(sweeprolog-mode): add it to context-menu-functions.

* README.org (Context Menu): new section.

20 months agoAnnounce recent changes in NEWS.org and bump version to 0.12.0 V9.1.3-sweep-0.12.0
Eshel Yaron [Mon, 16 Jan 2023 21:12:24 +0000 (23:12 +0200)]
Announce recent changes in NEWS.org and bump version to 0.12.0

20 months agoADDED: short description for tokens on mouse hover (help-echo)
Eshel Yaron [Mon, 16 Jan 2023 19:02:03 +0000 (21:02 +0200)]
ADDED: short description for tokens on mouse hover (help-echo)

* sweep.pl (sweep_predicate_dependencies/2): new predicate.
* sweeprolog.el (sweeprolog-enable-help-echo): new user-option, when
non-nil sweeprolog-analyze-region-start-hook and
sweeprolog-analyze-region-fragment-hook are extended with...
(sweeprolog-analyze-start-help-echo)
(sweeprolog-analyze-fragment-help-echo): new functions, manage the
help-echo text property for Prolog text.
* README.org ("Hover for Help"): new section about help-echo.

20 months agoENHANCED: improve semantic highlighting for several constructs
Eshel Yaron [Mon, 16 Jan 2023 18:58:31 +0000 (20:58 +0200)]
ENHANCED: improve semantic highlighting for several constructs

* sweep.pl (sweep_color_normalized_/4): fix handling of non-callable
terms, propagate type error expected type to Elisp.
(sweeprolog_goal_kind_normalized/2): rename to...
(sweep_goal_kind_normalized/2): normalize all goal and head classes.
* sweeprolog.el (sweeprolog-analyze-fragment-to-faces): adapt to new
info from sweep_goal_kind_normalized/2, and highlight some missing
token kinds.

20 months agoAnnounce recent changes in NEWS.org and bump version to 0.11.3 V9.1.3-sweep-0.11.3
Eshel Yaron [Sun, 15 Jan 2023 12:35:45 +0000 (14:35 +0200)]
Announce recent changes in NEWS.org and bump version to 0.11.3

20 months ago* README.org ("Initialization and Cleanup"): improve listings
Eshel Yaron [Sun, 15 Jan 2023 09:36:45 +0000 (11:36 +0200)]
* README.org ("Initialization and Cleanup"): improve listings

20 months ago* README.org: use ~code~ over =verbatim= more consistently
Eshel Yaron [Sat, 14 Jan 2023 20:36:00 +0000 (22:36 +0200)]
* README.org: use ~code~ over =verbatim= more consistently

20 months ago* README.org ("High-level Architecture"): fix out-of-date docs
Eshel Yaron [Sat, 14 Jan 2023 20:34:50 +0000 (22:34 +0200)]
* README.org ("High-level Architecture"): fix out-of-date docs

20 months ago* README.org ("Initialization and Cleanup"): use title case
Eshel Yaron [Sat, 14 Jan 2023 20:32:39 +0000 (22:32 +0200)]
* README.org ("Initialization and Cleanup"): use title case

20 months ago* README.org ("Querying Prolog"): improve function listing
Eshel Yaron [Sat, 14 Jan 2023 20:31:25 +0000 (22:31 +0200)]
* README.org ("Querying Prolog"): improve function listing

20 months ago* (sweeprolog-prefix-map): bind sweeprolog-top-level-send-goal to q
Eshel Yaron [Sat, 14 Jan 2023 09:47:14 +0000 (11:47 +0200)]
* (sweeprolog-prefix-map): bind sweeprolog-top-level-send-goal to q

20 months agoDOC: improve listings in the "Editing Prolog Code" section
Eshel Yaron [Sat, 14 Jan 2023 09:07:19 +0000 (11:07 +0200)]
DOC: improve listings in the "Editing Prolog Code" section

20 months agoBind C-c S-TAB to sweeprolog-backward-hole for symmetry
Eshel Yaron [Sat, 14 Jan 2023 07:07:02 +0000 (09:07 +0200)]
Bind C-c S-TAB to sweeprolog-backward-hole for symmetry

20 months agoAdd a couple of missing docstrings
Eshel Yaron [Sat, 14 Jan 2023 07:05:58 +0000 (09:05 +0200)]
Add a couple of missing docstrings

* sweeprolog.el
(sweeprolog-read-predicate-documentation-with-holes)
(sweeprolog-read-predicate-documentation-default-function): add
docstrings.

20 months ago* sweeprolog.el: fix some typos in docstrings
Eshel Yaron [Sat, 14 Jan 2023 07:05:20 +0000 (09:05 +0200)]
* sweeprolog.el: fix some typos in docstrings

20 months agoRefer to Sweep as a whole as "Sweep" without verbatim format
Eshel Yaron [Thu, 12 Jan 2023 19:20:42 +0000 (21:20 +0200)]
Refer to Sweep as a whole as "Sweep" without verbatim format

20 months agoADDED: command for sending a goal to top-level from any buffer
Eshel Yaron [Thu, 12 Jan 2023 11:27:17 +0000 (13:27 +0200)]
ADDED: command for sending a goal to top-level from any buffer

* sweeprolog.el (sweeprolog-top-level): extract buffer setup logic to...
(sweeprolog-top-level-buffer): new function.
(sweeprolog-top-level-send-string): new function, used by...
(sweeprolog-top-level-send-goal): new command, reads a goal from the
minibuffer and sends it to a Prolog top-level buffer.
(sweeprolog-mode-map): bind it to C-c C-q.
(sweeprolog-menu): add "Send Goal to Top-level" entry.
* README.org ("Sending Goals to the Top-level"): new manual section.

20 months agoSupport completion when reading a goal from the minibuffer
Eshel Yaron [Thu, 12 Jan 2023 11:22:21 +0000 (13:22 +0200)]
Support completion when reading a goal from the minibuffer

* sweeprolog.el (sweeprolog-read-goal-map): new keymap, derived from
sweeprolog-read-term-map.
(sweeprolog-goals-at-point): new function, similar to
sweeprolog-terms-at-point but only returns goal terms.
(sweeprolog-read-goal): use them.

20 months agoDOC: explain how to follow source locations in top-level messages V9.1.3
Eshel Yaron [Sun, 8 Jan 2023 14:39:11 +0000 (16:39 +0200)]
DOC: explain how to follow source locations in top-level messages

20 months agoMODIFIED: do not force set next-error buffer to Prolog buffer
Eshel Yaron [Sun, 8 Jan 2023 14:35:52 +0000 (16:35 +0200)]
MODIFIED: do not force set next-error buffer to Prolog buffer

20 months agoAnnounce recent changes in NEWS.org and bump version 0.11.1 V9.1.2-sweep-0.11.2
Eshel Yaron [Sat, 7 Jan 2023 06:33:07 +0000 (08:33 +0200)]
Announce recent changes in NEWS.org and bump version 0.11.1

20 months agoENHANCED: use terms at point as "future history" for term-search
Eshel Yaron [Sat, 7 Jan 2023 06:20:01 +0000 (08:20 +0200)]
ENHANCED: use terms at point as "future history" for term-search

* sweep.pl (sweep_terms_at_point/2): new predicate.
* sweeprolog.el (sweeprolog-terms-at-point): new function.
(sweeprolog-read-term): use it for setting the future history.
(sweeprolog-read-goal): new function.
(sweeprolog-term-search): use it for reading a goal when called with
prefix argument.

20 months agoAnnounce recent changes in NEWS.org and bump version to 0.11.1 V9.1.2-sweep-0.11.1
Eshel Yaron [Fri, 6 Jan 2023 09:51:06 +0000 (11:51 +0200)]
Announce recent changes in NEWS.org and bump version to 0.11.1

20 months agoENHANCED: Support refining term searches with arbitrary goals
Eshel Yaron [Fri, 6 Jan 2023 07:16:33 +0000 (09:16 +0200)]
ENHANCED: Support refining term searches with arbitrary goals

* sweep.pl (sweep_term_search/2): extend with an extra goal argument.
* sweeprolog.el (sweeprolog-read-term): new function, similar to
read--expression but for Prolog terms rather than Elisp expressions.
(sweeprolog-term-search): use it, and prompt for goal with prefix arg.

20 months agoAnnounce recent changes in NEWS.org and bump version to 0.11.0 V9.1.2-sweep-0.11.0
Eshel Yaron [Thu, 5 Jan 2023 11:30:34 +0000 (13:30 +0200)]
Announce recent changes in NEWS.org and bump version to 0.11.0

20 months agoENHANCED: restore original point when a term search is quit
Eshel Yaron [Thu, 5 Jan 2023 11:08:21 +0000 (13:08 +0200)]
ENHANCED: restore original point when a term search is quit

20 months ago* sweep.pl (list_tail/2): Fix possible non-termination
Eshel Yaron [Wed, 4 Jan 2023 08:06:37 +0000 (10:06 +0200)]
* sweep.pl (list_tail/2): Fix possible non-termination

20 months agoADDED: command for finding terms subsumed by a given term
Eshel Yaron [Tue, 3 Jan 2023 22:22:34 +0000 (00:22 +0200)]
ADDED: command for finding terms subsumed by a given term

* sweep.pl (sweep_term_search/2): new predicate.
* sweeprolog.el (sweeprolog-term-search-in-buffer): new function.
(sweeprolog-term-search): new command.
* README.org ("Term Search"): new manual section.

20 months agoFIXED: find next predicate definition more reliably
Eshel Yaron [Sun, 1 Jan 2023 20:17:22 +0000 (22:17 +0200)]
FIXED: find next predicate definition more reliably

* sweep.pl (sweeprolog_beginning_of_last_predicate/2)
(sweeprolog_beginning_of_last_predicate/2): explicitly sort results,
don't assume xref_defined/3 yields ordered results.

20 months agoAnnounce recent changes in NEWS.org and bump version to 0.10.1 V9.1.2-sweep-0.10.1
Eshel Yaron [Sun, 1 Jan 2023 15:11:39 +0000 (17:11 +0200)]
Announce recent changes in NEWS.org and bump version to 0.10.1

20 months agoUpdate copyright year
Eshel Yaron [Sun, 1 Jan 2023 13:46:33 +0000 (15:46 +0200)]
Update copyright year

20 months agoADDED: user option to control predicate documentation composition
Eshel Yaron [Sun, 1 Jan 2023 12:32:01 +0000 (14:32 +0200)]
ADDED: user option to control predicate documentation composition

* sweeprolog.el
(sweeprolog-insert-pldoc-for-predicate): remove in favor of...
(sweeprolog-insert-predicate-documentation): new function.
 (sweeprolog-format-term-with-holes): new utility
function, used by...
(sweeprolog-read-predicate-documentation-with-holes)
(sweeprolog-read-predicate-documentation-default-function): new
functions, used for...
(sweeprolog-read-predicate-documentation-function): new user option,
used by...
(sweeprolog-read-predicate-documentation): new function, used by...
(sweeprolog-document-predicate-at-point): refactor.

20 months agoAvoid excessive analysis in presence of unbalanced quotes
Eshel Yaron [Sat, 31 Dec 2022 11:10:17 +0000 (13:10 +0200)]
Avoid excessive analysis in presence of unbalanced quotes

* sweeprolog.el (sweeprolog-analyze-fragment-fullstop): new function,
adds a dedicated text property to fullstops.
(sweeprolog-analyze-region-fragment-hook): add it.
(sweeprolog-at-fullstop-p)
(sweeprolog-end-of-last-fullstop, sweeprolog-end-of-next-fullstop):
new functions.
(sweeprolog-end-of-top-term): use them for restricting to region
between last fullstop and next fullstop.

20 months agoFix some typos in the manual section about holes
Eshel Yaron [Sun, 25 Dec 2022 18:54:21 +0000 (20:54 +0200)]
Fix some typos in the manual section about holes

20 months agoAnnounce recent changes in NEWS.org and bump version to 0.10.0 V9.1.2-sweep-0.10.0
Eshel Yaron [Sun, 25 Dec 2022 17:53:38 +0000 (19:53 +0200)]
Announce recent changes in NEWS.org and bump version to 0.10.0

20 months agoADDED: New command sweeprolog-insert-term-with-holes
Eshel Yaron [Thu, 22 Dec 2022 14:51:47 +0000 (16:51 +0200)]
ADDED: New command sweeprolog-insert-term-with-holes

* sweep.pl (sweep_format_term/2, sweep_current_functors/2): new
predicates.
* sweeprolog.el (sweeprolog-read-functor-history): new variable,
history list for...
(sweeprolog-read-functor): new function.
(sweeprolog-forward-hole-repeat-mode): rename to...
(sweeprolog-forward-hole-repeat-map): corrected name for keymap.
(sweeprolog-analyze-end-font-lock): don't rely on
sweeprolog--next-hole to move point.
(sweeprolog-at-hole-p, sweeprolog-beginning-of-hole)
(sweeprolog-end-of-hole): new functions, used by...
(sweeprolog--previous-hole, sweeprolog--next-hole): revise.
(sweeprolog--precedence-at-point): new function, used by...
(sweeprolog-insert-term-with-holes): new command.
(sweeprolog-mode-map): bind it to C-c C-m
* sweeprolog-tests: test it.
* README.org ("Filling Holes"): move to top and rename to...
("Holes"): document sweeprolog-insert-term-with-holes.

20 months agoENHANCED: use variable names from docs when inserting next clause
Eshel Yaron [Wed, 21 Dec 2022 20:41:59 +0000 (22:41 +0200)]
ENHANCED: use variable names from docs when inserting next clause

* sweep.pl (sweep_format_head/2): new predicate.
* sweeprolog.el (sweeprolog-insert-clause): use it.

20 months agoImprove sweeprolog-menu entry names
Eshel Yaron [Wed, 21 Dec 2022 18:21:24 +0000 (20:21 +0200)]
Improve sweeprolog-menu entry names

* sweeprolog.el (sweeprolog-info-manual): new function.
(sweeprolog-menu): add it, improve entry names.

20 months agoENHANCED: highlight holes in incomplete terms
Eshel Yaron [Wed, 21 Dec 2022 17:51:48 +0000 (19:51 +0200)]
ENHANCED: highlight holes in incomplete terms

* sweeprolog.el (sweeprolog-predicate-completion-at-point): fontify
holes when inserting them.
(sweeprolog-analyze-start-font-lock): reset font-lock-face in analyzed
region.
(sweeprolog-analyze-fragment-to-faces): fix syntax error handling,
don't highlight holes as it is done by...
(sweeprolog-analyze-end-font-lock): new function, highlights holes in
analyzed region when sweeprolog-highlight-holes is non-nil.
(sweeprolog-analyze-region-end-hook): add it.
(sweeprolog--hole): fix text property used for setting stickiness.

21 months agoFIXED: possible crash after calling sweeprolog-restart
Eshel Yaron [Sun, 18 Dec 2022 11:41:16 +0000 (13:41 +0200)]
FIXED: possible crash after calling sweeprolog-restart

21 months ago* (sweeprolog-menu): add entry for sweeprolog-infer-indent-style
Eshel Yaron [Sun, 18 Dec 2022 11:40:05 +0000 (13:40 +0200)]
* (sweeprolog-menu): add entry for sweeprolog-infer-indent-style

21 months agoDuplicate LaTeX label. V9.1.2
Jan Wielemaker [Sun, 18 Dec 2022 15:34:14 +0000 (16:34 +0100)]
Duplicate LaTeX label.

21 months agoAnnounce recent changes in NEW.org and bump version to 0.9.6 V9.0.3 V9.1.1-sweep-0.9.6
Eshel Yaron [Sat, 17 Dec 2022 14:47:37 +0000 (16:47 +0200)]
Announce recent changes in NEW.org and bump version to 0.9.6

21 months ago* README.org: refine a couple of ALT_TITLEs
Eshel Yaron [Sat, 17 Dec 2022 14:32:24 +0000 (16:32 +0200)]
* README.org: refine a couple of ALT_TITLEs

21 months agoAdd short titles to all manual nodes to act as menu items
Eshel Yaron [Sat, 17 Dec 2022 06:01:12 +0000 (08:01 +0200)]
Add short titles to all manual nodes to act as menu items

21 months agoADDED: new command sweeprolog-infer-indent-style
Eshel Yaron [Sat, 17 Dec 2022 05:58:43 +0000 (07:58 +0200)]
ADDED: new command sweeprolog-infer-indent-style

* sweeprolog.el (sweeprolog-infer-indent-style): new command.
* sweeprolog-tests.el: test it.
* README.org ("Indentation"): mention it.

21 months agoUse indent-to instead manually indenting with spaces
Eshel Yaron [Fri, 16 Dec 2022 22:02:33 +0000 (00:02 +0200)]
Use indent-to instead manually indenting with spaces

* sweeprolog.el (sweeprolog-indent-line): use indent-to.
(sweeprolog-indent-offset): tweak docstring.
(sweeprolog-indent-line-after-prefix): use it instead of hard-coded
offset.
(sweeprolog-export-predicate): don't override indent-tabs-mode.

21 months ago* (sweeprolog-indent-or-forward-hole): simplify
Eshel Yaron [Mon, 12 Dec 2022 18:01:05 +0000 (20:01 +0200)]
* (sweeprolog-indent-or-forward-hole): simplify

21 months agoAnnounce recent changes in NEW.org and bump version to 0.9.5 V9.1.1-sweep-0.9.5
Eshel Yaron [Sat, 10 Dec 2022 11:07:05 +0000 (13:07 +0200)]
Announce recent changes in NEW.org and bump version to 0.9.5

21 months ago* (sweeprolog-mode): enable comment-multi-line
Eshel Yaron [Sat, 10 Dec 2022 10:03:20 +0000 (12:03 +0200)]
* (sweeprolog-mode): enable comment-multi-line

21 months ago* (sweeprolog-mode): Improve interaction with auto-fill-mode
Eshel Yaron [Sat, 10 Dec 2022 07:35:41 +0000 (09:35 +0200)]
* (sweeprolog-mode): Improve interaction with auto-fill-mode

21 months ago* (sweeprolog-beginning-of-predicate-at-point): fix hang near bob
Eshel Yaron [Sat, 10 Dec 2022 06:28:44 +0000 (08:28 +0200)]
* (sweeprolog-beginning-of-predicate-at-point): fix hang near bob

21 months ago* (sweeprolog-align-spaces): extend to also work in comments
Eshel Yaron [Fri, 9 Dec 2022 15:10:02 +0000 (17:10 +0200)]
* (sweeprolog-align-spaces): extend to also work in comments

21 months agoFIXED: stale predicate locations in loaded modified buffers
Eshel Yaron [Thu, 8 Dec 2022 20:10:04 +0000 (22:10 +0200)]
FIXED: stale predicate locations in loaded modified buffers

* sweep.pl (sweep_predicate_location_/2,3): prefer xref over loaded
predicate properties.
* sweeprolog.el (sweeprolog-predicate-location): first analyze buffer
if modified to update xref data.

21 months agoAnnounce recent changes in NEWS.org and bump version to 0.9.4 V9.1.1-sweep-0.9.4
Eshel Yaron [Tue, 6 Dec 2022 19:50:08 +0000 (21:50 +0200)]
Announce recent changes in NEWS.org and bump version to 0.9.4

21 months agoUse built-in file_autoload_directives/3 to update deps V9.0.1 V9.0.2 V9.1.1
Eshel Yaron [Sun, 4 Dec 2022 17:09:30 +0000 (19:09 +0200)]
Use built-in file_autoload_directives/3 to update deps

* sweep.pl (sweep_file_missing_dependencies/2): new predicate.
* sweeprolog.el (sweeprolog-update-dependencies): use it.
* sweeprolog-tests.el: add another test case for
sweeprolog-update-dependencies.

21 months ago* README.org ("Filling Holes"): improve indexing
Eshel Yaron [Sun, 4 Dec 2022 16:14:52 +0000 (18:14 +0200)]
* README.org ("Filling Holes"): improve indexing

21 months ago* (sweeprolog--ensure-module): detect and report missing sweep.pl
Eshel Yaron [Sat, 3 Dec 2022 18:13:20 +0000 (20:13 +0200)]
* (sweeprolog--ensure-module): detect and report missing sweep.pl

21 months agoADDED: ability to pass command line args directly to swipl
Eshel Yaron [Sat, 3 Dec 2022 16:09:18 +0000 (18:09 +0200)]
ADDED: ability to pass command line args directly to swipl

* sweeprolog.el (sweeprolog-handle-command-line-args): new function,
sets up command line argument handling using...
(sweeprolog-command-line-function): new function.

21 months agoADDED: minor mode for moving to the next hole with TAB
Eshel Yaron [Fri, 2 Dec 2022 11:41:32 +0000 (13:41 +0200)]
ADDED: minor mode for moving to the next hole with TAB

* sweeprolog.el (sweeprolog-forward-hole-on-tab-mode): new minor mode,
binding TAB to...
(sweeprolog-indent-or-forward-hole): new command.
* README.org ("Filling Holes"): rephrase and mention new minor mode.

21 months agoENHANCED: indentation after infix operators
Eshel Yaron [Fri, 2 Dec 2022 09:47:58 +0000 (11:47 +0200)]
ENHANCED: indentation after infix operators

* sweeprolog.el (sweeprolog-indent-line-after-infix): adhere to last line
indentation even if non-standard, handle DCG RHS contexts and SSU
guards.
* sweeprolog-tests.el: add more tests for indentation.

21 months ago* (sweeprolog-identifier-at-point): reliably qualify local heads
Eshel Yaron [Wed, 30 Nov 2022 18:45:45 +0000 (20:45 +0200)]
* (sweeprolog-identifier-at-point): reliably qualify local heads