Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes part of #8447. In order to implement a kill ring, which is a stack of previously killed region of text, the concept of "region" is indeed needed: after a "yank" ("C-y"), one can replace the yanked text with an older entry in the kill-ring via "M-y" (so the REPL must remember the region consisting of the first yanked text). While I was at it, it's now possible to "set the mark" with "C-Space", to copy/kill the current region with "M-w/M-W", and to exchange the mark with the current position with "C-xC-x". As "M-y" is normally possible only after a yank, commands can now return a symbol which will be remembered till the next command (kind of similar to "key repeats", but with more information).
There are still probably few bugs, but if someone is willing to review, I would require attention particularly on the following: previously, the char
'\0'
was used as a sentinel to indicate "wildcard" ("*"), but this conflicts with the code sent by "C-Space". So I chose another sentinel value, but I know very littly about UTF8; For some characters I got errors, for others I didn't get a functional REPL (sentinel not recognized, so no printed letters when matching "*"). The chosen working sentinel value is in a "Private Use range" (I got it from the code fromrand(::Char)
).