Macaulay2 / M2-emacs

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

M2-send-to-program updates #38

Closed d-torrance closed 1 year ago

d-torrance commented 1 year ago

Inspired by various other major modes that interact with REPL's (primarily ESS), we add several variations on M2-send-to-program. In addition to sending the line and region, we can also send the paragraph, buffer, the buffer up to the point, or the buffer after the point to Macaulay2. Keybindings and menu entries have been added for each of these. (They keybindings are consistent with ESS's.)

Also, a "blink" feature, which highlights the code that is being sent to the M2 buffer, has been added. Users can control whether this feature is turned on by setting M2-blink-region-flag. The current behavior (no blinking) is the default.

Here's a screencast demo:

Peek 2023-02-10 20-25

One change in behavior has been made: M2-send-to-program no longer adds a newline character when it's reached the end of a buffer. It seemed out of place -- this family of functions should be for running code, not modifying it.