texmacs interface

2 views
Skip to first unread message

Ralf Hemmecke

unread,
May 15, 2022, 8:59:57 AM5/15/22
to fricas-devel
I was just wondering whether we still need to have the directory
contrib/texmacs in the fricas repo. All these files have

COPYRIGHT : (C) 1999, 2012 Joris van der Hoeven and Andrey Grozin

and fall under GPL3+ and FriCAS is not actually distributing them in the
binary tarballs. I also do not see that the texmacs directory is ever
touched during a normal build+install of fricas.

I suggest to remove contrib/texmacs, because they appear in the latest
distribution of TeXmacs itself.

https://www.texmacs.org/Download/ftp/tmftp/source/TeXmacs-2.1.1-src.tar.gz

http://svn.savannah.gnu.org/viewvc/texmacs/trunk/src/plugins/fricas/

Ralf

Kurt Pagani

unread,
May 15, 2022, 9:51:36 AM5/15/22
to fricas...@googlegroups.com
You're right, there is not much that's not already integrated in TeXmacs. On the
other hand, as a frequent Tm user, I'd suggest to update the folder and even
considering to fill it with useful addons instead ;) There is no doubt, Tm has
dramatically improved in the past years and the fricas interface should not be
left out in the cold. There are interesting features, like serializing and so
on, which seem unique to me.

On this occasion I suggest to think about the "prompt" and the display of types
- not very nice from an aesthetic point of view. A first step could be to
rewrite the "markers" in the fricas start script, then one could edit various
items more easily:


markers=$(cat << EOF
)lisp (setf |\$ioHook| (lambda (x &optional args)
(cond ((eq x '|startPrompt|) (princ (concat (code-char 2) "prompt\#") ))
((eq x '|endOfTeXmacsOutput|) (princ (concat (code-char 5) (code-char
10))))
((eq x '|startTeXmacsOutput|) (princ (code-char 2)))
((eq x '|startKeyedMsg|) (princ (concat (code-char 2) "verbatim:")))
((eq x '|endOfKeyedMsg|) (princ (code-char 5)))
((eq x '|endOfPrompt|) (princ (code-char 5) )) )))

EOF
)


So, just as an a example, the user could set some variables to control the
output items mentioned above.

#############################################################################
cc2="(code-char 2)"
cc5="(code-char 5)"
cc10="(code-char 10)"

#msgbeg="\"html:<p><sub>\""
#msgend="\"</sub></p>\""

msgbeg="\"latex:{}_{\\\\textsf{\""
msgend="\"}}\""

markers=$(cat << EOF
)lisp (setf |\$ioHook| (lambda (x &optional args)
(cond ((eq x '|startPrompt|) (princ (concat $cc2 "prompt\#")))
((eq x '|endOfTeXmacsOutput|) (princ (concat $cc5 $cc10)))
((eq x '|startTeXmacsOutput|) (princ $cc2))
((eq x '|startKeyedMsg|) (princ (concat $cc2 $msgbeg)))
((eq x '|endOfKeyedMsg|) (princ (concat $msgend $cc5 $cc10)))
((eq x '|endOfPrompt|) (princ $cc5)))))

EOF
)

##############################################################################

Obvioulsy, this is not as user friendly as it should be, however, most features
can also be controlled by a spad file.

To bring it back to your question, it's perhaps more favourable to handle these
things outside the fricas distribution (changed my mind during writing ;).

Best regards
Kurt



---
(2) -> )sh TMSPT
TexmacsSupport is a package constructor
Abbreviation for TexmacsSupport is TMSPT
This constructor is exposed in this frame.
------------------------------- Operations --------------------------------

addDefaultStyle : () -> Void addStyle : String -> Void
changeZoomFactor : Float -> Void clearAllFields : () -> Void
closeSession : () -> Void command : String -> Void
createSubsession : () -> Void evaluateAbove : () -> Void
evaluateAll : () -> Void evaluateBelow : () -> Void
evaluateFieldsInOrder : () -> Void firstField : () -> Void
fitAllToScreen : () -> Void fitToScreen : () -> Void
fitToScreenHeight : () -> Void fitToScreenWidth : () -> Void
foldAllFields : () -> Void html : String -> Void
inlineImage : String -> Void input : String -> Void
insertFieldAbove : () -> Void insertFieldBelow : () -> Void
insertTextFieldAbove : () -> Void insertTextFieldBelow : () -> Void
lastField : () -> Void latex : String -> Void
linkImage : String -> Void mathInput : String -> String
message : (String, String) -> Void nextField : () -> Void
output : String -> Void previousField : () -> Void
prompt : String -> Void ps : String -> Void
removeBanner : () -> Void removeDefaultStyle : () -> Void
removeLastField : () -> Void removeNextField : () -> Void
removePreviousField : () -> Void removeStyle : String -> Void
scheme : String -> Void sessionEval : () -> Void
showTimings : () -> Void splitSession : () -> Void
tmActive? : () -> Boolean toggleFooter : () -> Void
toggleFullScreenMode : () -> Void toggleHeader : () -> Void
toggleMathInput : () -> Void toggleMathOutput : () -> Void
toggleMultilineInput : () -> Void toggleTreeOutput : () -> Void
unfoldAllFields : () -> Void verbatim : String -> Void
zoomIn : Float -> Void zoomOut : Float -> Void
toggleSchemeTreeOutput : () -> Void

Waldek Hebisch

unread,
May 15, 2022, 7:00:54 PM5/15/22
to fricas...@googlegroups.com
AFAIR the files were included when new Texmacs interface was develeped.
At that time regular Texmacs contained only support for old interface.
Texmacs user could install them and benefit from new interface.
AFAICS now they are not needed and we can remove them.

--
Waldek Hebisch
Reply all
Reply to author
Forward
0 new messages