]> git.eshelyaron.com Git - sweep.git/log
sweep.git
2 years 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

2 years 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

2 years 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.

2 years 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.

2 years 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.

2 years 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.

2 years 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

2 years 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

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

2 years 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

2 years 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

2 years 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

2 years 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.

2 years 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.

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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

2 years 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.

2 years 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

2 years 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.

2 years 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

2 years 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

2 years 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.

2 years 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.

2 years 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.

2 years 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

2 years agoAnnounce recent changes in NEWS.org and bump version to 0.9.3 V9.1.0-sweep-0.9.3
Eshel Yaron [Sun, 27 Nov 2022 19:44:52 +0000 (21:44 +0200)]
Announce recent changes in NEWS.org and bump version to 0.9.3

2 years agoAdd test for predicate completion with named arguments
Eshel Yaron [Sun, 27 Nov 2022 19:34:32 +0000 (21:34 +0200)]
Add test for predicate completion with named arguments

2 years agoENHANCED: use argument names for holes in predicate completion
Eshel Yaron [Sun, 27 Nov 2022 19:08:14 +0000 (21:08 +0200)]
ENHANCED: use argument names for holes in predicate completion

* sweep.pl (predicate_argument_names/2): new predicate.
(sweep_format_predicate/2): use it, and revise into...
(sweep_format_predicate/4): new predicate.
(sweep_predicate_completion_candidates): use it.

2 years ago* (sweeprolog-analyze-fragment-flymake): fix typo
Eshel Yaron [Sun, 27 Nov 2022 19:07:31 +0000 (21:07 +0200)]
* (sweeprolog-analyze-fragment-flymake): fix typo

2 years agoAdd repeat keymap for sweeprolog-forward-hole
Eshel Yaron [Sat, 26 Nov 2022 16:18:35 +0000 (18:18 +0200)]
Add repeat keymap for sweeprolog-forward-hole

* sweeprolog.el (sweeprolog-backward-hole): new command.
(sweeprolog-forward-hole-repeat-mode): new repeat keymap.

2 years ago* README.org ("Things To Do"): remove outdated item
Eshel Yaron [Sat, 26 Nov 2022 16:15:04 +0000 (18:15 +0200)]
* README.org ("Things To Do"): remove outdated item

2 years agoAnnounce recent changes in NEWS.org and bump version to 0.9.2 V9.1.0-sweep-0.9.2
Eshel Yaron [Sat, 26 Nov 2022 14:25:41 +0000 (16:25 +0200)]
Announce recent changes in NEWS.org and bump version to 0.9.2

2 years agoADDED: make flymake optionally complain about implicit autoloads
Eshel Yaron [Sat, 26 Nov 2022 14:10:04 +0000 (16:10 +0200)]
ADDED: make flymake optionally complain about implicit autoloads

* sweeprolog.el (sweeprolog-note-implicit-autoloads): new user-option.
(sweeprolog-analyze-fragment-flymake): use it.
* README.org ("Managing Dependencies"): mention it.

2 years ago* README.org: ("Managing Dependencies"): new section.
Eshel Yaron [Sat, 26 Nov 2022 13:51:25 +0000 (15:51 +0200)]
* README.org: ("Managing Dependencies"): new section.

2 years agoADDED: new command for updating use_module/autoload directives
Eshel Yaron [Sat, 26 Nov 2022 13:29:48 +0000 (15:29 +0200)]
ADDED: new command for updating use_module/autoload directives

* sweep.pl (sweep_file_path_in_library/2): new predicate.
(sweep_color_normalized/3): normalize autoload source paths.
* sweeprolog.el (sweeprolog-analyze-buffer-with): new helper function.
(sweeprolog-update-dependencies): new command.

2 years agoAnnounce recent changes in NEWS.org and bump version to 0.9.1 V9.1.0-sweep-0.9.1
Eshel Yaron [Fri, 25 Nov 2022 21:31:32 +0000 (23:31 +0200)]
Announce recent changes in NEWS.org and bump version to 0.9.1

