more robust handling of emacs options -- this is not necessarily an Isabelle process environment yet;
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 if [ -n "$PROOFGENERAL_EMACS" ]; then
52 EMACS_OPTIONS="-p $PROOFGENERAL_EMACS"
56 # run interface with error feedback
58 OUTPUT="/tmp/isabelle$$.out"
60 ( "$ISABELLE_TOOL" emacs $EMACS_OPTIONS "$@" ) > "$OUTPUT" 2>&1
63 if [ "$RC" != 0 ]; then
65 echo "Return code: $RC" >> "$OUTPUT"
68 if [ $(stat -f "%z" "$OUTPUT") != 0 ]; then
69 "$THIS/CocoaDialog.app/Contents/MacOS/CocoaDialog" textbox \
71 --informative-text "Isabelle output" \
72 --text-from-file "$OUTPUT" \