You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! @ryanprior recently e-mailed me about this amazing repository. While my original CVS repository of this thing is probably gone for good (and with that the TODO file that I once had), I spent a while trying to remember what "original" issues still might persist.
The only relevant one is that ed-cmd-undo doesn't work like in other implementantions of ed. This is mentioned in the docstring, but to clarify, here's one example I managed to think of:
In standard ed I can do this:
i
this is the first line
.
a
this is the second line
this is the third line
.
1,$p
this is the first line
this is the second line
this is the third line
u
1,$p
this is the first line
So the undo reverts the changes made to the buffer by the previous command. However, in ed-mode.el this happens:
i
this is the first line
.
a
this is the second line
this is the third line
.
1,$p
this is the first line
this is the second line
this is the third line
u
1,$p
this is the first line
this is the second line
So calling the Emacs undo doesn't revert everything that was appended by the second command but just the last line - which, now that I think about it, is quite logical since we are just doing line-by-line inserts into the buffer.
I'm not 100 % sure if this is just an issue with input mode commands (i, a and c) - but if that is the case, the fix might be a lot easier than what I thought 14 years ago: just build an intermediate buffer string while doing input mode, then insert it all in one go when . is used to exit. If everything gets inserted in one go, then I think undo should also work properly.
If someone can think of other cases than i / a / c where undo messes up, then we might need to think of something more elaborate 😄
Other than this, I just had some commands missing, and it looks like @echosa already has a pull request for adding placeholders. Nice!
The text was updated successfully, but these errors were encountered:
@AnttiNykanen Awesome! Cool to have you chiming in. :-) Hopefully my PR gets merged in. We discussed if this should be the "official" repo for the project. I'm ok with that, but with you being the original author, you should weigh in, I think.
@echosa yeah, as I wrote to @ryanprior, I'm totally fine with this being the official repository from now on, and have no qualms about "giving up" "maintainership" (not that much to give up). Guess I might hang around, who knows. At least today this has made my day :-)
Hello! @ryanprior recently e-mailed me about this amazing repository. While my original CVS repository of this thing is probably gone for good (and with that the TODO file that I once had), I spent a while trying to remember what "original" issues still might persist.
The only relevant one is that
ed-cmd-undo
doesn't work like in other implementantions of ed. This is mentioned in the docstring, but to clarify, here's one example I managed to think of:In standard ed I can do this:
So the undo reverts the changes made to the buffer by the previous command. However, in ed-mode.el this happens:
So calling the Emacs
undo
doesn't revert everything that was appended by the second command but just the last line - which, now that I think about it, is quite logical since we are just doing line-by-line inserts into the buffer.I'm not 100 % sure if this is just an issue with input mode commands (i, a and c) - but if that is the case, the fix might be a lot easier than what I thought 14 years ago: just build an intermediate buffer string while doing input mode, then insert it all in one go when
.
is used to exit. If everything gets inserted in one go, then I thinkundo
should also work properly.If someone can think of other cases than i / a / c where undo messes up, then we might need to think of something more elaborate 😄
Other than this, I just had some commands missing, and it looks like @echosa already has a pull request for adding placeholders. Nice!
The text was updated successfully, but these errors were encountered: