Macaulay2 / M2-emacs

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

M2-send-to-program in M2-comint-mode #19

Closed mahrud closed 6 months ago

mahrud commented 3 years ago

@eisenbud mentioned that it would be great if F11 didn't duplicate the text entered in an interactive window.

Note that if the cursor is at the end of the partial text, then it's fine:

i74 : 2+2█ <F11>

o74 = 4

However, if the cursor is earlier on the line (not necessarily the beginning), the line is duplicated:

i74 : █2+2 <F11>

result:

i79 : 2+22+2

o79 = 26

Perhaps check if the cursor is on the last line of the buffer, and in that case don't duplicate? Or perhaps duplicate only if there's a newline at the end of the line?

d-torrance commented 7 months ago

Using Return instead of F11, we don't see this behavior. Would it make sense to just bind F11 to M2-send-input (the same as Return) in M2-comint-mode and make M2-send-to-program M2-mode-only?