2 years agoAdjust arity of predicates according to completion context
Eshel Yaron [Fri, 25 Nov 2022 21:01:40 +0000 (23:01 +0200)]
Adjust arity of predicates according to completion context

* sweep.pl (sweep_context_callable): track required arity adjustment.
(sweep_predicate_completion_candidates): take arity difference as
argument, adjust and filter candidates according to it.
* sweeprolog.el (sweeprolog-predicate-completion-at-point): use it.
* sweeprolog-tests.el: test it.

2 years agoRecognize and highlight XPCE string comments as docstrings
Eshel Yaron [Fri, 25 Nov 2022 14:39:09 +0000 (16:39 +0200)]
Recognize and highlight XPCE string comments as docstrings

* sweeprolog.el (sweeprolog-analyze-fragment-to-faces): recognize
string comments.

2 years agoRecognize and highlight built-in predicate definitions
Eshel Yaron [Fri, 25 Nov 2022 10:50:21 +0000 (12:50 +0200)]
Recognize and highlight built-in predicate definitions

* sweeprolog.el (sweeprolog-analyze-fragment-to-faces): recognize
"def_swi" and "def_iso" predicate head kinds .

2 years agoDo not highlight other occurrences of anonymous variables
Eshel Yaron [Fri, 25 Nov 2022 10:44:47 +0000 (12:44 +0200)]
Do not highlight other occurrences of anonymous variables

* sweeprolog.el (sweeprolog-analyze-fragment-variable): check for
anonymous variables ("_").

2 years agoFix typos in README.org
Eshel Yaron [Fri, 25 Nov 2022 10:44:09 +0000 (12:44 +0200)]
Fix typos in README.org

2 years agoAnnounce recent changes in NEWS.org and bump version to 0.9.0 V8.5.20-sweep-0.9.0 V9.0.0 V9.1.0
Eshel Yaron [Wed, 23 Nov 2022 19:40:38 +0000 (21:40 +0200)]
Announce recent changes in NEWS.org and bump version to 0.9.0

2 years agoADDED: PlUnit tests block skeleton and command for inserting it
Eshel Yaron [Wed, 23 Nov 2022 19:25:39 +0000 (21:25 +0200)]
ADDED: PlUnit tests block skeleton and command for inserting it

* sweeprolog.el (sweeprolog-format-string-as-atom): new function.
(sweeprolog-module-header-skeleton): use define-skeleton, making it a
command instead of a defconst.
(sweeprolog-plunit-testset-skeleton): new skeleton and command.
* sweeprolog-tests: test it.
* README.org ("Writing Tests"): new section.
("Using templates for creating new modules"): rename to "Creating New
Modules".

2 years ago* (sweeprolog-beginning-of-next-top-term): revise and add tests
Eshel Yaron [Wed, 23 Nov 2022 15:55:35 +0000 (17:55 +0200)]
* (sweeprolog-beginning-of-next-top-term): revise and add tests

2 years agoBump version to 0.8.13 (bug fix release) V8.5.20-sweep-0.8.13
Eshel Yaron [Wed, 23 Nov 2022 08:41:05 +0000 (10:41 +0200)]
Bump version to 0.8.13 (bug fix release)

2 years agoFIXED: instantiation error in color term normalization
Eshel Yaron [Wed, 23 Nov 2022 08:40:12 +0000 (10:40 +0200)]
FIXED: instantiation error in color term normalization

2 years agoAnnounce recent changes in NEWS.org and bump version to 0.8.12 V8.5.20-sweep-0.8.12
Eshel Yaron [Tue, 22 Nov 2022 19:54:10 +0000 (21:54 +0200)]
Announce recent changes in NEWS.org and bump version to 0.8.12

2 years agoNew user-option to controlling highlighting of holes
Eshel Yaron [Tue, 22 Nov 2022 18:42:48 +0000 (20:42 +0200)]
New user-option to controlling highlighting of holes

* sweeprolog.el (sweeprolog-highlight-holes): new user-option.
(sweeprolog-analyze-fragment-to-faces): respect it.

