#!/bin/sh # # ecl : Run Allegro under Emacs. # # With "-h host", run on that host. Other args are passed to Emacs # before loading the code to start Allegro. # # George Ferguson, ferguson@cs.rochester.edu, 14 Dec 1992. # gf 16 Feb 1993: Fixed display setting for remote/remote. # # Customizations bufname='*allegro*' winname='Allegro' osname=`uname` if [ "$osname" = "Linux" ]; then image='/usr/staff/bin/lisp' else image='/usr/staff/bin/cll' fi #image='/s5/acl5.0/images/`basename $0`.dxl' size='160x60' # Parse command line rhost="" case "$1" in -h) rhost="$2"; shift 2;; -\?) echo "usage: $0 [-h host] [...]" 1>&2 exit 1;; esac # Where are we running? host=${HOST:-`hostname | cut -d. -f1`} # Where are we displaying? if test -z "$DISPLAY"; then echo "$0: \$DISPLAY not set -- things could get weird..." 1>&2 else xhost="`echo "$DISPLAY" | cut -d: -f1`" xscreen="`echo "$DISPLAY" | cut -d: -f2`" if test "$xhost" = "unix"; then xhost="$host" fi fi # Temporary elisp code (needs to be NFS visible for rhosts!) tmp=$HOME/.eclrc trap "rm -f $tmp; exit 1" 0 1 2 3 15 cat <<__EOF__ >$tmp (setq load-path (cons "/usr/staff/acl/urcs" load-path)) (autoload 'fi:common-lisp "fi-init" "" t) (autoload 'allegro "fi-init" "" t) (autoload 'clim "fi-init" "" t) (setq fi:common-lisp-buffer-name "$bufname") (fi:common-lisp "$bufname" default-directory "$image" nil "localhost") (split-window-horizontally) (switch-to-buffer "*scratch*") __EOF__ # Fire up Emacs if test -z "$rhost"; then # Local execution emacs -geometry $size -name "$winname@$host" "$@" -l $tmp else if test "$xhost" = "$host"; then # Local display, remote execution echo xhost +$rhost else # Remote display, remote execution echo rsh $xhost xhost +$rhost fi # Remote execution echo rsh -n $rhost emacs -d ${xhost}:$xscreen \ -geometry $size -name "$winname@$rhost" "$@" -l $tmp fi