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

23 months 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.

23 months 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

23 months 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.

23 months 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.

23 months 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

23 months 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

23 months 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

23 months 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

23 months 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

23 months 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

23 months 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

23 months 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

23 months 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.

23 months 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

23 months 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

23 months 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

23 months 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

23 months 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.

23 months 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

23 months 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

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

23 months 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

2 years agoFIXED: properly update query highlighting in the toplevel
Eshel Yaron [Wed, 9 Nov 2022 20:24:27 +0000 (22:24 +0200)]
FIXED: properly update query highlighting in the toplevel

2 years agoFIXED: simplify & make variable highlighting more reliable
Eshel Yaron [Wed, 9 Nov 2022 20:23:26 +0000 (22:23 +0200)]
FIXED: simplify & make variable highlighting more reliable

2 years agoFIXED: only consider backslash as an escape inside strings
Eshel Yaron [Tue, 8 Nov 2022 12:29:19 +0000 (14:29 +0200)]
FIXED: only consider backslash as an escape inside strings

2 years agoFIXED: restrict variable underlining to current clause
Eshel Yaron [Mon, 7 Nov 2022 17:04:59 +0000 (19:04 +0200)]
FIXED: restrict variable underlining to current clause

2 years agoFIXED: variable name completion on Emacs 27
Eshel Yaron [Mon, 7 Nov 2022 17:02:32 +0000 (19:02 +0200)]
FIXED: variable name completion on Emacs 27

* sweeprolog.el (sweeprolog-variable-completion-at-point): don't rely
on char-uppercase-p
* sweeprolog-tests.el (complete-variable): new test.

2 years agoADDED: sweeprolog-forward/backward/mark-predicate V8.5.20-sweep-0.8.3
Eshel Yaron [Mon, 7 Nov 2022 10:29:53 +0000 (12:29 +0200)]
ADDED: sweeprolog-forward/backward/mark-predicate

2 years agoREFACTOR: Simplify and deduplicate code all around V8.5.20-sweep-0.8.2
Eshel Yaron [Sat, 5 Nov 2022 17:49:42 +0000 (19:49 +0200)]
REFACTOR: Simplify and deduplicate code all around

* sweeprolog.el (sweeprolog-colourise-*): rename to sweeprolog-analyze-*

2 years agoFIXED: correctly recognize "public" head terms
Eshel Yaron [Fri, 28 Oct 2022 16:05:32 +0000 (19:05 +0300)]
FIXED: correctly recognize "public" head terms

2 years agoTEST: add two test cases
Eshel Yaron [Fri, 28 Oct 2022 16:01:50 +0000 (19:01 +0300)]
TEST: add two test cases

2 years agoFIXED: sweeprolog-identifier-at-point could return unbound module
Eshel Yaron [Fri, 28 Oct 2022 16:00:58 +0000 (19:00 +0300)]
FIXED: sweeprolog-identifier-at-point could return unbound module

2 years agoFixed defcustom type for sweeprolog-top-level-display-action
Eshel Yaron [Fri, 28 Oct 2022 16:00:16 +0000 (19:00 +0300)]
Fixed defcustom type for sweeprolog-top-level-display-action

2 years agoFIXED: write_sweep_module_location/0 for Windows.
Jan Wielemaker [Thu, 3 Nov 2022 19:28:43 +0000 (20:28 +0100)]
FIXED: write_sweep_module_location/0 for Windows.

2 years agoUse term_string/2 to parse M:F/N terms encoded in strings V8.5.20-sweep-0.8.1
Eshel Yaron [Tue, 25 Oct 2022 14:38:47 +0000 (17:38 +0300)]
Use term_string/2 to parse M:F/N terms encoded in strings

2 years agoOrganize and split sweeprolog.el into sections
Eshel Yaron [Tue, 25 Oct 2022 13:18:16 +0000 (16:18 +0300)]
Organize and split sweeprolog.el into sections

