Emaxima questions/bug report



C Y <smustudent1@yahoo.com> writes:

First of all, thanks for all the nice words!

> > > Also, would there be any way to add into emaxima mode the ability
> > to
> > > generate sessions of the kind that batlatex does, so we can have
> > all
> > > the abilities in one package?
> > 
> > emaxima-mode now has session cells, which begin and end with
> > \beginmaximasession
> > and 
> > \endmaximasession
> > and will result in the input and output being together with the
> > Maxima prompts.  (It doesn't yet do the nice colors and TeX output 
> > that batlatex does, though.)
> 
> I've been trying that out, and so far it looks excellent.  Do you think
> there is any way to add the TeX stuff at some point in the future?  

The only real problem is in adding a switch to Maxima which will have
the output automatically in TeX form, and being able to switch back to
ascii form.  (Actually, if it could be switched to TeX form but not
switched back, that would be something.)
imaxima.lisp does this, but the output isn't quite what is needed for
EMaxima.  I think imaxima.lisp could be twiddled a bit, though, to get
it to work.  If so, adding the TeX shouldn't be hard.  I'll look at it
when I get the chance.  (I'm not sure when; fairly soon, I hope.)

> So far, in trying the session environment out, I've stumbled onto one
> thing that should probably be fixed - if a quit(); command is included
> in a session it hangs emacs.  Granted that probably won't be a command
> included real often, but still it should probably fail cleanly.

Okay, I think I got it fixed.  (It's late, I may have missed
something...)  I tried to fix it by having Emacs look at the status of
the Maxima process, but I didn't get that to work.  So I did something
less elegant, I had Emacs look for a quit(); or a ^D being sent to
Maxima, and in that case take care of the situation.  Then there was a
problem if you tried to do something (move the cursor, etc.) after a
cell with a quit(); was sent but before the output came back, so I have
Emacs sleep for a second in that situation.  Not the best solution,
but it seems to work for now.

> One other oddity that pops up - When I use C-C C-K to kill a maxima
> process, it prompts me with a message asking for confirmation, but when
> I say y it tells me the process doesn't exist.  If I say no it
> apparently doesn't kill the process, so it is apparently listening to
> the prompt and I'm not sure what's up here.  Not a major issue, but I
> thought I'd ask.

Oops, I had previously added to the kill-buffer-hook for the Maxima
process buffer a kill-process command, but if the process was killed
before the buffer is, the hook tried to kill the process again.  I
fixed it now.

The changes are in maxima.el and emaxima.el in
ftp://vh213601.truman.edu/pub/Maxima

Jay