Macaulay2 / M2-emacs

Macaulay2 emacs files
GNU General Public License v3.0
5 stars 3 forks source link

Simplify M2-send-to-program #54

Closed d-torrance closed 6 months ago

d-torrance commented 7 months ago

I'm proposing that in M2-comint-mode, F11 and Return should do the same thing (call comint-send-input, pending #53).

And in particular, M2-send-to-program (the F11 function) should only be called from M2-mode. So we can strip out all the code from M2--send-to-program-helper that deals with what to do when it's being called from the same buffer we're inserting commands into. This fixes #19.

We also improve some docstrings, add an error message if the M2 process isn't up and running, and also refactor the buffer/window code a bit.


One thing I thought about dealing with but haven't yet. Suppose we have the following in our M2-comint-mode buffer:

i1 : 1

And suppose we send 2 to this buffer with F11. What should happen? The current behavior:

i1 : 12

o1 = 12

Or, should it behave like some other major modes (like ESS), and save the 1 for later? So:

i1: 2

o1 = 2

i2: 1