lib/scripts/isa-xterm
author wenzelm
Wed May 14 18:38:15 1997 +0200 (1997-05-14)
changeset 3185 7a6c933d51d0
parent 3007 e5efa177ee0c
child 5965 f91212fd2c7c
permissions -rwxr-xr-x
tuned;
wenzelm@3007
     1
#!/bin/bash
wenzelm@2300
     2
#
wenzelm@2307
     3
# $Id$
wenzelm@2307
     4
#
wenzelm@2788
     5
# Simple Isabelle interface based on xterm.
wenzelm@2300
     6
wenzelm@2300
     7
wenzelm@2300
     8
## diagnostics
wenzelm@2300
     9
wenzelm@2623
    10
PRG=$(basename $0)
wenzelm@2623
    11
wenzelm@2623
    12
function usage()
wenzelm@2623
    13
{
wenzelm@2623
    14
  echo
wenzelm@2623
    15
  echo "Usage: $PRG [OPTIONS] [--] [CMDLINE]"
wenzelm@2623
    16
  echo
wenzelm@2623
    17
  echo "  Options are:"
wenzelm@2623
    18
  echo "    -g GEOM      main window geometry (default 80x60)"
wenzelm@2788
    19
  echo "    -h MODE      highlight mode, may be false, bold (default), color"
wenzelm@2712
    20
  echo "    -p TEXT      pass text (options etc.) to isabelle session"
wenzelm@2623
    21
  echo "    -s BOOL      symbolic font output? (default true)"
wenzelm@2623
    22
  echo
wenzelm@2623
    23
  echo "  Starts Isabelle within an xterm window. CMDLINE is passed"
wenzelm@2623
    24
  echo "  directly to the isabelle session."
wenzelm@2623
    25
  echo
wenzelm@2623
    26
  exit 1
wenzelm@2623
    27
}
wenzelm@2623
    28
wenzelm@2300
    29
function fail()
wenzelm@2300
    30
{
wenzelm@2344
    31
  echo "$1" >&2
wenzelm@2300
    32
  exit 2
wenzelm@2300
    33
}
wenzelm@2300
    34
wenzelm@2300
    35
wenzelm@2623
    36
## process command line
wenzelm@2623
    37
wenzelm@2623
    38
# options
wenzelm@2623
    39
wenzelm@2623
    40
MAINGEOM="80x60"
wenzelm@2788
    41
HILITE=bold
wenzelm@2712
    42
PASS=""
wenzelm@2623
    43
SYMBOLS="true"
wenzelm@2623
    44
wenzelm@2788
    45
while getopts "g:h:p:s:" OPT
wenzelm@2623
    46
do
wenzelm@2623
    47
  case "$OPT" in
wenzelm@2623
    48
    g)
wenzelm@2623
    49
      MAINGEOM="$OPTARG"
wenzelm@2623
    50
      ;;
wenzelm@2788
    51
    h)
wenzelm@2788
    52
      HILITE="$OPTARG"
wenzelm@2788
    53
      ;;
wenzelm@2712
    54
    p)
wenzelm@2712
    55
      PASS="$PASS $OPTARG"
wenzelm@2623
    56
      ;;
wenzelm@2623
    57
    s)
wenzelm@2623
    58
      SYMBOLS="$OPTARG"
wenzelm@2623
    59
      ;;
wenzelm@2623
    60
    \?)
wenzelm@2623
    61
      usage
wenzelm@2623
    62
      ;;
wenzelm@2623
    63
  esac
wenzelm@2623
    64
done
wenzelm@2623
    65
wenzelm@2623
    66
shift $(($OPTIND - 1))
wenzelm@2623
    67
wenzelm@2623
    68
wenzelm@2300
    69
## main
wenzelm@2300
    70
wenzelm@2788
    71
if [ "$HILITE" = bold ]; then
wenzelm@2788
    72
  PASS="-m xterm $PASS"
wenzelm@2788
    73
elif [ "$HILITE" = color ]; then
wenzelm@2788
    74
  PASS="-m xterm_color $PASS"
wenzelm@2788
    75
elif [ -n "$HILITE" -a "$HILITE" != false ]; then
wenzelm@2788
    76
  echo "WARNING: unknown highlight mode '$HILITE'" >&2
wenzelm@2788
    77
fi
wenzelm@2788
    78
wenzelm@2623
    79
if [ -z "$SYMBOLS" -o "$SYMBOLS" = false ]; then
wenzelm@2712
    80
  exec xterm -T Isabelle -n Isabelle -geometry "$MAINGEOM" -e $ISABELLE $PASS "$@"
wenzelm@2300
    81
else
wenzelm@2474
    82
  $ISATOOL installfonts
wenzelm@2770
    83
  exec xterm -T Isabelle -n Isabelle -geometry "$MAINGEOM" -fn isabelle14 \
wenzelm@2743
    84
    -xrm "*fontMenu.Label: Isabelle fonts" \
wenzelm@2743
    85
    -xrm "*fontMenu*font1*Label: Large" \
wenzelm@2770
    86
    -xrm "*VT100*font1: isabelle24" \
wenzelm@2743
    87
    -xrm "*fontMenu*font2*Label:" \
wenzelm@2743
    88
    -xrm "*VT100*font2:" \
wenzelm@2743
    89
    -xrm "*fontMenu*font3*Label:" \
wenzelm@2743
    90
    -xrm "*VT100*font3:" \
wenzelm@2743
    91
    -xrm "*fontMenu*font4*Label:" \
wenzelm@2743
    92
    -xrm "*VT100*font4:" \
wenzelm@2743
    93
    -xrm "*fontMenu*font5*Label:" \
wenzelm@2743
    94
    -xrm "*VT100*font5:" \
wenzelm@2743
    95
    -xrm "*fontMenu*font6*Label:" \
wenzelm@2743
    96
    -xrm "*VT100*font6:" \
wenzelm@2743
    97
    -e $ISABELLE -m symbols $PASS "$@"
wenzelm@2300
    98
fi