* Overview
:PROPERTIES:
:CUSTOM_ID: overview
+:DESCRIPTION: Major mode for reading and writing Prolog
:END:
=sweep= is an embedding of SWI-Prolog in Emacs. It provides an
** High-level architecture
:PROPERTIES:
:CUSTOM_ID: high-level-architecture
+:DESCRIPTION: Overall structure of this project
:END:
=sweep= uses the C interfaces of both SWI-Prolog and Emacs Lisp to
* Installation
:PROPERTIES:
:CUSTOM_ID: installation
+:DESCRIPTION: Intructions for installing sweep
:END:
The dynamic Emacs module =sweep-module= is included in the SWI-Prolog
* Getting started
:PROPERTIES:
:CUSTOM_ID: getting-started
+:DESCRIPTION: First steps with sweep
:END:
After installing the =sweeprolog= Elisp library, load it into Emacs:
* Prolog initialization and cleanup
:PROPERTIES:
:CUSTOM_ID: prolog-init
+:DESCRIPTION: Functions for starting and stopping the embedded Prolog runtime
:END:
#+FINDEX: sweeprolog-initialize
* Querying Prolog
:PROPERTIES:
:CUSTOM_ID: querying-prolog
+:DESCRIPTION: Functions for invoking Prolog predicates and consuming their results
:END:
#+FINDEX: sweeprolog-open-query
** Conversion of Elisp objects to Prolog terms
:PROPERTIES:
:CUSTOM_ID: elisp-to-prolog
+:DESCRIPTION: How sweep translates Emacs Lisp to Prolog
:END:
=sweep= converts Elisp objects into Prolog terms to allow the Elisp
** Conversion of Prolog terms to Elisp objects
:PROPERTIES:
:CUSTOM_ID: prolog-to-elisp
+:DESCRIPTION: How sweep translates Prolog to Emacs Lisp
:END:
=sweep= converts Prolog terms into Elisp object to allow efficient
** Calling Elisp function inside Prolog queries
:PROPERTIES:
:CUSTOM_ID: funcall-from-prolog
+:DESCRIPTION: Special predicates for calling back to Emacs from Prolog
:END:
The =sweep-module= defines the foreign Prolog predicates =sweep_funcall/2=
* Editing Prolog code
:PROPERTIES:
:CUSTOM_ID: editing-prolog-code
+:DESCRIPTION: Major mode for reading and writing Prolog
:END:
#+CINDEX: sweeprolog-mode
** Indentation
:PROPERTIES:
:CUSTOM_ID: indentation
+:DESCRIPTION: How sweep indents Prolog code
:END:
#+CINDEX: indentation
*** Indentation rules
:PROPERTIES:
:CUSTOM_ID: indentation-rules
+:DESCRIPTION: The intented indentation scenaria
:END:
Lines in =sweeprolog-mode= buffers are indented according to the following
** Semantic highlighting
:PROPERTIES:
:CUSTOM_ID: semantic-highlighting
+:DESCRIPTION: Rich fontification for Prolog code
:END:
#+CINDEX: fontification
*** Available styles
:PROPERTIES:
:CUSTOM_ID: highlighting-styles
+:DESCRIPTION: Available highlighting styles
:END:
=sweep= comes with three highlighting styles:
*** Highlighting occurrences of a variable
:PROPERTIES:
:CUSTOM_ID: variable-highlighting
+:DESCRIPTION: Commands for emphasizing all occurrences of a Prolog variable
:END:
#+CINDEX: variable highlighting
*** Quasi-quotation highlighting
:PROPERTIES:
:CUSTOM_ID: qq-highlighting
+:DESCRIPTION: Delegating fontification of quasi-quoted contents to other Emacs major modes
:END:
Quasi-quotations in =sweeprolog-mode= buffer are highlighted according
For more information about quasi-quotations in SWI-Prolog, see
[[https://www.swi-prolog.org/pldoc/man?section=quasiquotations][library(quasi_quotations) in the SWI-Prolog manual]].
-
** Aligning with multiple spaces
:PROPERTIES:
:CUSTOM_ID: whitespace
+:DESCRIPTION: Commands for aligning Prolog code without having to count spaces
:END:
#+CINDEX: whitespace
** Term-based editing and motion commands
:PROPERTIES:
:CUSTOM_ID: term-based-commands
+:DESCRIPTION: Commands that recognize and operate on Prolog terms
:END:
#+CINDEX: sexps
** Definitions and references
:PROPERTIES:
:CUSTOM_ID: sweeprolog-xref
+:DESCRIPTION: Commands for finding cross-references for Prolog predicates
:END:
#+CINDEX: xref
** Following file specifications
:PROPERTIES:
:CUSTOM_ID: following-file-specs
+:DESCRIPTION: Commands for jumping to files that appear in Prolog code
:END:
#+FINDEX: sweeprolog-find-file-at-point
** Loading buffers
:PROPERTIES:
:CUSTOM_ID: loading-buffers
+:DESCRIPTION: Commands for loading Prolog predicates from the current buffer
:END:
#+CINDEX: loading
** Using templates for creating new modules
:PROPERTIES:
:CUSTOM_ID: auto-insert
+:DESCRIPTION: Commands for populating new Prolog modules with predefined contents
:END:
#+CINDEX: auto-insert
** Documenting predicates
:PROPERTIES:
:CUSTOM_ID: sweeprolog-pldoc
+:DESCRIPTION: Commands for adding documentation to Prolog predicate definitions
:END:
#+CINDEX: pldoc
** Displaying predicate documentation
:PROPERTIES:
:CUSTOM_ID: eldoc-integration
+:DESCRIPTION: Commands for showing documentation for Prolog predicates
:END:
=sweep= integrates with the Emacs minor mode =ElDoc=, which automatically
* The Prolog top-level
:PROPERTIES:
:CUSTOM_ID: prolog-top-level
+:DESCRIPTION: Executing Prolog queries in a REPL-like interface
:END:
#+CINDEX: top-level
** Multiple top-levels
:PROPERTIES:
:CUSTOM_ID: multiple-top-levels
+:DESCRIPTION: Creating and handling multiple Prolog top-level buffers
:END:
Any number of top-levels can be created and used concurrently, each in
** Sending signals to running top-levels
:PROPERTIES:
:CUSTOM_ID: top-level-signals
+:DESCRIPTION: Commands for interrupting running Prolog top-levels
:END:
#+CINDEX: signaling Prolog threads
** Top-level history
:PROPERTIES:
:CUSTOM_ID: top-level-history
+:DESCRIPTION: Accessing previous queries posted to the Prolog top-level
:END:
=sweeprolog-top-level-mode= buffers provide a history of previously user
** Completion in the top-level
:PROPERTIES:
:CUSTOM_ID: completion-in-top-level
+:DESCRIPTION: Commands for completing partiat Prolog predicate names
:END:
The =sweeprolog-top-level-mode=, enabled in the =sweep= top-level buffer,
* Finding Prolog code
:PROPERTIES:
:CUSTOM_ID: finding-prolog-code
+:DESCRIPTION: Commands for locating and opening Prolog files
:END:
#+FINDEX: sweeprolog-find-module
** Prolog file specification expansion
:PROPERTIES:
:CUSTOM_ID: file-spec-expansion
+:DESCRIPTION: Integration with standard Emacs file-finding commands
:END:
=sweep= defines a handler for the Emacs function =expand-file-file= that
* Quick access to sweep commands
:PROPERTIES:
:CUSTOM_ID: quick-command-access
+:DESCRIPTION: Keymap for useful commands that can be invoked from any buffer
:END:
#+VINDEX: sweeprolog-prefix-map
* Examining Prolog messages
:PROPERTIES:
:CUSTOM_ID: prolog-messages
+:DESCRIPTION: Messages emitted in the embedded Prolog runtime and how to display them
:END:
#+CINDEX: messages
* Setting Prolog flags
:PROPERTIES:
:CUSTOM_ID: prolog-flags
+:DESCRIPTION: Commands for modifying the configuration of the embedded Prolog runtime by setting Prolog flags
:END:
#+CINDEX: prolog flags
* Installing Prolog packages
:PROPERTIES:
:CUSTOM_ID: prolog-packages
+:DESCRIPTION: Commands for installing SWI-Prolog add-ons
:END:
#+FINDEX: sweeprolog-pack-install
* Contributing
:PROPERTIES:
:CUSTOM_ID: contributing
+:DESCRIPTION: Information for users and hackers looking to get involved in the development of this project
:END:
We highly appreciate all contributions, including bug reports,
** Setting up sweep for local development
:PROPERTIES:
:CUSTOM_ID: development-setup
+:DESCRIPTION: Instructions for preparing a local development environment for working on sweep
:END:
Since the Prolog and C parts of ~sweep~ are intended to be distributed
** Submitting patches and bug reports
:PROPERTIES:
:CUSTOM_ID: submitting-patches
+:DESCRIPTION: Commands for contacting the maintainers of this project
:END:
The best way to get in touch with the ~sweep~ maintainers is via [[https://lists.sr.ht/~eshel/dev][the
* Things to do
:PROPERTIES:
:CUSTOM_ID: thigs-to-do
+:DESCRIPTION: Breakdown of topics that deserve more attention
:END:
While ~sweep~ is ready to be used for effective editing of Prolog code,
** Improvements around editing Prolog
:PROPERTIES:
:CUSTOM_ID: todo-editing
+:DESCRIPTION: List of potential enhancements for reading and writing Prolog
:END:
- Inherit user customizations from ~prolog-mode~ :: ~sweep~ should inherit
** Improvements around running Prolog
:PROPERTIES:
:CUSTOM_ID: todo-running
+:DESCRIPTION: List of potential enhancements for executing Prolog
:END:
+
- Persist top-level history across sessions :: ~sweep~ should persist
Prolog top-level histories across invocations of
~sweeprolog-top-level~, ideally also across different Emacs sessions.
** General improvements
:PROPERTIES:
:CUSTOM_ID: todo-general
+:DESCRIPTION: List of potentially useful new features
:END:
+
- Facilitate interactive debugging :: ~sweep~ should facilitate
interactive debugging of SWI-Prolog code. This is a big topic that
we don't currently address. Perhaps this should handled through