Has anyone ever attempted to solve "wrapped lisp code" minor annoyance? i.e., when you have too narrow of a window splits and the code wraps around, I would like it to wrap "within the same indent space", not from the beginning of line. So the code that normally looks like this: https://i.imgur.com/QfOE5Dy.png with a narrower window becomes: https://i.imgur.com/KNF8dKQ.png This isn't huge deal, with experience you can even learn how to quickly mentally parse it, yet the code appears "jumbled". If only I could force it to be indented, while wrapped, something like this: https://i.imgur.com/5004tFq.png Of course then, there's a problem with strings, but in general, is there a mechanism in Emacs that would make it possible? To make things appear in a nicer way, without actually affecting the code indentation in the file?
Thanks @l0st3d, this thread has improved my life in a non-negligible way
Iβve always been one of those 80-character guys in Emacs, since I often work in a horizontal split view on my laptop and hate to see wrapped lines or having the window scroll horizontally when I donβt wrap. But with Lisp it can often be annoying with deeply nested code where I manually tweak the aesthetics for way too long. Maybe knowing about adaptive wrap mode, I will finally try switching to auto-format on save and invest those saved minutes into hammock time. π
I've hacked together something for multiline strings before: https://github.com/yuhan0/multilign which could probably be adapted to work with wrap-prefixes outside of strings
does https://elpa.gnu.org/packages/adaptive-wrap.html do what you want?
Hmm, interesting. Will give it a try. Thanks @l0st3d
it looks like a version of this is now bundled with emacs 30 (if you've already upgraded π ) https://www.emacswiki.org/emacs/AdaptiveWrap
Holy mother of Turing, this is exactly what I needed. Thanks a lot!