1.1 --- a/Admin/MacOS/script Sun Dec 21 12:41:09 2008 +0100
1.2 +++ b/Admin/MacOS/script Mon Dec 22 14:40:27 2008 +0100
1.3 @@ -5,37 +5,56 @@
1.4 # Isabelle application wrapper
1.5
1.6 THIS="$(cd "$(dirname "$0")"; pwd)"
1.7 +THIS_APP="$(cd "$THIS/../.."; pwd)"
1.8 +SUPER_APP="$(cd "$THIS/../../.."; pwd)"
1.9
1.10 -
1.11 -# global defaults
1.12 -ISABELLE_TOOL=""
1.13 -ISABELLE_INTERFACE="emacs"
1.14 -#ISABELLE_INTERFACE="jedit"
1.15 -
1.16 -
1.17 -# sane environment defaults
1.18 -PATH="$PATH:/opt/local/bin"
1.19 cd "$HOME"
1.20
1.21
1.22 -# Isabelle location
1.23 +# settings support
1.24
1.25 -if [ -z "$ISABELLE_TOOL" ]; then
1.26 - if [ -e "$THIS/Isabelle/bin/isabelle" ]; then
1.27 - ISABELLE_TOOL="$THIS/Isabelle/bin/isabelle"
1.28 - elif [ -e "$HOME/bin/isabelle" ]; then
1.29 - ISABELLE_TOOL="$HOME/bin/isabelle"
1.30 - else
1.31 - ISABELLE_TOOL=isabelle
1.32 - fi
1.33 +function choosefrom ()
1.34 +{
1.35 + local RESULT=""
1.36 + local FILE=""
1.37 +
1.38 + for FILE in "$@"
1.39 + do
1.40 + [ -z "$RESULT" -a -e "$FILE" ] && RESULT="$FILE"
1.41 + done
1.42 +
1.43 + [ -z "$RESULT" ] && RESULT="$FILE"
1.44 + echo "$RESULT"
1.45 +}
1.46 +
1.47 +
1.48 +# Isabelle
1.49 +
1.50 +ISABELLE_TOOL="$(choosefrom \
1.51 + "$THIS/Isabelle/bin/isabelle" \
1.52 + "$SUPER_APP/Isabelle/bin/isabelle" \
1.53 + "$HOME/bin/isabelle" \
1.54 + isabelle)"
1.55 +
1.56 +
1.57 +# Proof General / Emacs
1.58 +
1.59 +PROOFGENERAL_EMACS="$(choosefrom \
1.60 + "$THIS/Emacs.app/Contents/MacOS/Emacs" \
1.61 + "$SUPER_APP/Emacs.app/Contents/MacOS/Emacs" \
1.62 + /Applications/Emacs.app/Contents/MacOS/Emacs \
1.63 + "")"
1.64 +
1.65 +if [ -n "$PROOFGENERAL_EMACS" ]; then
1.66 + PROOFGENERAL_OPTIONS="-p $PROOFGENERAL_EMACS $PROOFGENERAL_OPTIONS"
1.67 fi
1.68
1.69
1.70 -# run interface
1.71 +# run interface with error feedback
1.72
1.73 OUTPUT="/tmp/isabelle$$.out"
1.74
1.75 -( "$HOME/bin/isabelle" "$ISABELLE_INTERFACE" "$@" ) > "$OUTPUT" 2>&1
1.76 +( "$HOME/bin/isabelle" emacs "$@" ) > "$OUTPUT" 2>&1
1.77 RC=$?
1.78
1.79 if [ "$RC" != 0 ]; then
1.80 @@ -43,10 +62,7 @@
1.81 echo "Return code: $RC" >> "$OUTPUT"
1.82 fi
1.83
1.84 -
1.85 -# error feedback
1.86 -
1.87 -if [ -n "$OUTPUT" ]; then
1.88 +if [ $(stat -f "%z" "$OUTPUT") != 0 ]; then
1.89 "$THIS/CocoaDialog.app/Contents/MacOS/CocoaDialog" textbox \
1.90 --title "Isabelle" \
1.91 --informative-text "Isabelle output" \
2.1 --- a/etc/settings Sun Dec 21 12:41:09 2008 +0100
2.2 +++ b/etc/settings Mon Dec 22 14:40:27 2008 +0100
2.3 @@ -201,9 +201,8 @@
2.4 "/opt/ProofGeneral" \
2.5 "")
2.6
2.7 -PROOFGENERAL_EMACS=$(choosefrom /Applications/Emacs.app/Contents/MacOS/Emacs emacs22)
2.8 -PROOFGENERAL_OPTIONS="-p $PROOFGENERAL_EMACS"
2.9 -#PROOFGENERAL_OPTIONS="-m no_brackets -m no_type_brackets -x true -p $PROOFGENERAL_EMACS"
2.10 +PROOFGENERAL_OPTIONS=""
2.11 +#PROOFGENERAL_OPTIONS="-m no_brackets -m no_type_brackets"
2.12
2.13 # Automatic setup of remote fonts
2.14 #XSYMBOL_INSTALLFONTS="xset fp+ tcp/isafonts.informatik.tu-muenchen.de:7200"