# HG changeset patch # User jwe # Date 1106104531 0 # Node ID aa9bc151d2fa007132a0519a7d7aa0f1efe4ff8c # Parent ea96466f98eafff0bffcb03d8c45641f15b5f91b [project @ 2005-01-19 03:15:31 by jwe] diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-01-18 John W. Eaton + + * octave-bug.in: Try harder to find default editor. + 2004-12-17 John W. Eaton * configure.in: Use AC_GNU_SOURCE. diff --git a/octave-bug.in b/octave-bug.in --- a/octave-bug.in +++ b/octave-bug.in @@ -63,7 +63,33 @@ TEMP=/tmp/octave-bug.$$ -: ${EDITOR=emacs} +if [ -z "$DEFEDITOR" ] && [ -z "$EDITOR" ]; then + if [ -x /usr/bin/editor ]; then + DEFEDITOR=editor + elif [ -x /usr/local/bin/ce ]; then + DEFEDITOR=ce + elif [ -x /usr/local/bin/emacs ]; then + DEFEDITOR=emacs + elif [ -x /usr/contrib/bin/emacs ]; then + DEFEDITOR=emacs + elif [ -x /usr/bin/emacs ]; then + DEFEDITOR=emacs + elif [ -x /usr/bin/xemacs ]; then + DEFEDITOR=xemacs + elif [ -x /usr/contrib/bin/jove ]; then + DEFEDITOR=jove + elif [ -x /usr/local/bin/jove ]; then + DEFEDITOR=jove + elif [ -x /usr/bin/vi ]; then + DEFEDITOR=vi + else + echo "octave-bug: No default editor found: attempting to use vi" >&2 + DEFEDITOR=vi + fi +fi + +: ${EDITOR=$DEFEDITOR} + : ${PAGER=more} trap 'rm -f $TEMP $TEMP.x; exit 1' 1 2 3 13 15