lib/scripts/isa-emacs
author wenzelm
Tue, 13 Feb 2001 16:31:18 +0100
changeset 11109 ce1cefc6c14c
parent 10555 2323ec838401
child 14981 e73f8140af78
permissions -rwxr-xr-x
tuned;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10555
2323ec838401 /usr/bin/env bash;
wenzelm
parents: 10512
diff changeset
     1
#!/usr/bin/env bash
2305
35f78d6c4faa Emacs / Isamode interface.
wenzelm
parents:
diff changeset
     2
#
2312
65ea8bbb4e02 *** empty log message ***
wenzelm
parents: 2305
diff changeset
     3
# $Id$
9789
wenzelm
parents: 7459
diff changeset
     4
# Author: Markus Wenzel, TU Muenchen
wenzelm
parents: 7459
diff changeset
     5
# License: GPL (GNU GENERAL PUBLIC LICENSE)
2312
65ea8bbb4e02 *** empty log message ***
wenzelm
parents: 2305
diff changeset
     6
#
3304
08952002358d adapted to Isamode 2.6;
wenzelm
parents: 3007
diff changeset
     7
# Emacs Isamode interface wrapper.
2305
35f78d6c4faa Emacs / Isamode interface.
wenzelm
parents:
diff changeset
     8
35f78d6c4faa Emacs / Isamode interface.
wenzelm
parents:
diff changeset
     9
35f78d6c4faa Emacs / Isamode interface.
wenzelm
parents:
diff changeset
    10
## diagnostics
35f78d6c4faa Emacs / Isamode interface.
wenzelm
parents:
diff changeset
    11
10512
wenzelm
parents: 9794
diff changeset
    12
PRG="$(basename "$0")"
2939
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    13
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    14
function usage()
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    15
{
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    16
  echo
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    17
  echo "Usage: $PRG [OPTIONS]"
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    18
  echo
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    19
  echo "  Options are:"
5965
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    20
  echo "    -g GEOM      main window geometry (default none)"
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    21
  echo "    -p NAME      Emacs program name (default xemacs)"
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    22
  echo "    -u BOOL      use .emacs file (default false)"
2939
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    23
  echo
4928
c17493ccfd54 disabled (experimental) geometry option
oheimb
parents: 3311
diff changeset
    24
  echo "Starts Emacs and Isamode."
7459
173efad74891 usage: tell current OPTIONS value;
wenzelm
parents: 6285
diff changeset
    25
  echo
173efad74891 usage: tell current OPTIONS value;
wenzelm
parents: 6285
diff changeset
    26
  echo "  ISAMODE_OPTIONS=$ISAMODE_OPTIONS"
173efad74891 usage: tell current OPTIONS value;
wenzelm
parents: 6285
diff changeset
    27
  echo
2939
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    28
  exit 1
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    29
}
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    30
2305
35f78d6c4faa Emacs / Isamode interface.
wenzelm
parents:
diff changeset
    31
function fail()
35f78d6c4faa Emacs / Isamode interface.
wenzelm
parents:
diff changeset
    32
{
2344
c3e1eaea4418 added -norc option;
wenzelm
parents: 2312
diff changeset
    33
  echo "$1" >&2
2305
35f78d6c4faa Emacs / Isamode interface.
wenzelm
parents:
diff changeset
    34
  exit 2
35f78d6c4faa Emacs / Isamode interface.
wenzelm
parents:
diff changeset
    35
}
35f78d6c4faa Emacs / Isamode interface.
wenzelm
parents:
diff changeset
    36
35f78d6c4faa Emacs / Isamode interface.
wenzelm
parents:
diff changeset
    37
2939
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    38
## process command line
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    39
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    40
# options
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    41
5965
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    42
MAINGEOM=""
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    43
PROGNAME=xemacs
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    44
INITFILE=false
2939
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    45
5965
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    46
function getoptions()
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    47
{
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    48
  OPTIND=1
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    49
  while getopts "g:p:u:" OPT
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    50
  do
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    51
    case "$OPT" in
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    52
      g)
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    53
        MAINGEOM="$OPTARG"
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    54
        ;;
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    55
      p)
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    56
        PROGNAME="$OPTARG"
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    57
        ;;
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    58
      u)
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    59
        INITFILE="$OPTARG"
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    60
        ;;
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    61
      \?)
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    62
        usage
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    63
        ;;
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    64
    esac
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    65
  done
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    66
}
2939
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    67
5965
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    68
getoptions $ISAMODE_OPTIONS
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    69
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    70
getoptions "$@"
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    71
shift $(($OPTIND - 1))
2939
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    72
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    73
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    74
# args
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    75
9789
wenzelm
parents: 7459
diff changeset
    76
[ "$#" != 0 ] && usage
2939
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    77
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    78
2305
35f78d6c4faa Emacs / Isamode interface.
wenzelm
parents:
diff changeset
    79
## main
35f78d6c4faa Emacs / Isamode interface.
wenzelm
parents:
diff changeset
    80
5965
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    81
ARGS=""
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    82
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    83
[ -n "$MAINGEOM" ] && ARGS="$ARGS -geometry $MAINGEOM"
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    84
[ "$INITFILE" = false ] && ARGS="$ARGS -q"
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    85
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    86
10512
wenzelm
parents: 9794
diff changeset
    87
ARGS="$ARGS -l '$ISAMODE_HOME/elisp/isa-site.el'"
2939
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    88
3304
08952002358d adapted to Isamode 2.6;
wenzelm
parents: 3007
diff changeset
    89
for FILE in "$ISABELLE_HOME/etc/isa-settings.el" \
08952002358d adapted to Isamode 2.6;
wenzelm
parents: 3007
diff changeset
    90
    "$ISABELLE_HOME_USER/etc/isa-settings.el"
08952002358d adapted to Isamode 2.6;
wenzelm
parents: 3007
diff changeset
    91
do
10512
wenzelm
parents: 9794
diff changeset
    92
  [ -f "$FILE" ] && ARGS="$ARGS -l '$FILE'"
3304
08952002358d adapted to Isamode 2.6;
wenzelm
parents: 3007
diff changeset
    93
done
2939
73837efaf71b misc improvement;
wenzelm
parents: 2600
diff changeset
    94
5965
f91212fd2c7c eliminated ISABELLE_INTERFACE_OPTIONS;
wenzelm
parents: 4928
diff changeset
    95
ARGS="$ARGS -f isabelle"
10512
wenzelm
parents: 9794
diff changeset
    96
eval exec "$PROGNAME" -T "Isabelle" "$ARGS"