1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
.TP
source "\fIfilename\fP"
.br
Commands are read from
.IR filename
and executed.
In the file, all lines beginning with\c
.Q #
are ignored as comments
(note that comments must appear on a line by themselves, as\c
.Q #
is a reasonable character to have within commands).
Lines whose first non-blank characters is\c
.Q = ",\c"
.Q ! ,
or\c
.Q +
are considered searches, while all other non-blank lines are considered
.I lookup
commands.
Therefore, there is no need for lines to begin with
the command-introduction character. However, leading whitespace is
always OK.
For search lines, take care that any trailing whitespace
is deleted if undesired, as trailing whitespace (like all non-leading
whitespace) is kept as part of the regular expression.
Within a command file, commands that modify per-file flags and such always
work with the most-recently loaded (or selected) file. Therefore,
something along the lines of
.nf
load "my.word.list"
set word on
load "my.kanji.list"
set word off
set local prompt "enter kanji> "
.fi
would word as might make intuitive sense.
Since a script file must have a
.IR load ,
or
.IR select
before any per-slot flag is set, one can use\c
.Q "select ."
to facilitate command scripts that are to work with\c
.Q "the current slot" .
|