2 years agoHandle module-qualification in next-clause insertion
Eshel Yaron [Tue, 22 Nov 2022 18:14:46 +0000 (20:14 +0200)]
Handle module-qualification in next-clause insertion

* sweeprolog.el (sweeprolog-definition-at-point): also return module
name when the head term is qualified.
(sweeprolog-maybe-insert-next-clause): pass module name to...
(sweeprolog-insert-clause): new argument module.
* sweeprolog-tests.el: add a couple of relevant test cases.

2 years ago* (sweeprolog-hole-face): new face for highlighting holes
Eshel Yaron [Tue, 22 Nov 2022 14:24:12 +0000 (16:24 +0200)]
* (sweeprolog-hole-face): new face for highlighting holes

2 years agoFIXED: sweeprolog-beginning-of-next-top-term: other possible loop
Eshel Yaron [Tue, 22 Nov 2022 10:59:41 +0000 (12:59 +0200)]
FIXED: sweeprolog-beginning-of-next-top-term: other possible loop

* sweeprolog.el (sweeprolog-beginning-of-next-top-term): don't loop
when called in the last term of the buffer
* sweeprolog-tests.el (beginning-of-next-top-term-at-last-clause): new
test case

2 years ago* (sweeprolog-top-level-mode-map): bind sweeprolog-forward-hole
Eshel Yaron [Tue, 22 Nov 2022 09:37:10 +0000 (11:37 +0200)]
* (sweeprolog-top-level-mode-map): bind sweeprolog-forward-hole

2 years agoFIXED: possible infinite loop looking for next term
Eshel Yaron [Tue, 22 Nov 2022 08:37:51 +0000 (10:37 +0200)]
FIXED: possible infinite loop looking for next term

* sweeprolog.el (sweeprolog-beginning-of-next-top-term): handle
comments more reliably

2 years agoUse new prolog_interrupt/0 to interrupt top-level threads
Eshel Yaron [Mon, 21 Nov 2022 18:39:33 +0000 (20:39 +0200)]
Use new prolog_interrupt/0 to interrupt top-level threads

* sweeprolog.el (sweeprolog-top-level-signal-default-goal): change
default value to...
* sweep.pl (sweep_interrupt/0): new predicate, backwards compatibility
wrapper for prolog_interrupt/0.

2 years agoBump to version 0.8.11 V8.5.20-sweep-0.8.11
Eshel Yaron [Mon, 21 Nov 2022 16:50:24 +0000 (18:50 +0200)]
Bump to version 0.8.11

2 years agoSupport defining DCG non-terminals in sweeprolog-insert-term-dwim
Eshel Yaron [Mon, 21 Nov 2022 16:39:37 +0000 (18:39 +0200)]
Support defining DCG non-terminals in sweeprolog-insert-term-dwim

* sweep.pl (sweep_color_normalized_/4): expose DCG term "kind" to
Elisp.
* sweeprolog.el (sweeprolog-new-predicate-location-function): change
expected function signature.
(sweeprolog-default-new-predicate-location)
(sweeprolog-new-predicate-location-above-current): update arguments.
(sweeprolog-maybe-define-predicate): support defining DCGs.

2 years agoAnnounce recent changes in NEWS.org and bump version to 0.8.10 V8.5.20-sweep-0.8.10
Eshel Yaron [Sun, 20 Nov 2022 21:38:47 +0000 (23:38 +0200)]
Announce recent changes in NEWS.org and bump version to 0.8.10

2 years agoHave sweeprolog-top-level-signal-current call trace/0 by default
Eshel Yaron [Sun, 20 Nov 2022 21:21:39 +0000 (23:21 +0200)]
Have sweeprolog-top-level-signal-current call trace/0 by default

* sweeprolog.el (sweeprolog-top-level-signal-default-goal): new user
option, set to "trace" by default.
(sweeprolog-top-level-signal-current): use it.