2 years agoAdhere to the convention of using "Emacs's" instead of "Emacs'"
Eshel Yaron [Tue, 25 Oct 2022 11:08:41 +0000 (14:08 +0300)]
Adhere to the convention of using "Emacs's" instead of "Emacs'"

2 years agoDOC: added section "Code Completion" to the manual
Eshel Yaron [Tue, 25 Oct 2022 10:52:17 +0000 (13:52 +0300)]
DOC: added section "Code Completion" to the manual

2 years agoADDED: completion-at-point for variable names
Eshel Yaron [Tue, 25 Oct 2022 06:44:46 +0000 (09:44 +0300)]
ADDED: completion-at-point for variable names

* sweeprolog.el (sweeprolog-local-variables-collection,
sweeprolog-variable-completion-at-point): new
functions. (sweeprolog-mode): add to
completion-at-point-functions. (sweeprolog-mode-syntax-table): update
according to char_type(Char, prolog_symbol).

2 years agoUpdate NEWS.org and bump package version V8.5.20-sweep-0.8.0
Eshel Yaron [Sat, 22 Oct 2022 16:26:57 +0000 (19:26 +0300)]
Update NEWS.org and bump package version

2 years agoADDED: context-based command for inserting new clauses or terms
Eshel Yaron [Sat, 22 Oct 2022 16:10:08 +0000 (19:10 +0300)]
ADDED: context-based command for inserting new clauses or terms

* sweeprolog.el (sweeprolog--forward-hole, sweeprolog--backward-hole):
new functions.
(sweeprolog-forward-hole): new command.
(sweeprolog-end-of-predicate-definition,sweeprolog-insert-clause,
sweeprolog-maybe-insert-next-clause,
sweeprolog-maybe-define-predicate): new functions.
(sweeprolog-insert-term-functions): new hook.
(sweeprolog-insert-term-dwim): new command.
(sweeprolog-mode-map): bind new commands.
* sweeprolog-tests.el (dwim-define-predicate): new test case.
* README.org (Context-Based Term Insertion): new section.

2 years agoENHANCED: render refs to Prolog library in help buffers
Eshel Yaron [Sat, 22 Oct 2022 15:18:48 +0000 (18:18 +0300)]
ENHANCED: render refs to Prolog library in help buffers

* sweeprolog.el (sweeprolog-render-html-a): recognize and render
references to Prolog library files.

2 years agoHandle operators that contain '.' more reliably
Eshel Yaron [Fri, 21 Oct 2022 09:09:08 +0000 (12:09 +0300)]
Handle operators that contain '.' more reliably

2 years agoFIXED: handling of operators as predicate completion candidates
Eshel Yaron [Fri, 21 Oct 2022 08:38:13 +0000 (11:38 +0300)]
FIXED: handling of operators as predicate completion candidates

2 years agoFIXED: don't include irrelevant candidates in apropos results
Eshel Yaron [Fri, 21 Oct 2022 08:36:09 +0000 (11:36 +0300)]
FIXED: don't include irrelevant candidates in apropos results

* sweep.pl (sweep_predicate_apropos/2): filter candidates by minimum
match quality.

2 years agoENHANCED: add predicate properties list in help buffers
Eshel Yaron [Fri, 21 Oct 2022 08:32:10 +0000 (11:32 +0300)]
ENHANCED: add predicate properties list in help buffers

* sweep.pl (sweep_predicate_properties/2): new predicate.
* sweeprolog.el (sweeprolog--render-predicate-properties): new
function.
(sweeprolog--describe-predicate): use it.

2 years agoENHANCED: load and initialize sweep-module just-in-time V8.5.20-sweep-0.7.2
Eshel Yaron [Thu, 20 Oct 2022 19:38:43 +0000 (22:38 +0300)]
ENHANCED: load and initialize sweep-module just-in-time

Instead of loading sweep-module and initializing Prolog as part of
loading sweeprolog.el (subject to the user option
sweeprolog-init-on-load), this commit introduces just-in-time loading
and initialization of Prolog.  Suggested by Stefan Monnier.

