[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/sweeprolog 2b254c432f 11/11: * README.org ("Initialization
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/sweeprolog 2b254c432f 11/11: * README.org ("Initialization and Cleanup"): improve listings |
Date: |
Sun, 15 Jan 2023 05:02:49 -0500 (EST) |
branch: elpa/sweeprolog
commit 2b254c432f654ddca03322124e6976f61ae51263
Author: Eshel Yaron <me@eshelyaron.com>
Commit: Eshel Yaron <me@eshelyaron.com>
* README.org ("Initialization and Cleanup"): improve listings
---
README.org | 33 +++++++++++++++++++++++++--------
sweeprolog.el | 1 +
2 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/README.org b/README.org
index 3f277d0b4a..4b50445480 100644
--- a/README.org
+++ b/README.org
@@ -100,7 +100,7 @@ from the Sweep Git repository:
(add-to-list 'load-path "/path/to/sweep")
#+end_src
-* Getting started
+* Getting Started
:PROPERTIES:
:CUSTOM_ID: getting-started
:DESCRIPTION: First steps with sweep
@@ -149,9 +149,29 @@ start Emacs with =libswipl= loaded upfront via
=LD_PRELOAD=, for example:
:ALT_TITLE: Initialization
:END:
-#+FINDEX: sweeprolog-initialize
The embedded SWI-Prolog runtime must be initialized before it can
-start executing queries. In Sweep, Prolog initialization is done via
+start executing queries. Initializing Prolog is usually taken care of
+by Sweep when you first use a command that requires running some
+Prolog code. This section elaborates about Prolog initialization and
+its customization options in Sweep:
+
+- Function: sweeprolog-initialize prog &rest args :: Initialize the
+ embedded Prolog runtime. PROG should be the path to the =swipl=
+ executable, and ARGS should be a list of strings denoting command
+ line arguments for =swipl=. They are used to initialize Prolog as if
+ it was started from the command line as ~PROG ARGS~.
+- Function: sweeprolog-handle-command-line-args :: Enable support for
+ the Sweep specific ~--swipl-args~ Emacs command line flag. This flag
+ can be used to specify additional Prolog initialization arguments
+ for Sweep to use when initializing Prolog on-demand, directly from
+ Emacs's command line invocation.
+- User Option: sweeprolog-init-args :: List of strings used as
+ initialization arguments for Prolog. Sweep uses these as the ARGS
+ argument of ~sweeprolog-initialize~ when it initializes Prolog
+ on-demand.
+- Command: sweeprolog-restart :: Restart the embedded Prolog runtime.
+
+In Sweep, Prolog initialization is done via
the C-implemented =sweeprolog-initialize= Elisp function defined in
=sweep-module=. =sweeprolog-initialize= takes one or more arguments, which
must all be strings, and initializes the embedded Prolog as if it were
@@ -159,7 +179,6 @@ invoked externally in a command line with the given strings
as command
line arguments, where the first argument to =sweeprolog-initialize=
corresponds to =argv[0]=.
-#+VINDEX: sweeprolog-init-args
Sweep loads and initializes Prolog on-demand at the first invocation
of a command that requires the embedded Prolog. The arguments used to
initialize Prolog are then determined by the value of the user-option
@@ -175,7 +194,6 @@ helper library =sweep.pl= and to create a boolean Prolog
flag Sweep, set
to ~true~, which indicates to SWI-Prolog that it is running under Sweep.
#+CINDEX: command line arguments
-#+FINDEX: sweeprolog-handle-command-line-args
It is also possible to specify initialization arguments to SWI-Prolog
by passing them as command line arguments to Emacs, which can be
convenient when using Emacs and Sweep as an alternative for the common
@@ -199,7 +217,6 @@ ensured by calling it from the command line as well:
emacs -f sweeprolog-handle-command-line-args --swipl-args -l foobar.pl \;
#+end_src
-#+FINDEX: sweeprolog-restart
The embedded Prolog runtime can be reset using the command
~sweeprolog-restart~. This command cleans up the the Prolog state and
resources, and starts it anew. When called with a prefix argument
@@ -214,8 +231,8 @@ runtime on startup.
:ALT_TITLE: Querying Prolog
:END:
-This section describes a set of Elisp functions that interfaces with
-the embedded Prolog runtime:
+This section describes a set of Elisp functions that let you invoke
+Prolog queries and interact with the embedded Prolog runtime:
- Function: sweeprolog-open-query context module functor input reverse ::
Query
the Prolog predicate MODULE:FUNCTOR/2 in the context of the module
diff --git a/sweeprolog.el b/sweeprolog.el
index 61c5aa3514..5812596040 100644
--- a/sweeprolog.el
+++ b/sweeprolog.el
@@ -4663,6 +4663,7 @@ properly."
;;;###autoload
(defun sweeprolog-handle-command-line-args ()
+ "Add flag `--swipl-args' to Emacs's command line handling."
(add-to-list 'command-line-functions
#'sweeprolog-command-line-function))
- [nongnu] elpa/sweeprolog updated (eb2608bc64 -> 2b254c432f), ELPA Syncer, 2023/01/15
- [nongnu] elpa/sweeprolog 95fbd1388e 01/11: Refer to Sweep as a whole as "Sweep" without verbatim format, ELPA Syncer, 2023/01/15
- [nongnu] elpa/sweeprolog 4576120f54 04/11: Bind C-c S-TAB to sweeprolog-backward-hole for symmetry, ELPA Syncer, 2023/01/15
- [nongnu] elpa/sweeprolog 471fc1aada 05/11: DOC: improve listings in the "Editing Prolog Code" section, ELPA Syncer, 2023/01/15
- [nongnu] elpa/sweeprolog 9823b09f6a 02/11: * sweeprolog.el: fix some typos in docstrings, ELPA Syncer, 2023/01/15
- [nongnu] elpa/sweeprolog 3a8d0d1626 09/11: * README.org ("High-level Architecture"): fix out-of-date docs, ELPA Syncer, 2023/01/15
- [nongnu] elpa/sweeprolog 98cfbd1999 08/11: * README.org ("Initialization and Cleanup"): use title case, ELPA Syncer, 2023/01/15
- [nongnu] elpa/sweeprolog 2b254c432f 11/11: * README.org ("Initialization and Cleanup"): improve listings,
ELPA Syncer <=
- [nongnu] elpa/sweeprolog 3e02ab91fd 03/11: Add a couple of missing docstrings, ELPA Syncer, 2023/01/15
- [nongnu] elpa/sweeprolog 4028141133 06/11: * (sweeprolog-prefix-map): bind sweeprolog-top-level-send-goal to q, ELPA Syncer, 2023/01/15
- [nongnu] elpa/sweeprolog b02213d87f 10/11: * README.org: use ~code~ over =verbatim= more consistently, ELPA Syncer, 2023/01/15
- [nongnu] elpa/sweeprolog d3c4102c0a 07/11: * README.org ("Querying Prolog"): improve function listing, ELPA Syncer, 2023/01/15