Macaulay2 / M2-emacs

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

Deprecate M2-send-input in favor of comint-send-input #53

Closed d-torrance closed 8 months ago

d-torrance commented 9 months ago

The only difference is that we were forcing comint-use-prompt-regexp to be t, but sending code to Macaulay2 works just fine whether it's t or nil. The value determines whether we send just a single line or the entire input field to the M2 process when scrolling up to previous inputs and pressing Return. Let's let the user choose the desired behavior by setting comint-use-prompt-regexp to t if they choose. (It defaults to nil globally).

Here's an example. Suppose we enter the following (using C-j for the newlines), and then call comint-send-input:

i1 : 1
2
3

o1 = 1

i2 : 
o2 = 2

i3 : 
o3 = 3

Now suppose we scroll up to the very first line with comint-use-regexp set to nil and call comint-send-input. We get all three lines:

i4 : 1
2
3

o4 = 1

i5 : 
o5 = 2

i6 : 
o6 = 3

Now suppose we do it again, but after setting comint-use-regexp to t. We just get the first line:

i7 : 1

o7 = 1

i8 : 

Here's the commit where it was originally set to t: https://github.com/Macaulay2/M2-emacs/commit/6449756793c575f2e26f3cb43e21663f4e969b8e What was the problem this was trying to solve?