3007
|
1 |
#!/bin/bash
|
2300
|
2 |
#
|
2307
|
3 |
# $Id$
|
|
4 |
#
|
2788
|
5 |
# Simple Isabelle interface based on xterm.
|
2300
|
6 |
|
|
7 |
|
|
8 |
## diagnostics
|
|
9 |
|
2623
|
10 |
PRG=$(basename $0)
|
|
11 |
|
|
12 |
function usage()
|
|
13 |
{
|
|
14 |
echo
|
|
15 |
echo "Usage: $PRG [OPTIONS] [--] [CMDLINE]"
|
|
16 |
echo
|
|
17 |
echo " Options are:"
|
|
18 |
echo " -g GEOM main window geometry (default 80x60)"
|
2788
|
19 |
echo " -h MODE highlight mode, may be false, bold (default), color"
|
2712
|
20 |
echo " -p TEXT pass text (options etc.) to isabelle session"
|
2623
|
21 |
echo " -s BOOL symbolic font output? (default true)"
|
6344
|
22 |
echo " -x PRG executable program (default xterm)"
|
2623
|
23 |
echo
|
|
24 |
echo " Starts Isabelle within an xterm window. CMDLINE is passed"
|
|
25 |
echo " directly to the isabelle session."
|
|
26 |
echo
|
|
27 |
exit 1
|
|
28 |
}
|
|
29 |
|
2300
|
30 |
function fail()
|
|
31 |
{
|
2344
|
32 |
echo "$1" >&2
|
2300
|
33 |
exit 2
|
|
34 |
}
|
|
35 |
|
|
36 |
|
2623
|
37 |
## process command line
|
|
38 |
|
|
39 |
# options
|
|
40 |
|
|
41 |
MAINGEOM="80x60"
|
2788
|
42 |
HILITE=bold
|
2712
|
43 |
PASS=""
|
2623
|
44 |
SYMBOLS="true"
|
6344
|
45 |
XTERM="xterm"
|
2623
|
46 |
|
5965
|
47 |
function getoptions()
|
|
48 |
{
|
|
49 |
OPTIND=1
|
6344
|
50 |
while getopts "g:h:p:s:x:" OPT
|
5965
|
51 |
do
|
|
52 |
case "$OPT" in
|
|
53 |
g)
|
|
54 |
MAINGEOM="$OPTARG"
|
|
55 |
;;
|
|
56 |
h)
|
|
57 |
HILITE="$OPTARG"
|
|
58 |
;;
|
|
59 |
p)
|
|
60 |
PASS="$PASS $OPTARG"
|
|
61 |
;;
|
|
62 |
s)
|
|
63 |
SYMBOLS="$OPTARG"
|
|
64 |
;;
|
6344
|
65 |
x)
|
|
66 |
XTERM="$OPTARG"
|
|
67 |
;;
|
5965
|
68 |
\?)
|
|
69 |
usage
|
|
70 |
;;
|
|
71 |
esac
|
|
72 |
done
|
|
73 |
}
|
2623
|
74 |
|
5965
|
75 |
getoptions $ISABELLE_XTERM_OPTIONS
|
|
76 |
|
|
77 |
getoptions "$@"
|
2623
|
78 |
shift $(($OPTIND - 1))
|
|
79 |
|
|
80 |
|
2300
|
81 |
## main
|
|
82 |
|
2788
|
83 |
if [ "$HILITE" = bold ]; then
|
|
84 |
PASS="-m xterm $PASS"
|
|
85 |
elif [ "$HILITE" = color ]; then
|
|
86 |
PASS="-m xterm_color $PASS"
|
|
87 |
elif [ -n "$HILITE" -a "$HILITE" != false ]; then
|
|
88 |
echo "WARNING: unknown highlight mode '$HILITE'" >&2
|
|
89 |
fi
|
|
90 |
|
2623
|
91 |
if [ -z "$SYMBOLS" -o "$SYMBOLS" = false ]; then
|
6344
|
92 |
exec $XTERM -T Isabelle -n Isabelle -geometry "$MAINGEOM" -e $ISABELLE $PASS "$@"
|
2300
|
93 |
else
|
2474
|
94 |
$ISATOOL installfonts
|
6344
|
95 |
exec $XTERM -T Isabelle -n Isabelle -geometry "$MAINGEOM" -fn isabelle14 \
|
2743
|
96 |
-xrm "*fontMenu.Label: Isabelle fonts" \
|
|
97 |
-xrm "*fontMenu*font1*Label: Large" \
|
2770
|
98 |
-xrm "*VT100*font1: isabelle24" \
|
2743
|
99 |
-xrm "*fontMenu*font2*Label:" \
|
|
100 |
-xrm "*VT100*font2:" \
|
|
101 |
-xrm "*fontMenu*font3*Label:" \
|
|
102 |
-xrm "*VT100*font3:" \
|
|
103 |
-xrm "*fontMenu*font4*Label:" \
|
|
104 |
-xrm "*VT100*font4:" \
|
|
105 |
-xrm "*fontMenu*font5*Label:" \
|
|
106 |
-xrm "*VT100*font5:" \
|
|
107 |
-xrm "*fontMenu*font6*Label:" \
|
|
108 |
-xrm "*VT100*font6:" \
|
6277
|
109 |
-e $ISABELLE -m isabelle_font -m symbols $PASS "$@"
|
2300
|
110 |
fi
|