2344
|
1 |
#!/bin/bash -norc
|
2305
|
2 |
#
|
2312
|
3 |
# $Id$
|
|
4 |
#
|
2939
|
5 |
# GNU Emacs Isamode interface.
|
2305
|
6 |
|
|
7 |
|
|
8 |
## diagnostics
|
|
9 |
|
2939
|
10 |
PRG=$(basename $0)
|
|
11 |
|
|
12 |
function usage()
|
|
13 |
{
|
|
14 |
echo
|
|
15 |
echo "Usage: $PRG [OPTIONS]"
|
|
16 |
echo
|
|
17 |
echo " Options are:"
|
|
18 |
echo " -g GEOM main window geometry (default 80x20)"
|
|
19 |
echo
|
|
20 |
echo " Starts GNU Emacs and Isamode."
|
|
21 |
echo
|
|
22 |
exit 1
|
|
23 |
}
|
|
24 |
|
2305
|
25 |
function fail()
|
|
26 |
{
|
2344
|
27 |
echo "$1" >&2
|
2305
|
28 |
exit 2
|
|
29 |
}
|
|
30 |
|
|
31 |
|
2939
|
32 |
## process command line
|
|
33 |
|
|
34 |
# options
|
|
35 |
|
|
36 |
MAINGEOM="80x20"
|
|
37 |
|
|
38 |
while getopts "g:" OPT
|
|
39 |
do
|
|
40 |
case "$OPT" in
|
|
41 |
g)
|
|
42 |
MAINGEOM="$OPTARG"
|
|
43 |
;;
|
|
44 |
\?)
|
|
45 |
usage
|
|
46 |
;;
|
|
47 |
esac
|
|
48 |
done
|
|
49 |
|
|
50 |
shift $(($OPTIND - 1))
|
|
51 |
|
|
52 |
|
|
53 |
# args
|
|
54 |
|
|
55 |
[ $# != 0 ] && usage
|
|
56 |
|
|
57 |
|
2305
|
58 |
## main
|
|
59 |
|
2939
|
60 |
# prepare startup file
|
|
61 |
|
|
62 |
STARTUP=/tmp/isa-start$$.el
|
|
63 |
|
|
64 |
{
|
|
65 |
echo "(load \"$ISAMODE_HOME/elisp/isa-site.el\")"
|
|
66 |
echo
|
|
67 |
|
|
68 |
echo "(setq isa-logic-paths"
|
|
69 |
echo -n "'("
|
2968
|
70 |
for DIR in $(echo $ISABELLE_PATH | tr : " ")
|
2939
|
71 |
do
|
|
72 |
[ -d $DIR ] && echo "\"$DIR\""
|
|
73 |
done
|
|
74 |
echo "\"$ISAMODE_HOME/ruletables\"))"
|
|
75 |
echo
|
|
76 |
|
|
77 |
DOC=$(echo $ISABELLE_DOCS | cut -f1 -d:) #first doc dir only
|
|
78 |
echo "(setq isa-manual-path \"$DOC\")"
|
|
79 |
echo
|
2474
|
80 |
|
2947
|
81 |
for FILE in "$ISABELLE_HOME/etc/isa-settings.el" \
|
2939
|
82 |
"$ISABELLE_HOME_USER/etc/isa-settings.el"
|
|
83 |
do
|
|
84 |
[ -f "$FILE" ] && echo "(load \"$FILE\")"
|
|
85 |
done
|
|
86 |
echo
|
|
87 |
|
|
88 |
echo "(isabelle)"
|
|
89 |
} >$STARTUP
|
|
90 |
|
|
91 |
|
|
92 |
# run it!
|
|
93 |
|
|
94 |
$ISATOOL installfonts
|
|
95 |
|
|
96 |
emacs -name "Isabelle" \
|
|
97 |
-fn isabelle14 -geometry $MAINGEOM \
|
|
98 |
--no-init-file \
|
|
99 |
--load $STARTUP
|
|
100 |
|
|
101 |
rm $STARTUP
|