Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Another cool thing about undo in Emacs is that it's context aware.

By default, you can select any block of text and the undo command will cycle through the changes only from that region of your buffer.



whoa this is cool

does it understand syntax boundaries like curly braces / functions? ('undo within function' would be key). or just line #?


That concern is isolated to your region selection tool, and orthogonal to the undo functionality :-) So, you could select by lines, or intelligently select by parentheses/braces, etc. And ask these are nicely composable, so you could easily set up custom shortcuts if you don’t like the sequence of keystrokes.

For eg, see https://www.johndcook.com/blog/2017/08/09/selecting-things-i...


Regions in emacs do not need to consist of whole lines.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: