File: sweep.doc

package info (click to toggle)
swi-prolog 9.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 82,408 kB
  • sloc: ansic: 387,503; perl: 359,326; cpp: 6,613; lisp: 6,247; java: 5,540; sh: 3,147; javascript: 2,668; python: 1,900; ruby: 1,594; yacc: 845; makefile: 428; xml: 317; sed: 12; sql: 6
file content (89 lines) | stat: -rw-r--r-- 2,502 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
\documentclass[11pt]{article}
\usepackage{times}
\usepackage{pl}
\usepackage{html}
\sloppy
\makeindex

\onefile
\htmloutput{.}					% Output directory
\htmlmainfile{sweep}				% Main document file
\bodycolor{white}				% Page colour

\begin{document}

\title{sweep: SWI-Prolog Embedded in Emacs}
\author{Eshel Yaron\email{me@eshelyaron.com}}

\maketitle

\begin{abstract}
  \texttt{sweep} is an embedding of SWI-Prolog in GNU Emacs.  It
  provides an interface for executing Prolog queries and consuming
  their results from Emacs Lisp.  \texttt{sweep} further builds on top
  of this interface and on top of the standard Emacs facilities to
  provide advanced features for developing SWI-Prolog programs in
  Emacs.
\end{abstract}

\pagebreak
\tableofcontents

\section{Installation}
\label{sec:sweep-installation}

The \texttt{sweeprolog} Elisp package is available on NonGNU ELPA, to
install \texttt{sweeprolog} simply open Emacs and type \texttt{M-x
  package-install RET sweeprolog RET}.

An alternative to installing from ELPA is to get the Elisp library
from the \texttt{sweep} Git repository:

\begin{enumerate}
\item Clone the \texttt{sweep} repository:
  \begin{code}
    git clone https://git.sr.ht/~eshel/sweep
  \end{code}

  Or:

  \begin{code}
    git clone https://github.com/SWI-Prolog/packages-sweep sweep
  \end{code}

\item Add \texttt{sweep} to Emacs' \texttt{load-path}:
  \begin{code}
    (add-to-list 'load-path "/path/to/sweep")
  \end{code}
\end{enumerate}

\section{Getting started}
\label{sec:sweep-getting-started}
After installing the \texttt{sweeprolog} Elisp library, load it into
Emacs:

\begin{code}
  (require 'sweeprolog)
\end{code}

All set!  \texttt{sweeprolog} automatically loads
\texttt{sweep-module} and initializes the embedded SWI-Prolog runtime.
For a full description of the different features of \texttt{sweep},
see \href{https://eshelyaron.com/sweep.html}{the \texttt{sweep}
  manual}.

\textit{Important note for Linux users}: prior to version 29, Emacs
would load dynamic modules in a way that is not fully compatible with
the way the SWI-Prolog native library, \texttt{libswipl}, loads its
own native extensions.  This may lead to \texttt{sweep} failing after
loading \texttt{sweep-module}.  To work around this issue, users
running Emacs 28 or earlier on Linux can start Emacs with
\texttt{libswipl} loaded upfront via \texttt{LD_PRELOAD}, for example:

\begin{code}
  LD_PRELOAD=/usr/local/lib/libswipl.so emacs
\end{code}

\printindex

\end{document}