10555
|
1 |
#!/usr/bin/env bash
|
2305
|
2 |
#
|
2312
|
3 |
# $Id$
|
9789
|
4 |
# Author: Markus Wenzel, TU Muenchen
|
2312
|
5 |
#
|
3304
|
6 |
# Emacs Isamode interface wrapper.
|
2305
|
7 |
|
|
8 |
|
|
9 |
## diagnostics
|
|
10 |
|
10512
|
11 |
PRG="$(basename "$0")"
|
2939
|
12 |
|
|
13 |
function usage()
|
|
14 |
{
|
|
15 |
echo
|
|
16 |
echo "Usage: $PRG [OPTIONS]"
|
|
17 |
echo
|
|
18 |
echo " Options are:"
|
5965
|
19 |
echo " -g GEOM main window geometry (default none)"
|
|
20 |
echo " -p NAME Emacs program name (default xemacs)"
|
|
21 |
echo " -u BOOL use .emacs file (default false)"
|
2939
|
22 |
echo
|
4928
|
23 |
echo "Starts Emacs and Isamode."
|
7459
|
24 |
echo
|
|
25 |
echo " ISAMODE_OPTIONS=$ISAMODE_OPTIONS"
|
|
26 |
echo
|
2939
|
27 |
exit 1
|
|
28 |
}
|
|
29 |
|
2305
|
30 |
function fail()
|
|
31 |
{
|
2344
|
32 |
echo "$1" >&2
|
2305
|
33 |
exit 2
|
|
34 |
}
|
|
35 |
|
|
36 |
|
2939
|
37 |
## process command line
|
|
38 |
|
|
39 |
# options
|
|
40 |
|
5965
|
41 |
MAINGEOM=""
|
|
42 |
PROGNAME=xemacs
|
|
43 |
INITFILE=false
|
2939
|
44 |
|
5965
|
45 |
function getoptions()
|
|
46 |
{
|
|
47 |
OPTIND=1
|
|
48 |
while getopts "g:p:u:" OPT
|
|
49 |
do
|
|
50 |
case "$OPT" in
|
|
51 |
g)
|
|
52 |
MAINGEOM="$OPTARG"
|
|
53 |
;;
|
|
54 |
p)
|
|
55 |
PROGNAME="$OPTARG"
|
|
56 |
;;
|
|
57 |
u)
|
|
58 |
INITFILE="$OPTARG"
|
|
59 |
;;
|
|
60 |
\?)
|
|
61 |
usage
|
|
62 |
;;
|
|
63 |
esac
|
|
64 |
done
|
|
65 |
}
|
2939
|
66 |
|
5965
|
67 |
getoptions $ISAMODE_OPTIONS
|
|
68 |
|
|
69 |
getoptions "$@"
|
|
70 |
shift $(($OPTIND - 1))
|
2939
|
71 |
|
|
72 |
|
|
73 |
# args
|
|
74 |
|
9789
|
75 |
[ "$#" != 0 ] && usage
|
2939
|
76 |
|
|
77 |
|
2305
|
78 |
## main
|
|
79 |
|
5965
|
80 |
ARGS=""
|
|
81 |
|
|
82 |
[ -n "$MAINGEOM" ] && ARGS="$ARGS -geometry $MAINGEOM"
|
|
83 |
[ "$INITFILE" = false ] && ARGS="$ARGS -q"
|
|
84 |
|
|
85 |
|
10512
|
86 |
ARGS="$ARGS -l '$ISAMODE_HOME/elisp/isa-site.el'"
|
2939
|
87 |
|
3304
|
88 |
for FILE in "$ISABELLE_HOME/etc/isa-settings.el" \
|
|
89 |
"$ISABELLE_HOME_USER/etc/isa-settings.el"
|
|
90 |
do
|
10512
|
91 |
[ -f "$FILE" ] && ARGS="$ARGS -l '$FILE'"
|
3304
|
92 |
done
|
2939
|
93 |
|
5965
|
94 |
ARGS="$ARGS -f isabelle"
|
10512
|
95 |
eval exec "$PROGNAME" -T "Isabelle" "$ARGS"
|