It turns out that there are several hits for things like this. Those on the
list who actually know elisp can perhaps decide which is the most robust
implementation. Here's some more (did not try these... just digging them up
and providing links):

- http://blog.chrislowis.co.uk/2010/03/03/unfill-region-emacs.html
- http://xahlee.org/emacs/emacs_unfill-paragraph.html
- http://nolan.eakins.net/node/208

There was also a reference in the original post below to longlines-mode
which (from my quick skim) seems to do what fill mode does but with "soft"
returns; it only appears to be filled but in reality is not altering actual
file line breaks. I tried this and can verify that when I save from
longlines mode it is not inserting actual line breaks (if I use "cat
file.org" there are no line breaks) whereas with fill the line breaks are
definitely inserted into the file... however it seems that org exports to
html how the file appears in the buffer, not what's in the file. I did want
to toss it out there in case someone knows how to integrate it somehow.

- http://www.gnu.org/software/emacs/manual/html_node/emacs/Longlines.html


Best regards,
John

<http://blog.chrislowis.co.uk/2010/03/03/unfill-region-emacs.html>

On Tue, Nov 16, 2010 at 10:34 PM, John Hendy <jw.he...@gmail.com> wrote:

>
> Before hitting send I decided to look around and see what I found. Check
> this out!! [1]
>
> ,-----
> | (defun unfill-region (begin end)
> | "Remove all linebreaks in a region but leave paragraphs, indented text
> | (quotes, code) and lines starting with an asterisk (lists) intact"
> | (interactive "r")
> | (replace-regexp "\\([^\n]\\)\n\\([^ *\n]\\)" "\\1 \\2" nil begin end))
> `-----
>
> I tried it out and it worked great (added to .emacs, reloaded, and used M-x
> unfill-region RET). I tried it with two headings each with multiple lines of
> text under them and unfilled the whole buffer. It leaves the headers on
> their own lines and turns each paragraph into a long line of text that
> exported perfectly to a run-on html blob with C-u C-c C-e R.
>
> Would that work?
>
> [1] http://blog.bookworm.at/2007/08/emacs-unfill-region.html
>
>
> John
>
_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to