The behavior of the Emacs interface can be controlled by a set of user-configurable settings. Some of these can be changed on the fly, while some require Emacs to be restarted. To set a variable on the fly, type M-x set-variable <RET> VariableName <RET> Value <RET>. Note that variable names can be completed by typing a few characters and then pressing <TAB>.
To set a variable so that the setting is used every time Emacs is started, add lines of the following format to ~/.emacs:
(setq VariableName Value)
Note that the Emacs interface is presently not using the ‘Customize’ functionality to edit the settings.
The available settings are:
'sicstus, which will be assumed for the rest of this chapter. See the on-line documentation for the meaning of other settings. For other settings of
prolog-systemthe variables below named
sicstus-something will not be used, in some cases corresponding functionality is available through variables named
'(4 . 2). Note that the spaces are significant!
t(the default) to enable the source-linked debugging extensions by default. The debugging can be enabled via the
Prologmenu even if this variable is
nil. Note that the source-linked debugging only works if
sicstus-versionis set correctly.
tab-width, normally 8.
p :- ( q1 ; q2, q3 ).
Note that the spaces between the parentheses and the code are
automatically inserted when <TAB> is pressed at those positions.
nilto prevent single
%-comments from being automatically aligned. Defaults to
Note that comments with one
% are indented to comment-column, comments
% to the code level, and that comments with three
never changed when indenting.
nilto prevent indentation of text inside
/* ... */comments. Defaults
:-keyword). Defaults to
'("block" "discontiguous" "dynamic" "initialization" "meta_predicate" "mode" "module" "multifile" "public" "volatile" "det" "nondet" ; for spdet )
nilto prevent Emacs from automatically indenting the next line when pressing <RET>. Defaults to
tto enable deletion of all whitespace before the cursor when pressing <DEL> (unless inside a comment, string, or quoted atom). Defaults to
tto enable the electric dot function. If enabled, pressing . at the end of a non-empty line inserts a dot and a newline. When pressed at the beginning of a line, a new head of the last predicate is inserted. When pressed at the end of a line with only whitespace, a recursive call to the current predicate is inserted. The function respects the arity of the predicate and inserts parentheses and the correct number of commas for separation of the arguments. Defaults to
tto enable the electric underscore function. When enabled, pressing underscore (_) when the cursor is on a variable, replaces the variable with the anynomous variable. Defaults to
nilto use built-in functions of Emacs for parsing the source code when indenting. This is faster than the default but does not handle some of the syntax peculiarities of Prolog. Defaults to
'beg-of-clause. The first is faster but may result in erroneous indentation in
/* ... */comments. The default is
tto enable a new
Predicatemenu that contains all predicates of the current file. Choosing an entry in the menu moves the cursor to the start of that predicate. Defaults to
Prolog/Help on predicatemenu entry). The default setting is
nilto not make underscore (_) a word-constituent character. Defaults to
Font-locking uses a number of “faces”, which can be customized with regular Emacs commands, for instance M-x describe-face <RET> FaceName <RET>. The following faces are relevant:
highlightsince release 4.2
pltrace-face-reached-detsince release 4.2
pltrace-face-reached-nondetsince release 4.2
pltrace-face-reached-notsince release 4.2
prolog-warning-facesince release 4.2
prolog-informational-facesince release 4.2
prolog-exception-facesince release 4.2
prolog-error-facesince release 4.2
prolog-call-facesince release 4.2
prolog-exit-facesince release 4.2
prolog-redo-facesince release 4.2
prolog-fail-facesince release 4.2
prolog-builtin-facesince release 4.2