]> git.eshelyaron.com Git - sweep.git/log
sweep.git
15 months agoAllow communicating with top-level via tty instead of TCP top-level-pty
Eshel Yaron [Thu, 14 Sep 2023 16:28:16 +0000 (18:28 +0200)]
Allow communicating with top-level via tty instead of TCP

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

17 months agoAdd grouping and affixation functions for module completion
Eshel Yaron [Tue, 27 Jun 2023 18:36:45 +0000 (21:36 +0300)]
Add grouping and affixation functions for module completion

This adds a 'group-function' and an 'affixation-function' to
'sweeprolog-module-completion-table', for Emacs 28+

The affixation API allows us to compute the appropriate padding to
insert before annotations in a cleaner way.  Modules are group
according to their classes.

* sweep.pl (sweep_module_class/2): New predicate.

* sweeprolog.el (sweeprolog-module-minibuffer-annotation-1):
Extract helper function from...
(sweeprolog-module-minibuffer-annotation): ...here. Adapt.
(sweeprolog-module-minibuffer-affixation)
(sweeprolog-module-minibuffer-group): New functions.
(sweeprolog-module-completion-table): Use them.

17 months agoAnnounce recent changes in NEWS.org
Eshel Yaron [Tue, 27 Jun 2023 17:34:34 +0000 (20:34 +0300)]
Announce recent changes in NEWS.org

17 months agoReport correct predicate indicators in 'C-x 4 a'
Eshel Yaron [Tue, 27 Jun 2023 17:04:46 +0000 (20:04 +0300)]
Report correct predicate indicators in 'C-x 4 a'

* sweeprolog.el (sweeprolog-add-log-current-defun): New function.
(sweeprolog-mode): Set 'add-log-current-defun-function' to it.

* sweeprolog-tests.el: Test it.

17 months agoImprove module completion annotations
Eshel Yaron [Tue, 27 Jun 2023 16:53:49 +0000 (19:53 +0300)]
Improve module completion annotations

* sweep.pl (sweep_known_module/1, sweep_is_module/2)
(sweep_module_description_/3, sweep_matching_module/3)
(sweep_module_annotation/2): New predicates.
(sweep_modules_collection/2): Adapt.

* sweeprolog.el (sweeprolog-module-completion-table)
(sweeprolog-module-p, sweeprolog-module-minibuffer-annotation)
(sweeprolog-module-annotation): New functions.
(sweeprolog-modules-collection)
(sweeprolog-read-module-name): Adapt.
(sweeprolog-find-module): Improve feedback for modules that are not
backed by files.

18 months agoFix highlighting for nonexistent Prolog flag names
Eshel Yaron [Sat, 24 Jun 2023 07:42:06 +0000 (10:42 +0300)]
Fix highlighting for nonexistent Prolog flag names

18 months ago* sweeprolog.el: Reorganizes 'defface's
Eshel Yaron [Sat, 24 Jun 2023 07:38:49 +0000 (10:38 +0300)]
* sweeprolog.el: Reorganizes 'defface's

18 months ago* sweeprolog-pce-theme.el: Reformat
Eshel Yaron [Sat, 24 Jun 2023 07:37:07 +0000 (10:37 +0300)]
* sweeprolog-pce-theme.el: Reformat

18 months ago* README.org (PceEmacs Theme): Reword and fix typo
Eshel Yaron [Sat, 24 Jun 2023 07:32:57 +0000 (10:32 +0300)]
* README.org (PceEmacs Theme): Reword and fix typo

18 months agoMODIFIED: Replace "faces styles" with a theme emulating PceEmacs
Eshel Yaron [Fri, 23 Jun 2023 08:59:18 +0000 (11:59 +0300)]
MODIFIED: Replace "faces styles" with a theme emulating PceEmacs

This adds a custom theme called 'sweeprolog-pce' that mimics the
highlighting of SWI-Prolog's built-in editor, PceEmacs.  It obsoletes
the "faces styles" feature that Sweep provided thus far.  For backward
compatibility, The user option 'sweeprolog-faces-style' is retained
and mostly still respected.

Thanks to Stefan Monnier for suggesting this approach for simplifying
Sweep's code and making it more conformant with Emacs conventions.

* sweeprolog-pce-theme.el: New file.

