Live data from Hacker News

Emacs 26 Brings Generators and Threads

nullprogram.com

21–30 of 175 posts

Re: Emacs 26 Brings Generators and Threads

#21
Here's what grinds my gears: That the cursor follows the visible buffer. It would be nice to be able to scroll to another part of a file and then just start typing and be back where I was ...

I mean I could understand if this was an efficiency thing to do with scaling to large files due to a kind of a tiling memory model or something, but emacs doesn't even do that!

It's not a huge deal I've learned to get used to using Ctrl+U-Space to get back to where I was.

I read somewhere that somebody tried to implement what I'm talking about but never really got around to trying it cause it seems a little half-baked.

Re: Emacs 26 Brings Generators and Threads

#22
post #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 b…

[deleted]

Re: Emacs 26 Brings Generators and Threads

#23
post #21

Here's what grinds my gears: That the cursor follows the visible buffer. It would be nice to be able to scroll to another part of a file and then just start typing and be back where I was ... I mean I could understand if this was an efficiency thing to do with scaling to large files due to a kind of a tiling memory model or something, but emacs doesn't even do that! It's not a huge deal I've learned to get used to us…

Now I kind of want to try my hand at implementing this. I imagine an implementation would add a buffer-local variable holding the position of the point as of the last non-scrolling operation. This would be updated in post-command-hook, but only if the last command was not a scrolling command (which would probably have to be defined as a list of "blacklisted" commands that shouldn't change the point). This hook would also hide the cursor if the desired position of the point is off-screen and show it otherwise. Finally, a pre-command-hook would set the real point to the saved position unless the command about to be executed is a scrolling command or a mouse interaction (which should move the point to somewhere on-screen).

Re: Emacs 26 Brings Generators and Threads

#24
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.

try redo+:

https://www.emacswiki.org/emacs/redo+.el

Re: Emacs 26 Brings Generators and Threads

#25
Seeing generators and threads being mentioned in the release announcement of a text editor feels a bit... strange.

Then again, Emacs is closer to a LISP toolkit for building text editors than it is a text editor, so I guess it's not so strange after all.

Re: Emacs 26 Brings Generators and Threads

#26
post #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 refusin…

Flyspell in Emacs 26.1 seems to require a version of Aspell that is not officially available for Windows. I might need to put off the upgrade until I can attempt to compile a newer Aspell for Windows myself.

"Error enabling Flyspell mode: (aspell release 0.60 or greater is required)"

Re: Emacs 26 Brings Generators and Threads

#27
post #3
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.

You should try undo tree ( http://www.dr-qubit.org/undo-tree.html ), it's a must have extension which brings proper undo-redo and a tree visualisation of history with diffs and many other options.

I'll second the recommendation to use undo-tree. If your undo history is going to be tree-like, which it is in Emacs, then you might as well be able to visualize and manipulate that tree directly.

Re: Emacs 26 Brings Generators and Threads

#28
post #25

Seeing generators and threads being mentioned in the release announcement of a text editor feels a bit... strange. Then again, Emacs is closer to a LISP toolkit for building text editors than it is a text editor, so I guess it's not so strange after all.

Emacs is an OS written in Lisp, with a text editor as sample application. :)

Re: Emacs 26 Brings Generators and Threads

#29
post #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 w…

Thanks for the tip! Despite using emacs for decades, I never properly read the undo docs.

I'll try binding the undo keystroke to "undo-only", and a redo to normal undo definition, to see if I can get something approximating undo/redo semantics.

Re: Emacs 26 Brings Generators and Threads

#30
post #28
post #25

Seeing generators and threads being mentioned in the release announcement of a text editor feels a bit... strange. Then again, Emacs is closer to a LISP toolkit for building text editors than it is a text editor, so I guess it's not so strange after all.

Emacs is an OS written in Lisp, with a text editor as sample application. :)

Also if you require good keybindings in the sample application, there's always viper :)
Post reply on HN