2 years agoSupport DCG and SSU rules in sweeprolog-insert-next-clause
Eshel Yaron [Sun, 20 Nov 2022 19:31:11 +0000 (21:31 +0200)]
Support DCG and SSU rules in sweeprolog-insert-next-clause

* sweeprolog.el (sweeprolog-definition-at-point): also return kind of
neck.
(sweeprolog-maybe-insert-next-clause): pass it to...
(sweeprolog-insert-next-clause): new argument NECK used instead of
hardcoded ":-", use "Body" for clause body instead of "_".
(sweeprolog-identifier-at-point): handle raw meta goals.
* sweeprolog-tests.el: add tests for sweeprolog-insert-term-dwim
inserting clauses with different neck kinds.

2 years agoAnnounce recent changes in NEWS.org and bump version to 0.8.9 V8.5.20-sweep-0.8.9
Eshel Yaron [Sat, 19 Nov 2022 20:44:39 +0000 (22:44 +0200)]
Announce recent changes in NEWS.org and bump version to 0.8.9

2 years ago* (sweeprolog-analyze-fragment-flymake): restrict syntax errors
Eshel Yaron [Sat, 19 Nov 2022 20:29:17 +0000 (22:29 +0200)]
* (sweeprolog-analyze-fragment-flymake): restrict syntax errors

2 years ago* (sweeprolog-predicate-completion-at-point): fix pcase match
Eshel Yaron [Sat, 19 Nov 2022 20:09:11 +0000 (22:09 +0200)]
* (sweeprolog-predicate-completion-at-point): fix pcase match

2 years ago* (sweeprolog-analyze-fragment-to-faces) fix comment highlighting
Eshel Yaron [Sat, 19 Nov 2022 20:02:45 +0000 (22:02 +0200)]
* (sweeprolog-analyze-fragment-to-faces) fix comment highlighting

2 years agoDon't error in sweeprolog-analyze-term-at-point
Eshel Yaron [Sat, 19 Nov 2022 19:46:29 +0000 (21:46 +0200)]
Don't error in sweeprolog-analyze-term-at-point

2 years ago* (sweeprolog-predicate-completion-at-point): use holes for args
Eshel Yaron [Sat, 19 Nov 2022 19:21:20 +0000 (21:21 +0200)]
* (sweeprolog-predicate-completion-at-point): use holes for args

2 years ago* (sweeprolog-identifier-at-point): fix module qualification
Eshel Yaron [Sat, 19 Nov 2022 19:20:24 +0000 (21:20 +0200)]
* (sweeprolog-identifier-at-point): fix module qualification

2 years ago* (sweeprolog-maybe-syntax-error-face): don't error in top-level
Eshel Yaron [Sat, 19 Nov 2022 19:19:38 +0000 (21:19 +0200)]
* (sweeprolog-maybe-syntax-error-face): don't error in top-level

2 years agoFIXED: exporting predicates in presence of exported operators
Eshel Yaron [Sat, 19 Nov 2022 16:38:32 +0000 (18:38 +0200)]
FIXED: exporting predicates in presence of exported operators

* sweep.pl (sweep_exportable_predicates/2): new predicate.
* sweeprolog.el (sweeprolog--module-term)
(sweeprolog--exportable-predicates)
(sweeprolog-analyze-start-exportable)
(sweeprolog-analyze-fragment-exportable): no longer used, deleted.
(sweeprolog-exportable-predicates): new function.
(sweeprolog-read-exportable-predicate): use it.
(sweeprolog-export-predicate): handle exported operators.

2 years ago* (sweeprolog-at-beginning-of-top-term-p): handle comments
Eshel Yaron [Sat, 19 Nov 2022 16:36:19 +0000 (18:36 +0200)]
* (sweeprolog-at-beginning-of-top-term-p): handle comments

2 years ago* sweeprolog.el (sweeprolog-identifier-at-point): check major-mode
Eshel Yaron [Sat, 19 Nov 2022 16:35:28 +0000 (18:35 +0200)]
* sweeprolog.el (sweeprolog-identifier-at-point): check major-mode

