File: README.md

package info (click to toggle)
swi-prolog 9.2.9%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 84,456 kB
  • sloc: ansic: 401,705; perl: 374,799; lisp: 9,080; cpp: 8,920; java: 5,525; sh: 3,282; javascript: 2,690; python: 2,655; ruby: 1,594; yacc: 845; makefile: 440; xml: 317; sed: 12; sql: 6
file content (64 lines) | stat: -rw-r--r-- 2,355 bytes parent folder | download | duplicates (2)
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
# Overview

Sweep is an embedding of SWI-Prolog in Emacs.  It provides an
interface for executing Prolog queries and consuming their results
from Emacs Lisp.  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.

## Main Features

Some of the main benefits that Sweep brings to working with Prolog
code in Emacs are:

- Semantic highlighting
- Automatic indentation
- Structural editing and navigation
- Jumping to predicate definitions and references
- On-the-fly diagnostics
- Intelligent code completion
- Refactoring support
- Integrated SWI-Prolog top-level
- Ability to run Prolog queries directly from Emacs Lisp

These features and others, along with many options that Sweep provides
for you to customize its behavior, are documented in [the Sweep manual](https://eshelyaron.com/sweep.html).

# Installation

Installing Sweep requires:

-   Emacs 27 or later, and
-   SWI-Prolog 8.5.18 or later.

Sweep is available from NonGNU ELPA, to install it simply type in
Emacs `M-x package-install RET sweeprolog RET`.

Note that in Emacs prior to version 28, you need to explicitly enable
NonGNU ELPA by adding something like the following to your Emacs
configuration:

    (with-eval-after-load 'package
      (add-to-list 'package-archives '("nongnu" . "https://elpa.nongnu.org/nongnu/")))

To upgrade Sweep to a newer version, do `M-x package-upgrade sweeprolog RET`.

# Getting Started

After installing the `sweeprolog` Elisp library, load it into Emacs:

    (require 'sweeprolog)

Sweep tries to find SWI-Prolog by looking for the `swipl` executable
in the directories listed in the Emacs variable `exec-path`.  When
Emacs is started from a shell, `exec-path` is initialized from the
`PATH` environment variable which normally includes the location of
`swipl` in common SWI-Prolog installations.  If the `swipl` executable
cannot be found via `exec-path`, you can tell Sweep where to find it
by setting the variable `sweeprolog-swipl-path` to point to it:

    (setq sweeprolog-swipl-path "/path/to/swipl")

All set!  You can now use Sweep for Prolog development and for integrating
Prolog into your Emacs Lisp code.  For a full description of the different
features of Sweep, see [the Sweep manual](https://eshelyaron.com/sweep.html).