5 # Isabelle application wrapper
7 THIS="$(cd "$(dirname "$0")"; pwd)"
8 THIS_APP="$(cd "$THIS/../.."; pwd)"
9 SUPER_APP="$(cd "$THIS/../../.."; pwd)"
12 # sane environment defaults
14 PATH="$PATH:/opt/local/bin"
19 function choosefrom ()
26 [ -z "$RESULT" -a -e "$FILE" ] && RESULT="$FILE"
29 [ -z "$RESULT" ] && RESULT="$FILE"
36 ISABELLE_TOOL="$(choosefrom \
37 "$THIS/Isabelle/bin/isabelle" \
38 "$SUPER_APP/Isabelle/bin/isabelle" \
39 "$HOME/bin/isabelle" \
43 # Proof General / Emacs
45 PROOFGENERAL_EMACS="$(choosefrom \
46 "$THIS/Emacs.app/Contents/MacOS/Emacs" \
47 "$SUPER_APP/Emacs.app/Contents/MacOS/Emacs" \
48 /Applications/Emacs.app/Contents/MacOS/Emacs \
51 declare -a EMACS_OPTIONS=()
52 if [ -n "$PROOFGENERAL_EMACS" ]; then
53 EMACS_OPTIONS=(-p "$PROOFGENERAL_EMACS")
57 # run interface with error feedback
59 OUTPUT="/tmp/isabelle$$.out"
61 # ( "$ISABELLE_TOOL" jedit "$@" ) > "$OUTPUT" 2>&1
62 ( "$ISABELLE_TOOL" emacs "${EMACS_OPTIONS[@]}" "$@" ) > "$OUTPUT" 2>&1
65 if [ "$RC" != 0 ]; then
67 echo "Return code: $RC" >> "$OUTPUT"
70 if [ $(stat -f "%z" "$OUTPUT") != 0 ]; then
71 "$THIS/CocoaDialog.app/Contents/MacOS/CocoaDialog" textbox \
73 --informative-text "Isabelle output" \
74 --text-from-file "$OUTPUT" \