Live data from Hacker News

Emacs 26 Brings Generators and Threads

nullprogram.com

11–20 of 175 posts

Re: Emacs 26 Brings Generators and Threads

#11
post #2

Weird place to vent. But I find it so interesting that Emacs in all it's wisdom does not have (to me) acceptable undo behavior. Sometimes when I want to undo a bit, it undoes so much that I have to do a few seconds of copy-pasting.

The undo system is confusing if you are accustomed to undo/redo in practically every other piece of software, but it does make sense (in its own kind of way). See the documentation for the undo commmand[1]. Emacs undo is powerful albeit with more cognitive load to use.

I have occasionally had to take over the controls for new emacs users while pair programming because the undo, while logical and consistent, doesn’t work as it does in other software. Each consecutive sequence of undo commands, once interrupted by any command that is not an undo is considered itself to be an atomic undoable change. This means that there is no need for a redo command, just stop undoing and the last undo sequence can be undone. Because emacs has a large undo limit you can keep undoing even past sequences of undos back to the original edit points of the file’s history.

That probably made no sense if you haven’t already mastered it, but another way to think of it is that edits and undos produce a branching tree of all the history of changes being made to the file. The entire tree of changes can be navigated with one command (undo) because that command makes a traversal of the tree, kind of like a post-order tree traversal. This is sufficiently confusing in practice that seeing the nanigation through the tree via the popular undo-tree emacs package helps a lot. I use the undo-tree command when I want to get to a version of the file not on the current main line of edits.

[1] https://www.gnu.org/software/emacs/manual/html_node/emacs/Un...

Re: Emacs 26 Brings Generators and Threads

#12
post #2

Weird place to vent. But I find it so interesting that Emacs in all it's wisdom does not have (to me) acceptable undo behavior. Sometimes when I want to undo a bit, it undoes so much that I have to do a few seconds of copy-pasting.

That's odd, I find the default undo to be perfect. Never had a problem with it. What do you mean by "undo a bit"? A bit of typing? For that I use M-backspace, not undo. Undo is for reverting commands really. Like kill line, oops, undo.

Re: Emacs 26 Brings Generators and Threads

#17

Anyone know when the Windows builds will be available for download?

I got it from here: http://alpha.gnu.org/gnu/emacs/pretest/windows/

It works flawlessly. I just dropped it (26.1) in on top of my existing setup and had to do nothing else and I'm working away on it right now.

When I was downloading at least, I had to download it and the dependencies separately. The README says there should be a unified zip-file but it wasn't there at the time.

Had some issues with Windows 10 refusing to merge the directories from the deps package so had to drop to a cygwin shell but it actually worked quite well even without the deps.

Re: Emacs 26 Brings Generators and Threads

#18
post #2

Weird place to vent. But I find it so interesting that Emacs in all it's wisdom does not have (to me) acceptable undo behavior. Sometimes when I want to undo a bit, it undoes so much that I have to do a few seconds of copy-pasting.

My gripe is that I only just discovered the other day it chokes on large files, and even the vlfi (very large files) extension is quite cumbersome. I was quite dismayed to tell you the truth!

Re: Emacs 26 Brings Generators and Threads

#19
post #2

Weird place to vent. But I find it so interesting that Emacs in all it's wisdom does not have (to me) acceptable undo behavior. Sometimes when I want to undo a bit, it undoes so much that I have to do a few seconds of copy-pasting.

I too find the undo behavior quite confusing. I don't know the implementation, but I guess it is because by default instead of unwinding the stack of operations it does something like doing the opposite action. This means that sometimes you may redo an operation by mistake: for example - Paste 5 time the same line - Press undo 3 times: removes 3 lines - Move the cursor by one character - Press undo 2 times: instead o…

Basically "Undos" become actions that you can later "Undo". It's very weird. I accept that it means you never loose a change but it does feel a bit like boiling the ocean to produce some salt ... that said, it's an "alternative approach" that does have its merits. I like that about emacs, it challenges your assumptions and makes you think! As much concept art as a tool in itself.

Re: Emacs 26 Brings Generators and Threads

#20
post #2

Weird place to vent. But I find it so interesting that Emacs in all it's wisdom does not have (to me) acceptable undo behavior. Sometimes when I want to undo a bit, it undoes so much that I have to do a few seconds of copy-pasting.

I can understand being confused by emacs' undo but I don't understand what copy-pasting has to do with it. If you undo too much then you can effectively "re-do" by stopping your undo sequence (simply moving the cursor around for instance) and then undo your undoing?

A big advantage of emacs' tree-like undo is that you never lose any part of your history unlike a naive linear undo sequence. Like in this Firefox edit box for instance, if I type a word, undo it then type an other word I can't go back to the state I was in before I undid the first word. With Emacs I can usually restore any previous state my buffer was in (within the limits of the size of the undo buffer that is).

Post reply on HN