* sweeprolog.el: (sweeprolog--open-query): new function, wraps
sweeprolog-open-query and initializes Prolog on the first call. Used
in place of sweeprolog-open-query throughout.
(sweeprolog-init-on-load): make variable obsolete.

2 years agoENHANCED: teach sweep to jump to C code for built-in predicates V8.5.20-sweep-0.7.1
Eshel Yaron [Wed, 19 Oct 2022 05:38:34 +0000 (08:38 +0300)]
ENHANCED: teach sweep to jump to C code for built-in predicates

* sweeprolog.el:
- sweeprolog-swipl-sources: new user option.
- sweeprolog-native-predicate-location: new function.
- sweeprolog-predicate-location: use it.
- README.org: Built-in Native Predicates: new section.

2 years agosweeprolog-describe-predicate compatibility with Emacs 27 V8.5.19 V8.5.20
Eshel Yaron [Mon, 17 Oct 2022 16:53:06 +0000 (19:53 +0300)]
sweeprolog-describe-predicate compatibility with Emacs 27

2 years agoENHANCED: prompt for sweeprolog-describe-predicate
Eshel Yaron [Mon, 17 Oct 2022 16:13:42 +0000 (19:13 +0300)]
ENHANCED: prompt for sweeprolog-describe-predicate

Following feedback from Jan Wielemaker

2 years agoFIXED: additional compatibility issue with buttons
Eshel Yaron [Mon, 17 Oct 2022 15:27:13 +0000 (18:27 +0300)]
FIXED: additional compatibility issue with buttons

2 years agoFIXED: sweeprolog-describe-predicate compatibility with Emacs 28
Eshel Yaron [Mon, 17 Oct 2022 15:07:25 +0000 (18:07 +0300)]
FIXED: sweeprolog-describe-predicate compatibility with Emacs 28

2 years agoADDED: new command for showing help for Prolog predicates V8.5.18-sweep-0.7.0
Eshel Yaron [Mon, 17 Oct 2022 07:56:27 +0000 (10:56 +0300)]
ADDED: new command for showing help for Prolog predicates

* sweep.pl: sweep_predicate_html_documentation/2: new predicate
* sweeprolog.el:
- sweeprolog-read-predicate-history: new variable.
- sweeprolog-read-predicate: use it, and default to the predicate at
point.
- sweeprolog--colour-term-to-faces: quote symbol
- sweeprolog-describe-predicate: new command.
- sweeprolog-help-prefix-map: bind it.
* README.org: Prolog Help: mention it.

2 years agoUse list notation for format/2
Jan Wielemaker [Mon, 17 Oct 2022 09:36:54 +0000 (11:36 +0200)]
Use list notation for format/2

2 years agoExtracted locating libswipl and sweep-module to sweep_link.pl
Eshel Yaron [Sun, 16 Oct 2022 18:34:21 +0000 (21:34 +0300)]
Extracted locating libswipl and sweep-module to sweep_link.pl

2 years agoADDED: new command for showing help for Prolog modules V8.5.18-sweep-0.6.3
Eshel Yaron [Sun, 16 Oct 2022 15:22:08 +0000 (18:22 +0300)]
ADDED: new command for showing help for Prolog modules

