emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [BUG] Consider replacing bachload with batch in ob-maxima. [9.6.6 (r


From: Leo Butler
Subject: Re: [BUG] Consider replacing bachload with batch in ob-maxima. [9.6.6 (release_9.6.6 @ /usr/share/emacs/30.0.50/lisp/org/)]
Date: Sat, 2 Sep 2023 18:12:37 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

On Sat, Sep 02 2023, Ihor Radchenko <yantar92@posteo.net> wrote:

> Leo Butler <Leo.Butler@umanitoba.ca> writes:
>
>> I think that your request may be handled by one of two improvements:
>>
>> 1. Implement session support in ob-maxima.el; and
>> 2. Many of the design decisions in the existing ob-maxima code should be
>> customizable.
>
>> I am attaching a patch to address 2. Please try it out, I think that it
>> will satisfy your requests. Feedback is welcome.
>
> Thanks for the patch!
>
>> +(defcustom org-babel-maxima-command-arguments
>> +  "--very-quiet"
>
>> +(defcustom org-babel-maxima-batch/load
>> +  "batchload"
>> +
>> +(defcustom org-babel-maxima-graphic-file-format-string
>> +  "(set_plot_option ('[gnuplot_term, png]), set_plot_option 
>> ('[gnuplot_out_file, %S]))$"
>> +
>> +(defcustom org-babel-maxima-default-epilogue
>> +  "gnuplot_close ()$"
>
> This might be fine, but may you please explain what would be the purpose
> of customizing each of these options?

I am not sure of your request: do you want me to elaborate in the
docstrings? Or here?

>
> IMHO, in their current state, if a user mindlessly customizes these
> options without knowing how ob-maxima internals work, ob-maxima may
> simply be broken.

I think there is a fine line between being too rigid but working within
a limited scope (as ob-maxima is now), or providing enough customizable
options to let users do what they want. I would prefer the latter,
if the defaults provide a working configuration.

Note that I do attempt to suggest other working options in the defcustom
definitions.

> It is also not very clear what would be the benefit
> customizing any of the proposed options.

I had planned to update the worg documentation with some examples, but
here is one that answers the OP's original question:

>> +(defcustom org-babel-maxima-command-arguments
>> +  "--very-quiet"

This is the current setting.

It can be useful to include the build information that Maxima provides
on start-up, which would mean setting this to "".

>
>> +(defcustom org-babel-maxima-batch/load
>> +  "batchload"

This is the current setting.

Another option suggested is "batch". That is what the OP originally
requested.

>> +
>> +(defcustom org-babel-maxima-graphic-file-format-string
>> +  "(set_plot_option ('[gnuplot_term, png]), set_plot_option 
>> ('[gnuplot_out_file, %S]))$"

This is the current setting.

An alternative is to use the `draw' package, which is a suggested
option. Draw, in my opinion, is a much better package for plotting.

>> +
>> +(defcustom org-babel-maxima-default-epilogue
>> +  "gnuplot_close ()$"

This is the current setting.

The current setting is not needed in recent versions of Maxima (since
roughly 2010, I believe), except possibly on Windows. And, it is only
needed if `:results graphics file' is included as a src header.

On the other hand, the OP had requested adding

"quit() $"

to this setting. I don't think that is needed, but Maxima is built with
more than 6 different common-lisp implementations so there can be lots
of variability in how common tasks are performed...

>
> As a general rule, we do not expose internal details that are _required_
> for things to work to users.

I understand this principle, but, why not provide enough options for
users to configure a package to do what they want? Yes, that may mean
they break the package--but only temporarily, because returning to the
default options will return the package to a working state.

> In the above, `org-babel-maxima-default-epilogue' appears to be paired
> with `org-babel-maxima-graphic-file-format-string' and may need to be
> changed depending on its value.

No, they are not closely connected. Both plot and draw use gnuplot as
the graphing backend (although draw might be able to use vtk, that
capability has not been maintained...).

> Also, I am not sure if removing --very-quiet may
> not affect :results output.

Yes, it will. But that is what the OP is asking for.

----

I think that the original intention of ob-maxima was to provide a simple
`calculator'-like interface to Maxima. In many cases, though, one wants
to show a sequence of calculations that lead to the final answer. That
is why being able to configure some of these hard-coded settings is
desirable: to be able to modify how the input and output are presented.

Best regards,
Leo


reply via email to

[Prev in Thread] Current Thread [Next in Thread]