Download Adapting Proof General

Transcript
Chapter 4: Proof Shell Settings
19
scripting is deactivated in a completed buffer, it is added to Proof General’s list of processed
files, and the prover is told about it by issuing this command.
If this is set to nil, no command is issued.
See also: ‘proof-shell-inform-file-retracted-cmd’, ‘proof-shell-process-file’,
‘proof-shell-compute-new-files-list’.
[Variable]
Command to the proof assistant to tell it that a file has been retracted.
The format character ‘%s’ is replaced by a complete filename for a script file which Proof General wants the prover to consider as not completely processed. See ‘proof-format-filename’
for other possibilities to process the filename.
This is used to interface with the proof assistant’s internal management of multiple files,
so the proof assistant is kept aware of which files have been processed. Specifically, when
scripting is activated, the file is removed from Proof General’s list of processed files, and the
prover is told about it by issuing this command. The action may cause the prover in turn to
suggest to Proof General that files depending on this one are also unlocked.
If this is set to nil, no command is issued.
It is also possible to set this value to a function which will be invoked on the name of the
retracted file, and should remove the ancestor files from ‘proof-included-files-list’ by
some other calculation.
See also: ‘proof-shell-inform-file-processed-cmd’, ‘proof-shell-process-file’,
‘proof-shell-compute-new-files-list’.
proof-shell-inform-file-retracted-cmd
4.2 Script input to the shell
Generally, commands from the proof script are sent verbatim to the proof process running in
the proof shell. For historical reasons, carriage returns are stripped by default. You can set
proof-shell-strip-crs-from-input to adjust that. For more sophisticated pre-processing of
the sent string, you may like to set proof-shell-insert-hook.
[Variable]
If non-nil, replace carriage returns in every input with spaces.
This is enabled by default: it is appropriate for many systems based on human input, because
several CR’s can result in several prompts, which may mess up the display (or even worse,
the synchronization).
If the prover can be set to output only one prompt for every chunk of input, then newlines
can be retained in the input.
proof-shell-strip-crs-from-input
[Variable]
Hooks run by ‘proof-shell-insert’ before inserting a command.
Can be used to configure the proof assistant to the interface in various ways – for example, to
observe or alter the commands sent to the prover, or to sneak in extra commands to configure
the prover.
This hook is called inside a ‘save-excursion’ with the ‘proof-shell-buffer’ current, just
before inserting and sending the text in the variable ‘string’. The hook can massage ‘string’
or insert additional text directly into the ‘proof-shell-buffer’. Before sending ‘string’,
it will be stripped of carriage returns.
Additionally, the hook can examine the variable ‘action’. It will be a symbol, set to the
callback command which is executed in the proof shell filter once ‘string’ has been processed.
The ‘action’ variable suggests what class of command is about to be inserted, the first two
are normally the ones of interest:
proof-shell-insert-hook