# HG changeset patch # User wenzelm # Date 1357752951 -3600 # Node ID b7e38c13d87b23c4904f590b5355422472aa168b # Parent ef950fad78079ba8a54bf8d2574ad361cf1b88f6 eliminated choosefrom -- power-users may edit global defaults within script; prefer jedit; diff -r ef950fad7807 -r b7e38c13d87b Admin/MacOS/App1/script --- a/Admin/MacOS/App1/script Wed Jan 09 18:32:26 2013 +0100 +++ b/Admin/MacOS/App1/script Wed Jan 09 18:35:51 2013 +0100 @@ -9,7 +9,13 @@ SUPER_APP="$(cd "$THIS/../../.."; pwd)" -# sane environment defaults +# global defaults + +ISABELLE_TOOL="$THIS/Isabelle/bin/isabelle" +PROOFGENERAL_EMACS="$THIS/Aquamacs.app/Contents/MacOS/Aquamacs" + + +# environment cd "$HOME" if [ -x /usr/libexec/path_helper ]; then @@ -19,46 +25,6 @@ [ -z "$LANG" ] && export LANG=en_US.UTF-8 -# settings support - -function choosefrom () -{ - local RESULT="" - local FILE="" - - for FILE in "$@" - do - [ -z "$RESULT" -a -e "$FILE" ] && RESULT="$FILE" - done - - [ -z "$RESULT" ] && RESULT="$FILE" - echo "$RESULT" -} - - -# Isabelle - -ISABELLE_TOOL="$(choosefrom \ - "$THIS/Isabelle/bin/isabelle" \ - "$SUPER_APP/Isabelle/bin/isabelle" \ - "$HOME/bin/isabelle" \ - isabelle)" - - -# Proof General / Emacs - -PROOFGENERAL_EMACS="$(choosefrom \ - "$THIS/Aquamacs.app/Contents/MacOS/Aquamacs" \ - "$SUPER_APP/Aquamacs.app/Contents/MacOS/Aquamacs" \ - /Applications/Aquamacs.app/Contents/MacOS/Aquamacs \ - "")" - -declare -a EMACS_OPTIONS=() -if [ -n "$PROOFGENERAL_EMACS" ]; then - EMACS_OPTIONS=(-p "$PROOFGENERAL_EMACS") -fi - - # run interface with error feedback ISABELLE_INTERFACE_CHOICE="$("$ISABELLE_TOOL" getenv -b ISABELLE_INTERFACE_CHOICE)" @@ -68,12 +34,12 @@ CHOICE=($("$THIS/CocoaDialog.app/Contents/MacOS/CocoaDialog" dropdown \ --title Isabelle \ --text "Which Isabelle interface?" \ - --items "Emacs / Proof General" "Isabelle/jEdit PIDE" \ + --items "Isabelle/jEdit PIDE" "Emacs / Proof General" \ --button2 "OK, do not ask again" --button1 "OK")) if [ "${CHOICE[1]}" = 0 ]; then - ISABELLE_INTERFACE_CHOICE=emacs + ISABELLE_INTERFACE_CHOICE=jedit else - ISABELLE_INTERFACE_CHOICE=jedit + ISABELLE_INTERFACE_CHOICE=emacs fi if [ "${CHOICE[0]}" = 2 ]; then ISABELLE_HOME_USER="$("$ISABELLE_TOOL" getenv -b ISABELLE_HOME_USER)" @@ -91,7 +57,7 @@ OUTPUT="/tmp/isabelle$$.out" if [ "$ISABELLE_INTERFACE_CHOICE" = emacs ]; then - ( "$ISABELLE_TOOL" emacs "${EMACS_OPTIONS[@]}" "$@" ) > "$OUTPUT" 2>&1 + ( "$ISABELLE_TOOL" emacs -p "$PROOFGENERAL_EMACS" "$@" ) > "$OUTPUT" 2>&1 RC=$? else ( "$ISABELLE_TOOL" jedit "$@" ) > "$OUTPUT" 2>&1