[an error occurred while processing this directive]
Using Prolog within Emacs
You can run prolog from within Emacs providing a programming
environment which offers several advantages, including auto
indentation, syntax highlighting, help on predefined predicates,
consultation and compilation from inside Emacs, auto-fill mode, and
more.
Seting up your .emacs file
Put the following lines in your .emacs file.
(setq load-path (cons "/usr/local/sicstus3" load-path))
(autoload 'run-prolog "prolog" "Start a Prolog sub-process." t)
(autoload 'prolog-mode "prolog" "Major mode for editing Prolog programs." t)
(setq prolog-system 'sicstus)
(setq auto-mode-alist (cons '("\\.pl$" . prolog-mode) auto-mode-alist))
(add-hook 'prolog-mode-hook 'turn-on-font-lock)
(autoload 'prolog-menu-hook-function "prolog-menu" t)
(add-hook 'prolog-mode-hook 'prolog-menu-hook-function)
Running prolog
A prolog process can be started within Emacs by choosing Run Prolog
from the menu, by typing C-c RET (control-c followed by a
return), or by typing M-x run-prolog (M-x is escape followed by
x). It is however not strictly necessary to start a prolog process
manually since it is automatically done when needed. The process can
be restarted (i.e. the old one is killed and a new one is created) by
typing C-u C-c RET. The process will appear in another window
named *prolog* . You can always get back to the prolog window
by typing C-x b *prolog* or even M-x run-prolog .
The Basic Prolog Commands
The most useful commands that the Prolog mode provides are ones to
consult and/or compile portions of one of your editing
buffers. Consultation and compilation is either done via the menu or
with the following key-bindings:
- C-c C-b - Consult entire buffer.
- C-c C-r - Consult current region.
- C-c C-p - Consult predicate pointer is in.
- C-c C-c b - Compile and load entire buffer.
- C-c C-c r - Compile and load current region.
- C-c C-c p - Compile and load predicate pointer is in.
For more information
See the section of the manual on the GNU Emacs
interface .
[an error occurred while processing this directive]