You may want to add some extra features to your instance of Proof General which are not supported in the generic core. To do this, you can use the settings described above, plus a small number of fundamental functions in Proof General which you can consider as exported in the generic interface. Be careful using more functions than are mentioned here because the internals of Proof General may change between versions.
Several generic settings are defined using defpgcustom
in
`proof-config.el'. This introduces settings of the form
<PA>-name
for each proof assistant PA.
To set the default value for these settings in prover-specific cases,
you should use the special defpgdefault
macro:
Usage: (defpgdefault SYM value)
In your prover-specific code you can simply use the setting
<PA>-sym
directly, i.e., write myprover-home-page
.
In the generic code, you can use a macro, writing (proof-ass
home-page)
to refer to the <PA>-home-page
setting for the
currently running instance of Proof General.
See section 12.3 Configuration variable mechanisms, for more details on this mechanism.
Apart from the generic settings, your prover instance will probably need some specific customizable settings.
Defining new prover-specific settings using customize is pretty easy. You should do it at least for your prover-specific user options.
The code in `proof-site.el' provides each prover with two
customization groups automatically (based on the name of the assistant):
<PA>
for user options for prover PA
and
<PA>-config
for configuration of prover PA.
Typically <PA>-config
holds settings which are
constants but which may be nice to tweak.
The first group appears in the menu
ProofGeneral -> Customize -> <PA>
The second group appears in the menu:
ProofGeneral -> Internals -> <PA> config
A typical use of defcustom
looks like this:
(defcustom myprover-search-page "http://findtheorem.myprover.org" "URL of search web page for myprover." :type 'string :group 'myprover-config)
This introduces a new customizable setting, which you might use to make
a menu entry, for example. The default value is the string
"http://findtheorem.myprover.org"
.
In `proof-compat', two architecture flags are defined. These can be used to write conditional pieces of code for different Emacs and operating systems.
The recommended functions you may invoke are these:
To insert text into the current (usually script) buffer, the function
proof-insert
is useful. There's also a handy macro
proof-defshortcut
for defining shortcut functions using it.
%p - place the point here after input
Any other %-prefixed character inserts itself.
proof-insert
', which see.
KEY is added onto proof-assistant
map.
proof-shell-invisible-command
is a useful utility
for sending a single command to the process. You should use this to
implement user-level or internal functions rather than attempting to
directly manipulate the proof action list, or insert into the shell
buffer.
proof-terminal-char
if necessary, examining
proof-shell-no-auto-terminate-commands.
By default, let the command be processed asynchronously.
But if optional wait command is non-nil, wait for processing to finish
before and after sending the command.
If wait is an integer, wait for that many seconds afterwards.
There are several handy macros to help you define functions
which invoke proof-shell-invisible-command
.
proof-shell-invisible-command
, which see.
KEY is added onto proof-assistant
map.
%e uses the canonicalized expanded version of filename (including
directory, using default-directory
-- see `expand-file-name
').
%r uses the unadjusted (possibly relative) version of filename.
%m ('module') uses the basename of the file, without directory or extension.
%s means the same as %e.
Using %e can avoid problems with dumb proof assistants who don't understand ~, for example.
For all these cases, the escapes in `proof-shell-filename-escapes
'
are processed.
If string is in fact a function, instead invoke it on filename and return the resulting (string) value.
Go to the first, previous, next, last section, table of contents.