2 years agoRemove imported duplicates in sweep_predicates_collection/2
Eshel Yaron [Sat, 19 Nov 2022 16:34:26 +0000 (18:34 +0200)]
Remove imported duplicates in sweep_predicates_collection/2

2 years agoUse define-auto-insert instead of manual add-to-list
Eshel Yaron [Fri, 18 Nov 2022 10:05:37 +0000 (12:05 +0200)]
Use define-auto-insert instead of manual add-to-list

2 years agoENHANCED: allow sweeprolog-forward-hole to wrap around
Eshel Yaron [Fri, 18 Nov 2022 09:05:22 +0000 (11:05 +0200)]
ENHANCED: allow sweeprolog-forward-hole to wrap around

* sweeprolog.el (sweeprolog--next-hole, sweeprolog--previous-hole):
new functions.
(sweeprolog--forward-hole, sweeprolog--backward-hole): add WRAP arg.

2 years agoAdd test and update manual following change in auto-insert
Eshel Yaron [Thu, 17 Nov 2022 19:09:21 +0000 (21:09 +0200)]
Add test and update manual following change in auto-insert

2 years ago* sweeprolog.el (auto-insert): leave point at module summary
Eshel Yaron [Thu, 17 Nov 2022 18:52:30 +0000 (20:52 +0200)]
* sweeprolog.el (auto-insert): leave point at module summary

2 years agoENHANCED: conditional syntax error highlighting
Eshel Yaron [Thu, 17 Nov 2022 09:41:10 +0000 (11:41 +0200)]
ENHANCED: conditional syntax error highlighting

2 years agoUpdate NEWS.org and bump version to 0.8.8 V8.5.20-sweep-0.8.8
Eshel Yaron [Wed, 16 Nov 2022 07:17:05 +0000 (09:17 +0200)]
Update NEWS.org and bump version to 0.8.8

2 years agoDon't highlight syntax error at the end of the buffer
Eshel Yaron [Tue, 15 Nov 2022 22:43:51 +0000 (00:43 +0200)]
Don't highlight syntax error at the end of the buffer

* sweeprolog.el (sweeprolog--analyze-point): new buffer local
variable.
(sweeprolog-analyze-buffer, sweeprolog-analyze-some-terms): let-bind
it.
(sweeprolog-analyze-fragment-to-faces): check it before applying
sweeprolog-syntax-error-face.

2 years agoDOC: mention sweeprolog-swipl-path in the manual
Eshel Yaron [Tue, 15 Nov 2022 22:16:32 +0000 (00:16 +0200)]
DOC: mention sweeprolog-swipl-path in the manual

2 years agoStart the top-level TCP server just-in-time
Eshel Yaron [Tue, 15 Nov 2022 21:45:02 +0000 (23:45 +0200)]
Start the top-level TCP server just-in-time

* sweeprolog.el (sweeprolog-init): do not start TCP server
unconditionally
(sweeprolog-top-level): start it here instead, on demand.
* sweep.pl (sweep_top_level_server/2): wait for TCP server thread to
start before returning control to Emacs.
* README.org (The Prolog Top-Level): add implementation note.

2 years agoAdd sweeprolog-analyze-some-terms to after-change-functions
Eshel Yaron [Tue, 15 Nov 2022 20:55:32 +0000 (22:55 +0200)]
Add sweeprolog-analyze-some-terms to after-change-functions

2 years agoDocument and test sweeprolog-electric-layout-mode
Eshel Yaron [Tue, 15 Nov 2022 20:49:49 +0000 (22:49 +0200)]
Document and test sweeprolog-electric-layout-mode

*
sweeprolog.el (sweeprolog-electric-layout-post-self-insert-function):
add docstring.
(sweeprolog-electric-layout-mode): expand docstring, indent after
closing brackets.
* sweeprolog-tests.el: add tests.
* README.org (Aligning with multiple spaces): rename to...
(Maintaining Code Layout): new section, including...
(Inserting the Right Number of Spaces)
(Electric Layout mode): new sections.

