From 107ad31254bf3de30516ce0f2563892bacf9cb60 Mon Sep 17 00:00:00 2001 From: dos-reis Date: Mon, 20 Apr 2009 06:55:58 +0000 Subject: * interp/br-con.boot: Use textEditor() to get editor program. * interp/br-saturn.boot: Likewise. * interp/compat.boot: Likewise. * interp/i-util.boot (textEditor): Define here. * interp/g-util.boot: Likewise. --- src/ChangeLog | 8 ++++++++ src/doc/msgs/s2-us.msgs | 3 +++ src/interp/br-con.boot | 5 +++-- src/interp/br-saturn.boot | 2 +- src/interp/compat.boot | 7 +------ src/interp/g-util.boot | 2 +- src/interp/i-util.boot | 7 +++++++ 7 files changed, 24 insertions(+), 10 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 223041eb..66c9136b 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2009-04-20 Gabriel Dos Reis + + * interp/br-con.boot: Use textEditor() to get editor program. + * interp/br-saturn.boot: Likewise. + * interp/compat.boot: Likewise. + * interp/i-util.boot (textEditor): Define here. + * interp/g-util.boot: Likewise. + 2009-04-20 Gabriel Dos Reis * interp/msgdb.boot (substituteSegmentedMsg): Handle %x specifier. diff --git a/src/doc/msgs/s2-us.msgs b/src/doc/msgs/s2-us.msgs index 6ded51c7..d3e2ca8c 100644 --- a/src/doc/msgs/s2-us.msgs +++ b/src/doc/msgs/s2-us.msgs @@ -1060,6 +1060,9 @@ S2IZ0089 Compiling Lisp source code from file %1 S2IZ0090 Issuing )library command for %1 +S2IZ0091 + OpenAxiom could not find a suitable text editor. Please set and export + the environment variable %b EDITOR %d and start again. S2GE0000 Internal Error S2GE0001 diff --git a/src/interp/br-con.boot b/src/interp/br-con.boot index bccb34df..423ea272 100644 --- a/src/interp/br-con.boot +++ b/src/interp/br-con.boot @@ -182,7 +182,7 @@ kdPageInfo(name,abbrev,nargs,conform,signature,file?) == if filename ^= '"" then htSayStandard '"\newline{}" htSay('"The source code for the constructor is found in ") - htMakePage [['text,'"\unixcommand{",filename,'"}{_\$AXIOM/lib/SPADEDIT ", + htMakePage [['text,'"\unixcommand{",filename,'"}{",textEditor(), '" ", sourceFileName, '" ", name, '"}"]] if nargs ^= 0 then htSay '"." htSaturnBreak() @@ -1145,7 +1145,8 @@ bcUnixTable(u) == isAsharpFileName? x => '("AS") '("SPAD") filename := NAMESTRING $FINDFILE(STRINGIMAGE x, ft) - htMakePage [['text, '"\unixcommand{",PATHNAME_-NAME x, '"}{$AXIOM/lib/SPADEDIT ", filename, '"} "]] + htMakePage [['text, '"\unixcommand{",PATHNAME_-NAME x, '"}{", + textEditor(), '" ", filename, '"} "]] htSay '"}" htEndTable() diff --git a/src/interp/br-saturn.boot b/src/interp/br-saturn.boot index e439d1ca..3880cebc 100644 --- a/src/interp/br-saturn.boot +++ b/src/interp/br-saturn.boot @@ -1401,7 +1401,7 @@ displayDomainOp(htPage,which,origin,op,sig,predicate, htSaySourceFile conname == sourceFileName := (getConstructorSourceFileFromDB conname or '"none") filename := extractFileNameFromPath sourceFileName - htMakePage [['text,'"\unixcommand{",filename,'"}{_\$AXIOM/lib/SPADEDIT ", + htMakePage [['text,'"\unixcommand{",filename,'"}{", textEditor(), '" ", sourceFileName, '" ", conname, '"}"]] htSayIndentRel(n,:options) == diff --git a/src/interp/compat.boot b/src/interp/compat.boot index b5082786..c5a77c23 100644 --- a/src/interp/compat.boot +++ b/src/interp/compat.boot @@ -57,12 +57,7 @@ system() == terminateSystemCommand() editFile file == - editProg := - %hasFeature KEYWORD::WIN32 => '"notepad" - prog := getEnv '"EDITOR" => prog - # $EditorProgram ^= 0 => $EditorProgram - return nil -- FIXME: Should we not notify user? - runCommand STRCONC(editProg,'" ",namestring pathname file) + runCommand strconc(textEditor(),'" ",namestring pathname file) makeBigFloat(mantissa,expon) == [$BFtag,mantissa,:expon] diff --git a/src/interp/g-util.boot b/src/interp/g-util.boot index 8826bd95..d51b72cc 100644 --- a/src/interp/g-util.boot +++ b/src/interp/g-util.boot @@ -533,7 +533,7 @@ isLetter c == update() == runCommand - STRCONC('"SPADEDIT ",STRINGIMAGE _/VERSION,'" ",STRINGIMAGE _/WSNAME,'" A") + STRCONC(textEditor(), '" ",STRINGIMAGE _/VERSION,'" ",STRINGIMAGE _/WSNAME,'" A") _/UPDATE() --% Inplace Merge Sort for Lists diff --git a/src/interp/i-util.boot b/src/interp/i-util.boot index b1ce6575..86060fed 100644 --- a/src/interp/i-util.boot +++ b/src/interp/i-util.boot @@ -82,6 +82,13 @@ printPrompt(flush? == false) == if flush? then FORCE_-OUTPUT $OutputStream +++ Return the name of a text editor, if possible. +textEditor() == + prog := getEnv '"EDITOR" => prog + # $EditorProgram ^= 0 => $EditorProgram + %hasFeature KEYWORD::WIN32 => '"notepad" + throwKeyedMsg("S2IZ0091",nil) + --% Miscellaneous $ZeroVecCache := nil -- cgit v1.2.3