I'd like to be able to quickly "shuffle" the order in which all paragraphs in a region occur. Can this be easily accomplished in emacs?
For example, consider the following region.
Hello world.
This is the original second paragraph
and it contains two lines.
This is the original third paragraph and
it contains three
lines
Paragraph number four.
Running my desired command would result in a random reordering of these four paragraphs. The output might be something like
This is the original third paragraph and
it contains three
lines
Hello world.
Paragraph number four.
This is the original second paragraph
and it contains two lines.
randomize-region.el
?: mail-archive.com/[email protected]/msg00034.html which is the accepted answer from this related thread: stackoverflow.com/questions/6172054/…randomize-region.el
is related, but doesn't solve the problem.randomize-region
permutes all of the lines and doesn't respect paragraphs. I'm sure the code can be altered, but I'm not savvy enough to see how.(insert (concat str "\n"))))))
to(insert (concat str "\n\n"))))))
.