2 years agoADDED: minor mode for automatic whitespace insertion
Eshel Yaron [Mon, 14 Nov 2022 16:19:31 +0000 (18:19 +0200)]
ADDED: minor mode for automatic whitespace insertion

* sweep.pl (sweep_context_callable/2): only consider the context to be
callable if a neck is present up the tree, i.e. not in the head.
* sweeprolog.el (sweeprolog-context-callable-p): new function,
extracted from (sweeprolog-predicate-completion-at-point)
(sweeprolog-electric-layout-post-self-insert-function): new function.
(sweeprolog-electric-layout-mode): new minor mode.

2 years agoSimplify completion at point, bump patch version V8.5.20-sweep-0.8.7
Eshel Yaron [Sun, 13 Nov 2022 09:19:34 +0000 (11:19 +0200)]
Simplify completion at point, bump patch version

2 years agoENHANCED: revise predicate completion at point
Eshel Yaron [Sat, 12 Nov 2022 20:38:54 +0000 (22:38 +0200)]
ENHANCED: revise predicate completion at point

Completion at point now detects whether predicate completion is
appropriate, by parsing Prolog code back from point to determine the
context of point.  If predicate completion is not appropriate,
fallback to atom completion.

2 years agoADDED: user option specifying where to define new predicates V8.5.20-sweep-0.8.6
Eshel Yaron [Fri, 11 Nov 2022 10:39:58 +0000 (12:39 +0200)]
ADDED: user option specifying where to define new predicates

* sweeprolog.el (sweeprolog-default-new-predicate-location)
(sweeprolog-new-predicate-location-above-current): new functions.
(sweeprolog-new-predicate-location-function): new user option.
(sweeprolog-maybe-define-predicate): use it.

2 years agoFIXED: possible error in sweeprolog-describe-predicate
Eshel Yaron [Thu, 10 Nov 2022 20:37:14 +0000 (22:37 +0200)]
FIXED: possible error in sweeprolog-describe-predicate

2 years agoHighlight test case head terms in a dedicated face
Eshel Yaron [Thu, 10 Nov 2022 20:35:15 +0000 (22:35 +0200)]
Highlight test case head terms in a dedicated face

2 years agoDOC: document sweeprolog-xref-project-source-files in the manual V8.5.20-sweep-0.8.5
Eshel Yaron [Thu, 10 Nov 2022 19:06:29 +0000 (21:06 +0200)]
DOC: document sweeprolog-xref-project-source-files in the manual

2 years agoADDED: new command sweeprolog-xref-project-source-files
Eshel Yaron [Thu, 10 Nov 2022 18:14:26 +0000 (20:14 +0200)]
ADDED: new command sweeprolog-xref-project-source-files

2 years agoFIXED: find user predicate definitions more reliably
Eshel Yaron [Thu, 10 Nov 2022 18:13:16 +0000 (20:13 +0200)]
FIXED: find user predicate definitions more reliably

2 years agoCatch error in kill-buffer-hook when top-level thread is dead
Eshel Yaron [Thu, 10 Nov 2022 18:01:52 +0000 (20:01 +0200)]
Catch error in kill-buffer-hook when top-level thread is dead

2 years agoBump version to 0.8.4 V8.5.20-sweep-0.8.4
Eshel Yaron [Wed, 9 Nov 2022 21:22:46 +0000 (23:22 +0200)]
Bump version to 0.8.4

2 years agoTEST: add test for updating syntax error faces
Eshel Yaron [Wed, 9 Nov 2022 20:55:50 +0000 (22:55 +0200)]
TEST: add test for updating syntax error faces

2 years agoRecognize backslash as part of an operator in tokenization
Eshel Yaron [Wed, 9 Nov 2022 20:30:46 +0000 (22:30 +0200)]
Recognize backslash as part of an operator in tokenization

2 years agoFIXED: clear syntax error face after fix more aggressively
Eshel Yaron [Wed, 9 Nov 2022 20:25:20 +0000 (22:25 +0200)]
FIXED: clear syntax error face after fix more aggressively