Below a patch implementing some more markers and putting one in a better
place. I'm currently revising Francois Maltey's new axiom-mode, which relies
on the markers.
I noticed a few things:
1) currently, iohook is called unconditionally. It might be nice to be able to
turn it off for HyperDoc examples.
2) A lot of the code looks rather unclean.
3) Is it possible to display a HyperDoc page with a FriCAS command? If so, I'd
try to make the type information clickable in emacs, and make HyperDoc show
the page when the user clicks on it. That would be a very useful feature, I
think.
Martin
Index: src/interp/int-top.boot
===================================================================
--- src/interp/int-top.boot (Revision 364)
+++ src/interp/int-top.boot (Arbeitskopie)
@@ -152,6 +152,7 @@
$promptMsg : local := 'S2CTP023
interactive? =>
+-- MRX I'm not sure whether I should call
ioHook("startPrompt")/ioHook("endOfPrompt") here
PRINC(MKPROMPT())
intloopReadConsole('"", str)
[]
@@ -188,23 +189,31 @@
ioHook("endOfReadLine")
not STRINGP a => leaveScratchpad()
#a=0 =>
+ ioHook("startPrompt")
PRINC(MKPROMPT())
+ ioHook("endOfPrompt")
intloopReadConsole('"", n)
$DALYMODE and intloopPrefix?('"(",a) =>
intnplisp(a)
+ ioHook("startPrompt")
PRINC(MKPROMPT())
+ ioHook("endOfPrompt")
intloopReadConsole('"",n)
pfx := stripSpaces intloopPrefix?('")fi",a)
pfx and ((pfx = '")fi") or (pfx = '")fin")) => []
b = '"" and (d := intloopPrefix?('")", a)) =>
setCurrentLine d
c := ncloopCommand(d,n)
+ ioHook("startPrompt")
PRINC(MKPROMPT())
+ ioHook("endOfPrompt")
intloopReadConsole('"", c)
a:=CONCAT(b,a)
ncloopEscaped a => intloopReadConsole(SUBSEQ(a, 0, (LENGTH a) - 1),n)
c := intloopProcessString(a, n)
+ ioHook("startPrompt")
PRINC(MKPROMPT())
+ ioHook("endOfPrompt")
intloopReadConsole('"", c)
-- The 'intloopPrefix?' function tests if the string 'prefix' is
@@ -297,7 +306,6 @@
#ncEltQ(cc, 'messages) ^= 0 => ncError()
- ioHook("endOfOutput")
intSetNeedToSignalSessionManager()
$prevCarrier := $currentCarrier
result = 'ncEnd => stepNo
Index: src/interp/parsing.lisp
===================================================================
--- src/interp/parsing.lisp (Revision 364)
+++ src/interp/parsing.lisp (Arbeitskopie)
@@ -682,6 +682,7 @@
:adjustable t :initial-contents s))))
(defun get-a-line (stream)
+;; MRX I'm not sure whether I should call
ioHook("startPrompt")/ioHook("endOfPrompt") here
(if (IS-CONSOLE stream) (princ (MKPROMPT)))
(let ((ll (read-a-line stream)))
(if (stringp ll) (make-string-adjustable ll) ll)))
Index: src/interp/msgdb.boot
===================================================================
--- src/interp/msgdb.boot (Revision 364)
+++ src/interp/msgdb.boot (Arbeitskopie)
@@ -458,13 +458,13 @@
spadThrow()
queryUserKeyedMsg(key,args) ==
- ioHook("startQueryUser")
-- display message and return reply
conStream := DEFIOSTREAM ('((DEVICE . CONSOLE) (MODE . INPUT)))
sayKeyedMsg(key,args)
+ ioHook("startQueryUser")
ans := read_-line conStream
+ ioHook("endOfQueryUser")
SHUT conStream
- ioHook("endOfQueryUser")
ans
flowSegmentedMsg(msg, len, offset) ==
Index: src/interp/ht-util.boot
===================================================================
--- src/interp/ht-util.boot (Revision 364)
+++ src/interp/ht-util.boot (Arbeitskopie)
@@ -453,6 +453,7 @@
TERPRI()
ncSetCurrentLine(command)
CATCH('SPAD__READER, parseAndInterpret command)
+-- MRX I'm not sure whether I should call
ioHook("startPrompt")/ioHook("endOfPrompt") here
PRINC MKPROMPT()
FINISH_-OUTPUT()
Index: src/interp/server.boot
===================================================================
--- src/interp/server.boot (Revision 364)
+++ src/interp/server.boot (Arbeitskopie)
@@ -66,6 +66,7 @@
sockSendInt($SessionManager, $CreateFrameAnswer)
sockSendInt($SessionManager, $frameNumber)
$frameNumber := $frameNumber + 1
+-- MRX I'm not sure whether I should call
ioHook("startPrompt")/ioHook("endOfPrompt") here
sockSendString($SessionManager, MKPROMPT())
action = $SwitchFrames =>
$currentFrameNum := sockGetInt($SessionManager)
@@ -86,6 +87,7 @@
stringBuf := sockGetStringFrom($MenuServer)
CATCH('coerceFailure,CATCH('top__level, CATCH('SPAD__READER,
parseAndInterpret stringBuf)))
+-- MRX I'm not sure whether I should call
ioHook("startPrompt")/ioHook("endOfPrompt") here
PRINC MKPROMPT()
FINISH_-OUTPUT()
action = $NonSmanSession =>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/fricas-devel?hl=en
-~----------~----~----~----~------~----~------~--~---