* sweep.pl: sweep_module_html_documentation/2: new predicate.
* sweeprolog.el:
- sweeprolog-read-module-history: new variable.
- sweeprolog-read-module-name: use it.
- sweeprolog--describe-module: new function.
- sweeprolog-describe-module: new command.
- sweeprolog-help-prefix-map: new keymap.
- sweeprolog-prefix-map: bind it keymap to `h'.
* README.org: Prolog Help: new section.

2 years agoENHANCED: update xref data for buffer after exporting predicate
Eshel Yaron [Sun, 16 Oct 2022 15:20:33 +0000 (18:20 +0300)]
ENHANCED: update xref data for buffer after exporting predicate

2 years agoFIXED: possible loop finding start of clause at start of buffer
Eshel Yaron [Sun, 16 Oct 2022 15:18:10 +0000 (18:18 +0300)]
FIXED: possible loop finding start of clause at start of buffer

2 years agoADDED: new command for exporting Prolog predicates V8.5.18-sweep-0.6.2
Eshel Yaron [Sat, 15 Oct 2022 10:25:39 +0000 (13:25 +0300)]
ADDED: new command for exporting Prolog predicates

* sweep.pl: sweep_local_predicate_export_comment/2: new predicate.
* sweeprolog.el:
- sweeprolog-read-exportable-predicate-prompt: new user option.
- sweeprolog--exportable-predicates: new buffer local variable.
- sweeprolog--colour-term-to-faces: accumulate exportable predicates.
- sweeprolog-colourise-buffer: reset sweeprolog--exportable-predicates.
- sweeprolog-export-predicate: new command.
- sweeprolog-mode-map: bind it.
- sweeprolog-menu: bind it.
- README.org: document it.

2 years agoDOC: mention new sweep Prolog flag in README.org and NEWS.org
Eshel Yaron [Sat, 15 Oct 2022 08:10:34 +0000 (11:10 +0300)]
DOC: mention new sweep Prolog flag in README.org and NEWS.org

2 years agoFIXED: sweep_identifier_at_point/2: possible infinite failure loop
Eshel Yaron [Sat, 15 Oct 2022 07:43:01 +0000 (10:43 +0300)]
FIXED: sweep_identifier_at_point/2: possible infinite failure loop

2 years agoFIXED: disregard stderr when invoking write_sweep_module_location
Eshel Yaron [Sat, 15 Oct 2022 06:26:41 +0000 (09:26 +0300)]
FIXED: disregard stderr when invoking write_sweep_module_location

2 years agoENHANCED: create Prolog flag sweep=true when running under sweep
Eshel Yaron [Sat, 15 Oct 2022 06:25:54 +0000 (09:25 +0300)]
ENHANCED: create Prolog flag sweep=true when running under sweep

2 years agoRemove unused dependencies library(help) and library(prolog_server)
Eshel Yaron [Sat, 15 Oct 2022 06:22:04 +0000 (09:22 +0300)]
Remove unused dependencies library(help) and library(prolog_server)

2 years agoLoad libswipl ahead of sweep-module if it's an ELF V8.5.18-sweep-0.6.1
Eshel Yaron [Thu, 13 Oct 2022 08:38:52 +0000 (11:38 +0300)]
Load libswipl ahead of sweep-module if it's an ELF

2 years agoDOC: index some keystrokes in the manual
Eshel Yaron [Thu, 13 Oct 2022 08:16:10 +0000 (11:16 +0300)]
DOC: index some keystrokes in the manual

2 years agoPORT: Try to find emacs-module.h in the $MINGW_ROOT to build it along with
Jan Wielemaker [Wed, 12 Oct 2022 08:43:08 +0000 (10:43 +0200)]
PORT: Try to find emacs-module.h in the $MINGW_ROOT to build it along with
the Windows versions.

2 years agoDOC: Update section "Things to do"
Eshel Yaron [Tue, 11 Oct 2022 14:37:08 +0000 (17:37 +0300)]
DOC: Update section "Things to do"

2 years agoENHANCED: use next-error-select-buffer when switching to a buffer V8.5.18-sweep-0.6.0
Eshel Yaron [Mon, 10 Oct 2022 12:59:14 +0000 (15:59 +0300)]
ENHANCED: use next-error-select-buffer when switching to a buffer

* sweeprolog.el: sweeprolog-mode: add hook to
window-selection-change-functions.

2 years agoFIXED: sweeprolog-end-of-top-term would get confused by "=.."
Eshel Yaron [Mon, 10 Oct 2022 12:31:29 +0000 (15:31 +0300)]
FIXED: sweeprolog-end-of-top-term would get confused by "=.."

* sweeprolog.el: sweeprolog-end-of-top-term: don't stop after "=..".
* sweeprolog-tests.el: add unit test.

2 years agoADDED: Flymake integration in sweeprolog-mode
Eshel Yaron [Sun, 9 Oct 2022 14:48:13 +0000 (17:48 +0300)]
ADDED: Flymake integration in sweeprolog-mode

* sweeprolog.el:
- sweeprolog-enable-flymake: new user option.
- sweeprolog--diagnostics: new buffer-local variable.
- sweeprolog--diagnostics-report-fn,
sweeprolog--diagnostics-changes-beg,
sweeprolog--diagnostics-changes-end: new buffer-local variables.
- sweeprolog-defface: add docstrings for generated functions.
- sweeprolog--colourise: accumulate diagnostics when
sweeprolog-enable-flymake is non-nil.
- sweeprolog-colourise-buffer, sweeprolog-colourise-some-terms: report
diagnostics when sweeprolog-enable-flymake is non-nil.
- sweeprolog-show-diagnostics: new command in sweeprolog-mode buffers.
- sweeprolog-mode-map: bind it.
- sweeprolog-diagnostic-function: new function.
- sweeprolog-mode: use it when sweeprolog-enable-flymake is non-nil.
* README.org: Examining diagnostics: new section.
* NEWS.org: announce flymake integration.

2 years agoDOC: add descriptions to all manual sections
Eshel Yaron [Sun, 9 Oct 2022 12:02:38 +0000 (15:02 +0300)]
DOC: add descriptions to all manual sections

2 years agoFIXED: quote file paths passed to shell-command-to-string
Eshel Yaron [Sun, 9 Oct 2022 04:41:34 +0000 (07:41 +0300)]
FIXED: quote file paths passed to shell-command-to-string

* sweeprolog.el: sweeprolog--ensure-module: quote paths and use
packaged sweep.pl
* README.org: fix typo

2 years agoADDED: new command and user option for updating whitespace
Eshel Yaron [Sat, 8 Oct 2022 20:38:45 +0000 (23:38 +0300)]
ADDED: new command and user option for updating whitespace

* sweeprolog.el:
- sweeprolog-align-spaces: new command, updates whitespace around
point according to SWI-Prolog conventions.
- sweeprolog-enable-cycle-spacing: new user option, when non-nil
sweeprolog-align-spaces is added to cycle-spacing-actions.
- sweeprolog-mode: use it.
- README.org: document it.
- NEWS.org: announce it.

2 years agoFIXED: detecting end of clause with inline comments ending with "."
Eshel Yaron [Fri, 7 Oct 2022 09:44:08 +0000 (12:44 +0300)]
FIXED: detecting end of clause with inline comments ending with "."

2 years agoUse sweep.pl from the ELPA package rather than from SWI-Prolog
Eshel Yaron [Fri, 7 Oct 2022 09:01:05 +0000 (12:01 +0300)]
Use sweep.pl from the ELPA package rather than from SWI-Prolog

2 years agoDOC: added short documentation for sweep as a SWI-Prolog package
Eshel Yaron [Fri, 7 Oct 2022 07:03:17 +0000 (10:03 +0300)]
DOC: added short documentation for sweep as a SWI-Prolog package

2 years agoPORT: don't use defvar-keymap, introduced only in Emacs 29
Eshel Yaron [Thu, 6 Oct 2022 19:37:00 +0000 (22:37 +0300)]
PORT: don't use defvar-keymap, introduced only in Emacs 29

2 years agoTEST: add unit test for nested Elisp->Prolog->Elisp call chains
Eshel Yaron [Thu, 6 Oct 2022 19:04:52 +0000 (22:04 +0300)]
TEST: add unit test for nested Elisp->Prolog->Elisp call chains

2 years agoENHANCED: allow for Elisp->Prolog->Elisp->... call chains
Eshel Yaron [Thu, 6 Oct 2022 18:18:31 +0000 (21:18 +0300)]
ENHANCED: allow for Elisp->Prolog->Elisp->... call chains