From bug-request at octave dot org Tue Jan 18 21:17:22 2005 Subject: Re: Bug#290470: octave2.1: Octave's bug_report needs emacs or $EDITOR From: "John W. Eaton" To: Dirk Eddelbuettel Cc: Rafael Laboissiere , bug@octave.org, Thomas Weber , 290470@bugs.debian.org Date: Tue, 18 Jan 2005 22:20:13 -0500 On 18-Jan-2005, Dirk Eddelbuettel wrote: | I don't really know either, or I would have suggested it. We, as you know, | try to get by without environment variables. A Debian-only fix therefore | would be to talk to /usr/bin/sensible-editor, which is guaranteed to be | present. But that doesn't help in the general case for Octave. | | It may not be worth going overboard here. You could do some autoconf magic | to check for emacs, xemacs, vi and remember the choice. Or do that with | shell when the above is executed. That would be better, since the binary may be running on a system different from the one where configure was run. | In either event, I think it would be fair | to abort with a message "no editor found, tempfile in /tmp/$foo left for | manual continuation" or some such. I think we already do something like this: devzero:260> EDITOR=foobar octave-bug /usr/bin/octave-bug: line 226: foobar: command not found problems with edit -- no bug report submitted saving message in /home/jwe/dead-octave-bug-1 OK, I just checked the bashbug script (which I used as the starting point for octave-bug way back when) and it now uses 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 "$0: No default editor found: attempting to use vi" >&2 DEFEDITOR=vi fi fi : ${EDITOR=$DEFEDITOR} so I'll copy this method. jwe ------------------------------------------------------------- Octave is freely available under the terms of the GNU GPL. Octave's home on the web: http://www.octave.org How to fund new projects: http://www.octave.org/funding.html Subscription information: http://www.octave.org/archive.html -------------------------------------------------------------