how to make maxima-mode start imaxima



Leo Butler <l_butler at users.sourceforge.net> writes:

> Tamas Papp <tkpapp at gmail.com> writes:
>
>> On Sat, 31 Mar 2012 14:06:01 +0000, Leo Butler wrote:
>>
>>> No worries. Try this:
>>> 
>>> (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) (unless (get-buffer
>>>   maxima-buffer-name)
>>>     (with-temp-buffer (imaxima))))
>>> (ad-activate 'maxima-send-region)
>>
>> It works with the following modification:
>>
>> (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)
>>   (unless (get-buffer "*maxima*")
>>     (with-temp-buffer (imaxima))))
>> (ad-activate 'maxima-send-region)
>>
>> The variable maxima-buffer-name is not defined in the version I am
>> using.
>
> Ahh, sorry, that is a personal customisation.
>
>>
>> Is there a way to show the (i)maxima window automatically when it
>> starts?
>
> You can add the following after advice:
>
> (defadvice maxima-send-region (after show-maxima-buffer last)
>   "Show the *maxima* buffer after sending input."
>   (ignore-errors (set-window-buffer 1 "*maxima*")))
>
> In my configuration, this will split the window to show the *maxima*
> buffer, but the active buffer remains the source buffer.

After looking into this, I see maxima-send-region calls
maxima-display-buffer at the end, so you should not need to add this
advice.

-- 
Leo Butler                <l_butler at users.sourceforge.net>
SDF Public Access UNIX System -   http://sdf.lonestar.org