Reputation: 2433
I want to write some lisp code for a clickable link in org-mode in Emacs. While writing the code, I like it to be properly indented and on multiple lines, but in the link it must be dense, and one single line. It would be nice to switch between these representations with M-x commands.
For example, I need this form of lisp for the link:
(progn (when t (do this)(then this)(finally this)))
but while editing I like it this way
(progn
(when t
(do this)
(then this)
(finally this)))
I can see how to go from the second to first, just by removing line endings, but not an easy way to go back. Any ideas?
Upvotes: 2
Views: 73
Reputation: 20342
lispy can do this:
Note that there's no single best way to decide where to put the line breaks with M,
so a simple rule was used instead, with a small correction for let
bindings.
Here's the gif:
.
Upvotes: 1