For further details, please consult the manual:
<https://eshelyaron.com/sweep.html>.
+* Version 0.9.4 on 2022-12-06
+
+** New minor mode for moving to holes with ~TAB~
+
+This version introduces a new minor mode
+~sweeprolog-forward-hole-on-tab-mode~, which binds ~TAB~ to a command that
+moves either indents the current line or moves to the next hole in the
+buffer, in a DWIM fashion.
+
+** Fixes and minor improvements
+
+- Automatic indentation is improved to accommodate for DCG RHS
+ contexts and SSU guards.
+- ~sweeprolog-identifier-at-point~ now qualifies head terms with
+ according to the current module (e.g. ~foo:bar/2~ is returned when
+ point is over ~bar(_, _)~ in module ~foo~).
+
* Version 0.9.3 on 2022-11-27
** Added repeat keymap for ~sweeprolog-forward-hole~ (Emacs 28+)
#+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 in case are determined by the value of the
-user-option ~sweeprolog-init-args~ which the user is free to extend with
-e.g.:
+initialize Prolog are then determined by the value of the user-option
+~sweeprolog-init-args~ which the user is free to extend with e.g.:
#+begin_src emacs-lisp
(add-to-list 'sweeprolog-init-args "--stack-limit=512m")
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
+shell-based interaction with SWI-Prolog. This is achieved by adding
+the flag ~--swipl-args~ followed by any number of arguments intended for
+SWI-Prolog, with a single semicolon (";") argument marking the end of
+the SWI-Prolog arguments, after which further arguments are processed
+by Emacs as usual (see [[info:emacs#Emacs Invocation][Emacs Invocation]] for more information about
+Emacs's command line options), for example:
+
+#+begin_src sh
+ emacs --some-emacs-option --swipl-args -l foobar.pl \; --more-emacs-options
+#+end_src
+
+In order for =sweep= to be able to handle Emacs's command line
+arguments, the function ~sweeprolog-handle-command-line-args~ must be
+called before Emacs processes the ~--swipl-args~ argument. This can be
+ensured by calling it from the command line as well:
+
+#+begin_src sh
+ 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
directories containing SWI-Prolog =pack.pl= package definitions as
root project directories.
-- Add command line arguments handling for Prolog flags :: ~sweep~ should
- make it easy to specify Prolog initialization arguments (see [[#prolog-init][Prolog
- initialization and cleanup]]) already in the Emacs command line
- invocation. One way to achieve that would be to extend
- ~command-line-functions~ with a custom command line arguments handler.
-
- Extend the provided Elisp-Prolog interface :: Currently, the Elisp
interface that ~sweep~ provides for querying Prolog only allows
calling directly to predicates of arity 2 (see [[#querying-prolog][Querying Prolog]]),
"
))))
+(ert-deftest update-dependencies-autoload-from-package ()
+ "Tests making implicit autoloads from a package explicit."
+ (let ((temp (make-temp-file "sweeprolog-test"
+ nil
+ "pl"
+ "
+:- module(foo, [bar/1]).
+
+/** <module> Foo
+
+*/
+
+bar(X) :- http_open(X, X, X).
+"
+ )))
+ (find-file-literally temp)
+ (sweeprolog-mode)
+ (call-interactively #'sweeprolog-update-dependencies)
+ (should (string= (buffer-string)
+ "
+:- module(foo, [bar/1]).
+
+/** <module> Foo
+
+*/
+
+:- autoload(library(http/http_open), [ http_open/3
+ ]).
+
+bar(X) :- http_open(X, X, X).
+"))))
+
(ert-deftest update-dependencies ()
"Tests making implicit autoloads explicit."
(let ((temp (make-temp-file "sweeprolog-test"