Key Bindings
This section describes the key bindings associated with the Prolog/GNU Emacs
interface. For a complete listing of all the key bindings applicable in a
particular window, type <ESC> x describe-bindings or ^h b.
The following key bindings apply only in the Prolog window, not in the
text window(s):
- ^c ^d
- Sends an end-of-file to Prolog. This can be used
to exit from a break level or to
exit from Prolog altogether (see ref-iex-int for
more information on
break/0
).
Having exited from Prolog using this command,
the only way of start up a new Prolog is by typing
<ESC> x run-prolog.
- ^x ^z
- Suspends Prolog and GNU Emacs.
- ^x ^e
- Allows you to edit a query you previously typed
to the Prolog prompt and resubmit it. Effectively, it grabs the last
query and brings it down to the mini-buffer. There you can edit it if
necessary, then move your cursor to the last line of the query and
type <RET>. This places the query in the prolog window, where you
can edit it further, if necessary, and type <RET> to submit the query
to Prolog. You can also grab queries other than the most recent one
by specifying a prefix argument to this command (using <ESC>, or
^u): 2 to get the second last, 3 to get the third last, and so
on. Another way to do this is to move the cursor back to the query
you want to copy and type ^x ^e. This last alternative
does not place the query in the mini-buffer but places it directly in
the prolog window. In the cases where a query is placed in the
mini-buffer, you can step up a list of previously executed
queries by typing in <ESC> p or down the list by typing in <ESC>
n. Since the mini-buffer is only one line, a multi-line
query can be stepped around by using the conventional ^p,
^n key strokes. To obtain the set of bindings that are active
within the mini-buffer when you execute the yank-query key sequence
type in
^h b. This method of stepping through a goal history
is similar to GNU Emacs method of stepping through a command history.
- ^x ^y
- Allows you to edit the most recent query matching
a regular expression. You are first prompted for a regular expression;
on entering a regular expression and hitting <RET>, the most
recently submitted goal matching the regular expression is displayed
in the mini-buffer. You can choose to submit this query to prolog
(after editing it in the minibuffer, if necessary) or locate the next
most recent goal matching the given regular expression.
- ^c ^c
- Sends an interrupt to the Prolog process (exactly
as if you were not running under GNU Emacs).
Please note: to send a numeric argument to a GNU Emacs command, type <ESC>
followed by the desired number (for example, <ESC> 1 or <ESC> 12);
then type the command. ^u also works as an argument prefix,
as in "standard" GNU Emacs.
The following key bindings apply in any window:
- ^x ^c
- Causes an irreversible exit from GNU Emacs and
Prolog. You will be prompted to make sure that (1) the Prolog and all
other subprocesses should indeed be killed, and (2) any unsaved buffers
should indeed be discarded.
- ^x ^z
- If you are running GNU Emacs from a UNIX terminal window, this
suspends (pauses) the GNU Emacs process and returns you
to the operating system prompt. If
a Prolog program is running, it will continue to run, but you
will not see any output from it. You can get your GNU Emacs/Prolog session
back by typing fg. (This pause facility is only available if
you are running
csh
; it does not work under sh
.)
- <ESC> .
- Finds the source code for a particular procedure. If the
cursor is positioned on or before the predicate name part of a goal,
you can simply press <RET> to find the clauses for its
procedure. Otherwise, in response to the prompt
Find:
,
you should type the name of the predicate, optionally followed by a
/
and its arity. The file containing the procedure for the
specified predicate is then visited, and the cursor is positioned at
the beginning of the procedure. There are some layout conventions,
which must be followed for this facility to work: see
ema-emi-lay. The facility is also available via the
. debugger option (see dbg). In QUI,
find-definition must be invoked within the GNU Emacs process, not the
QUI main window.
- <ESC> ,
- This command can only be used after <ESC> .. It
successively locates other procedure definition(s) for a
predicate.
<ESC> , will
search other files for additional clauses for a multifile predicate,
will search for a predicate of the same name and arity in a different module,
or will search for predicates with the same name and different arities (in
the case where the arity was not specified).
- <ESC> x prolog-mode
- Changes the current buffer to Prolog mode. See
ema-emi-mod.
- <ESC> x library
- Prompts for a file and locates it in the Quintus
Prolog Library directories.
- <ESC> x cd
- Prompts for a directory and changes the directory of the
Prolog window and of the Prolog process.
- <ESC> x enable-prolog-source-debugger
- Enables the source linked debugger.
- <ESC> x disable-prolog-source-debugger
- Disables the source linked debugger.
The following key bindings apply in any edit window except the Prolog
window:
- <ESC> k
- (for "kompile") is used to load procedures from the
edit buffer. You are then
prompted to choose one of three options; you can compile
- the procedure in which the cursor is currently positioned (see
ema-emi-lay, for restrictions on program layout necessary for
this to work);
- the region between the cursor and the mark; or
- the whole buffer.
- <ESC> i
- (for interpret) is synonymous to <ESC> k; and is
there for backward compatibility.