Subject: how to combining "maxima-mode" and "imaxima"
From: Leo T Butler
Date: Tue, 14 Dec 2010 11:26:09 +0000
Quoting Holger Schurig <holgerschurig at gmx.de>:
> I'd like to write some mathematical document in maxima-mode. That
> works so far.
> However, I haven't found a way to make maxima-mode's "C-c C-c" (send line to
> maxima) to open an imaxima inferior process, it just opens a maxima inferior
> process.
>
> Of course I already set "imaxima-use-maxima-mode-flag", but I fail
> to understand
> how this possibly might work. It's only checked in imaxima.el, not in
> maximal.el, which contains the code for "maxima-mode".
You need to set this flag to t, then start imaxima. This will create
buffer named *maxima* with a maxima process plus running imaxima.
If you want to have a maxima-mode function automatically open an imaxima
inferior process, then you can use the defadvice facility:
(defadvice maxima-send-region (before maxima-start-imaxima first)
"Ensures that imaxima is running and the correct flag is set."
(setq imaxima-use-maxima-mode-flag t)
(imaxima))
(ad-activate 'maxima-send-region)
I advise maxima-send-region because all the *-send-* functions are
specialisations of it.
Leo
--
The University of Edinburgh is a charitable body, registered in
Scotland, with registration number SC005336.