Hi James,
Thanks for taking some of your time to improve the TeXmacs interface.
On Thu, 25 Sep 2003, James Amundson wrote:
> I have (finally) made some substantial progress on the maxima-texmacs
> interface. My changes have been committed to the maxima cvs repository.
> As it stands, I can run maxima through texmacs by modifying tm_maxima to
> execute
> maxima --preload-lisp=/pathname/texmacs-local.lisp
> The filter program is no longer necessary. I have attached
> texmacs-local.lisp to the end of this message. I haven't found a way to
> get the interface to hang; if someone else finds one it should be easy
> to fix.
It would be good though to provide backward compatability.
Would it possible for you and Andrey to write a tm_maxima script which
first checks the version of Maxima and then does the appropriate thing?
Notice that versioning information may also be dealt with
when configuring the plugin: this allows you to perform potentially
expensive detection routines only when you notice a change in the version.
Please take a look at
Help -> Manual -> TeXmacs plugins (section 5)
> There is still work to do -- I would like encapsulate the contents of
> texmacs-local.lisp into a single function that can be invoked from the
> command line, but a few issues have to be straightened out yet. I think
> input from the TeXmacs experts would be very beneficial at this point.
>
> Here is how texmacs-local.lisp differs from the original texmacs.lisp:
>
> 1) The code
>
> -------------------------------------------
> (DEFUN MAIN-PROMPT ...
> (DEFMFUN DISPLA ...
> (defun break-dbm-loop ...
> (DEFMFUN $ENTERMATRIX ...
> (setq $display2d '$texmacs)
> -------------------------------------------
>
> has changed to
>
> -------------------------------------------
> (setf *alt-display2d* 'latex)
> (setf *prompt-prefix* "channel:promptlatex:\\red ")
> (setf *prompt-suffix* "\\black")
> (setf *general-display-prefix* "verbatim:")
> (setf *maxima-prolog* "verbatim:")
> (setf *maxima-epilog* "latex:\\red The end\\black")
> -------------------------------------------
There is no need for a *general-display-suffix*?
Notice also that it would be a bit cleaner now to write
(setf *alt-display2d* 'latex)
(setf *prompt-prefix* "^Bprompt#^Blatex:{\\red ")
(setf *prompt-suffix* "}^E^E")
(setf *general-display-prefix* "^Bverbatim:")
(setf *maxima-prolog* "^Bverbatim:")
(setf *maxima-epilog* "^Blatex:{\\red The end}^E^E")
Please check whether that works correctly for you.
> In addition, several places where maxima would not have presented a
> texmacs-friendly prompt have been fixed.
Great :^)
> 2) There are a couple of bug fixes/additions:
>
> (defconstant texport t)
> causes CMUCL to fail to send any output to texmacs. I changed it to
>
> (defconstant texport *standard-output*)
>
> I also added
>
> #-gcl(setf *debug-io* (make-two-way-stream *standard-input*
> *standard-output*))
>
> to get the debugger to work with CMUCL.
Cool.
> 3) Clisp 2.31 produces a long list of annoying messages when the old
> texmacs.lisp is loaded. I avoid them by adding
>
> #+clisp (defvar *old-suppress-check-redefinition*
> custom:*suppress-check-redefinition*)
> #+clisp (setf custom:*suppress-check-redefinition* t)
>
> to the beginning of the file and
>
> #+clisp (setf custom:*suppress-check-redefinition*
> *old-suppress-check-redefinition*)
>
> to the end.
Maybe that Andrey is willing to update
the old texmacs.lisp file accordingly.
<Joris>