* sweeprolog.el: Remove 'sweeprolog-defface' macro its
'sweeprolog-*-face' functions, use plain face definitions and refer to
them directly by their names instead.  Also extend
'custom-theme-load-path' to include the new sweeprolog-pce-theme.el.

* README.org (Semantic Highlighting): Replace "Available Styles"
subsection with new subsection "PceEmacs Theme".

18 months agoRefer to font-lock face directly instead of via variable
Eshel Yaron [Thu, 22 Jun 2023 08:01:13 +0000 (11:01 +0300)]
Refer to font-lock face directly instead of via variable

* sweeprolog.el (sweeprolog-predicate-modes-doc): Avoid using
deprecated "face variable".  Thanks to Stefan Monnier for suggesting
this improvement.

18 months agoDOC: Extend the "Overview" manual section
Eshel Yaron [Tue, 20 Jun 2023 11:21:38 +0000 (14:21 +0300)]
DOC: Extend the "Overview" manual section

* README.org (Main Features)
(Comparison with Emacs's built-in Prolog mode): New subsections.

18 months agoAnnounce recent changes in NEWS.org and bump version to 0.20.0 V9.1.10-sweep-0.20.0
Eshel Yaron [Mon, 19 Jun 2023 06:01:49 +0000 (09:01 +0300)]
Announce recent changes in NEWS.org and bump version to 0.20.0

18 months agoImprove documentation for persistent top-level history
Eshel Yaron [Mon, 19 Jun 2023 05:57:08 +0000 (08:57 +0300)]
Improve documentation for persistent top-level history

18 months agoADDED: Persistent history for Sweep top-levels
Eshel Yaron [Sun, 18 Jun 2023 19:32:33 +0000 (22:32 +0300)]
ADDED: Persistent history for Sweep top-levels

This adds a new user option that controls the value of
'comint-input-ring-file-name' in Sweep top-level buffers.

* sweeprolog.el (sweeprolog-top-level-persistent-history): New user
option.
(sweeprolog-top-level-sentinel)
(sweeprolog-top-level-setup-history): New functions.
(sweeprolog-top-level-setup-buffer): Call
'sweeprolog-top-level-setup-history' when creating a new top-level
buffer.

18 months agoUse 'derived-mode-p' instead of checking 'major-mode' directly
Eshel Yaron [Sun, 18 Jun 2023 15:51:16 +0000 (18:51 +0300)]
Use 'derived-mode-p' instead of checking 'major-mode' directly

* sweeprolog.el (sweeprolog-restart, sweeprolog-top-level-buffer)
(sweeprolog-top-level, sweeprolog-menu)
(sweeprolog-analyze-fragment-to-faces, sweeprolog-load-buffer): Use
'derived-mode-p' instead of checking 'major-mode' directly.

18 months agoAnnounce recent changes in NEWS.org and bump version to 0.19.1 V9.1.10-sweep-0.19.1
Eshel Yaron [Wed, 14 Jun 2023 07:57:03 +0000 (10:57 +0300)]
Announce recent changes in NEWS.org and bump version to 0.19.1

18 months agoFIXED: Correctly recognize DCG grammar rules in 'C-c C-d'
Eshel Yaron [Wed, 14 Jun 2023 07:37:02 +0000 (10:37 +0300)]
FIXED: Correctly recognize DCG grammar rules in 'C-c C-d'

* sweeprolog.el (sweeprolog-beginning-of-predicate-at-point): Also
return the module and neck operator of the predicate at point.
(sweeprolog-insert-predicate-documentation)
(sweeprolog-read-predicate-documentation-function)
(sweeprolog-read-predicate-documentation-with-holes)
(sweeprolog-read-predicate-documentation-default-function)
(sweeprolog-read-predicate-documentation)
(sweeprolog-document-predicate-at-point): Adapt to support DCGs and
non-local predicates.

18 months agoSimplify 'sweeprolog-beginning-of-top-term'
Eshel Yaron [Tue, 13 Jun 2023 15:54:50 +0000 (18:54 +0300)]
Simplify 'sweeprolog-beginning-of-top-term'

Extract the core of 'sweeprolog-beginning-of-top-term' to
'sweeprolog-beginning-of-top-term-once' and make it leave point at the
very beginning of the top term, rather than at the following
character.

* sweeprolog.el (sweeprolog-beginning-of-top-term-once): New function.
(sweeprolog-beginning-of-top-term): Use it.
(sweeprolog-local-variables-collection)
(sweeprolog-analyze-term)
(sweeprolog-analyze-some-terms)
(sweeprolog-beginning-of-predicate-at-point)
(sweeprolog-terms-at-point): Adapt.

18 months agoENHANCED: Guess argument names for DCG grammar rules
Eshel Yaron [Sun, 11 Jun 2023 18:05:13 +0000 (21:05 +0300)]
ENHANCED: Guess argument names for DCG grammar rules

* sweeprolog.el (sweeprolog-predicate-completion-at-point)
(sweeprolog-insert-clause): Support guessing argument names from
documentation also for DCG grammar rules.

18 months agoENHANCED: Also highlight "undefined" head terms
Eshel Yaron [Sun, 11 Jun 2023 18:03:53 +0000 (21:03 +0300)]
ENHANCED: Also highlight "undefined" head terms

18 months agoENHANCED: 'sweeprolog-find-predicate/module' improvements
Eshel Yaron [Sun, 11 Jun 2023 17:56:40 +0000 (20:56 +0300)]
ENHANCED: 'sweeprolog-find-predicate/module' improvements

Allow finding modules and predicates in another window with prefix
argument.  Also improve prompt for 'sweeprolog-find-predicate'.

* sweeprolog.el (sweeprolog-read-predicate-prompt): Remove trailing
colon and space.
(sweeprolog-predicate-visible-p-function): New user option.
(sweeprolog-read-predicate): Use it, and format PROMPT with predicate
at point as the default argument.
(sweeprolog-find-module)
(sweeprolog-find-predicate): Add optional argument OTHER-WINDOW.
(sweeprolog-describe-predicate): Adapt PROMPT argument passed to
'sweeprolog-read-predicate'.

* README.org (Finding Prolog Code): Expand.

18 months ago* README.org (High-level Architecture): Minor tweaks.
Eshel Yaron [Sun, 11 Jun 2023 14:16:21 +0000 (17:16 +0300)]
* README.org (High-level Architecture): Minor tweaks.

18 months agoAnnounce recent changes in NEWS.org and bump version to 0.19.0 V9.1.10-sweep-0.19.0
Eshel Yaron [Thu, 8 Jun 2023 18:12:21 +0000 (21:12 +0300)]
Announce recent changes in NEWS.org and bump version to 0.19.0

18 months agoENHANCED: Improve DCG support
Eshel Yaron [Thu, 8 Jun 2023 17:46:45 +0000 (20:46 +0300)]
ENHANCED: Improve DCG support

Take into account DCG grammar rules and ensure they're supported all
around.  Crucially, allow 'sweeprolog-describe-predicate' to display
documentation for DCG grammar rules.

18 months agoFIXED: Don't change hooks globally
Eshel Yaron [Thu, 8 Jun 2023 17:37:13 +0000 (20:37 +0300)]
FIXED: Don't change hooks globally

* sweeprolog.el (sweeprolog-mode): Extend 'kill-buffer-hook' and
'context-menu-functions' locally rather than global.

18 months ago* sweeprolog.el (sweeprolog-context-menu-for-module): Fix typo
Eshel Yaron [Thu, 8 Jun 2023 17:35:32 +0000 (20:35 +0300)]
* sweeprolog.el (sweeprolog-context-menu-for-module): Fix typo

18 months agoGive a better name to 'sweeprolog--mfn-to-functor-arity'
Eshel Yaron [Thu, 8 Jun 2023 17:33:55 +0000 (20:33 +0300)]
Give a better name to 'sweeprolog--mfn-to-functor-arity'

* sweeprolog.el (sweeprolog--pi-to-functor-arity): New function,
renamed from 'sweeprolog--mfn-to-functor-arity'.
(sweeprolog-native-predicate-location): Use it.

18 months agoFix a couple of typos in docstrings
Eshel Yaron [Thu, 8 Jun 2023 17:29:58 +0000 (20:29 +0300)]
Fix a couple of typos in docstrings

* sweeprolog.el (sweeprolog-predicates-collection)
(sweeprolog-head-undefined-face): Fix typo in docstring.

18 months agoAnnounce recent changes in NEWS.org and bump version to 0.18.4 V9.1.10-sweep-0.18.4
Eshel Yaron [Tue, 6 Jun 2023 06:16:04 +0000 (09:16 +0300)]
Announce recent changes in NEWS.org and bump version to 0.18.4

18 months agoENHANCED: Add tooltip info for string-stye DCG terminals
Eshel Yaron [Tue, 6 Jun 2023 05:32:37 +0000 (08:32 +0300)]
ENHANCED: Add tooltip info for string-stye DCG terminals

18 months agoUse 'ignore-errors' instead of 'condition-case' with no handlers
Eshel Yaron [Tue, 6 Jun 2023 05:24:57 +0000 (08:24 +0300)]
Use 'ignore-errors' instead of 'condition-case' with no handlers

18 months agoAdd docstring for 'sweeprolog-definition-at-point'
Eshel Yaron [Tue, 6 Jun 2023 05:24:36 +0000 (08:24 +0300)]
Add docstring for 'sweeprolog-definition-at-point'

18 months agoENHANCED: Export DCG non-terminals as 'foo//N', not 'foo/N+2'
Eshel Yaron [Tue, 6 Jun 2023 05:17:33 +0000 (08:17 +0300)]
ENHANCED: Export DCG non-terminals as 'foo//N', not 'foo/N+2'

* sweep.pl (strip_det/2): Handle DCG non-terminals with determinism
specification.
(sweep_local_predicate_export_comment/2, sweep_exportable_predicates/2)
* sweeprolog.el (sweeprolog-local-export-comment)
(sweeprolog-local-export-comment): Adapt for DCG non-terminals.

18 months agoENHANCED: Highlight string-style DCG terminals
Eshel Yaron [Tue, 6 Jun 2023 05:16:11 +0000 (08:16 +0300)]
ENHANCED: Highlight string-style DCG terminals

18 months agoAnnounce recent changes in NEWS.org and bump version to 0.18.3
Eshel Yaron [Thu, 1 Jun 2023 17:17:03 +0000 (20:17 +0300)]
Announce recent changes in NEWS.org and bump version to 0.18.3

18 months agoAvoid using 'string-replace' for Emacs 27 compatibility
Eshel Yaron [Thu, 1 Jun 2023 15:46:23 +0000 (18:46 +0300)]
Avoid using 'string-replace' for Emacs 27 compatibility

* sweeprolog.el (sweeprolog-top-level-example-done): Refactor and use
'replace-regexp-in-string' instead of 'string-replace'.

18 months agoTest 'sweeprolog-make-example-usage-comment'
Eshel Yaron [Thu, 1 Jun 2023 15:26:47 +0000 (18:26 +0300)]
Test 'sweeprolog-make-example-usage-comment'

18 months agoADDED: highlighting and tooltip info for declaration options
Eshel Yaron [Thu, 1 Jun 2023 11:23:11 +0000 (14:23 +0300)]
ADDED: highlighting and tooltip info for declaration options

* sweep.pl (sweep_color_normalized_/4): Handle 'decl_option/1'
fragments.

* sweeprolog.el (sweeprolog-declaration-option): New face, used in...
(sweeprolog-analyze-fragment-to-faces): ...for 'decl_option' frags.
(sweeprolog--help-echo-for-declaration-option): New function.
(sweeprolog-analyze-fragment-help-echo): Use it.

18 months ago* README.org (Example Usage Comments): improve wording
Eshel Yaron [Thu, 1 Jun 2023 11:21:09 +0000 (14:21 +0300)]
* README.org (Example Usage Comments): improve wording

18 months agoAnnounce recent changes in NEWS.org and bump version to 0.18.2
Eshel Yaron [Tue, 30 May 2023 19:34:37 +0000 (22:34 +0300)]
Announce recent changes in NEWS.org and bump version to 0.18.2

18 months agoADDED: command for inserting example usage comments
Eshel Yaron [Tue, 30 May 2023 19:29:34 +0000 (22:29 +0300)]
ADDED: command for inserting example usage comments

* sweeprolog.el (sweeprolog-top-level-example-mode): New minor mode.
(sweeprolog-make-example-usage-comment): New command.
(sweeprolog-mode-map): Bind it.

* README.org (Example Usage Comments): New section.