axiom-developer
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Axiom-developer] axiom-mar2009 release : )edit filename does not wo


From: root
Subject: Re: [Axiom-developer] axiom-mar2009 release : )edit filename does not work
Date: Mon, 13 Apr 2009 01:49:53 -0400

Michael,

Thanks. I can reproduce that. Its a missing script and I'll add it.

You can put this in your $AXIOM/lib subdirectory, do a chmod +x SPADEDIT
and it will work:

=====================================================================
#!/bin/sh
# this script is invoked by the spad )edit command
# can be replaced by users favorite editor
# optional second argument should be character offset in file

thefile=$1
if [ ! -f $1 ] ; then 
  thefile=$AXIOM/../../src/algebra/$1
else
  thefile=$1
fi


if [ $# = 2 ] ; then
        START=`grep -n \^$2\( $thefile | awk -F: '{print $1}'`
else
        START=1
fi

if [ ! "$EDITOR" ] ; then
        EDITOR=vi
fi

if [ "$DISPLAY" ] ; then
        if [ "$EDITOR" = "emacs" ] ; then
                emacs  +$START $thefile &
        elif [ "$EDITOR" = "vi" ] ; then
                xterm -e vi +$START $thefile &
        else
                xterm -e $EDITOR $thefile &
        fi
else
        $EDITOR $thefile
fi




reply via email to

[Prev in Thread] Current Thread [Next in Thread]