aboutsummaryrefslogtreecommitdiff
path: root/src/interp
diff options
context:
space:
mode:
Diffstat (limited to 'src/interp')
-rw-r--r--src/interp/br-con.boot5
-rw-r--r--src/interp/br-saturn.boot2
-rw-r--r--src/interp/compat.boot7
-rw-r--r--src/interp/g-util.boot2
-rw-r--r--src/interp/i-util.boot7
5 files changed, 13 insertions, 10 deletions
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