Node:Configuration, Next:, Previous:Mode Line, Up:Emacs Interface


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:

The Prolog system to use. Defaults to '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-system the variables below named sicstus-something will not be used, in some cases corresponding functionality is available through variables named prolog-something.
The version of SICStus that is used. Defaults to '(3 . 8). Note that the spaces are significant!
Set to t (the default) to enable the source-linked debugging extensions by default. The debugging can be enabled via the Prolog menu even if this variable is nil. Note that the source-linked debugging only works if sicstus-version is set correctly.
pltrace-port-arrow-assoc obsolescent
Only relevant for source-linked debugging, this controls how the various ports of invocation boxes (see Procedure Box) map to arrows that point into the current line of code in source code buffers. Initialized as:
'(("call" . ">>>") ("exit" . "+++") ("ndexit" . "?++")
  ("redo" . "<<<") ("fail" . "---") ("exception" . "==>"))

where ndexit is the nondeterminate variant of the Exit port. Do not rely on this variable. It will change in future releases.

How many positions to indent the body of a clause. Defaults to tab-width, normally 8.
The number of positions to indent code inside grouping parentheses. Defaults to 4, which gives the following indentation.
p :-
        (   q1
        ;   q2,

Note that the spaces between the parentheses and the code are automatically inserted when <TAB> is pressed at those positions.

Set to nil to prevent single %-comments from being automatically aligned. Defaults to t.

Note that comments with one % are indented to comment-column, comments with two % to the code level, and that comments with three % are never changed when indenting.

Set to nil to prevent indentation of text inside /* ... */ comments. Defaults t.
Set to nil to indent the closing } of an object definition to prolog-indent-width. Defaults to t.
This is a list with keywords that are highlighted in a special color when used as directives (i.e. as :- keyword). Defaults to
     ("block" "discontiguous" "dynamic" "initialization"
      "meta_predicate" "mode" "module" "multifile" "public"

Set to nil to prevent Emacs from automatically indenting the next line when pressing <RET>. Defaults to t.
Set to t to enable deletion of all white space before the cursor when pressing <DEL> (unless inside a comment, string, or quoted atom). Defaults to nil.
Set to t to 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 nil.
Set to t to 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 nil.
Set to t to enable the key-bindings of the old Emacs interface. These bindings are not used by default since they violate GNU Emacs recommendations. Defaults to nil.
Set to nil to 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 t.
What position the parsing is done from when indenting code. Two possible settings: 'beg-of-line and 'beg-of-clause. The first is faster but may result in erroneous indentation in /* ... */ comments. The default is 'beg-of-line.
Set to t to enable a new Predicate menu 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 nil.
The info node for the SICStus predicate index. This is important if the online help function is to be used (by pressing C-c ?, or choosing the Prolog/Help on predicate menu entry). The default setting is "(sicstus)Predicate Index".
Set to nil to not make underscore (_) a word-constituent character. Defaults to t.