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