5

As simple as that. Everytime I export from orgmode to text the lines are wrapped. How to disable this?

Thank you,

E.

  • 2
    You may try exporting via ox-pandoc to plain text. Pandoc includes an --wrap=none command line option. – Juancho Aug 17 '17 at 20:00
2

Org-mode provides the customization variable org-ascii-text-width. If you set this to a large enough value, it has the effect of not wrapping text blocks during export to plain text.

However, doing this also does weird things to text that the exporter tries to present as centered titles and subtitles. That applies to the contents of #+TITLE: and #+AUTHOR: lines, and probably other similar options. You can turn these off via the customization variables org-export-with-title and org-export-with-author. I don't see any obvious way of modifying the title formatting in a way that wouldn't get mangled by long lines.

0

Once in a while, I'm drafting e-mails in an orgmode buffer. I'd like to export the plain text, but without wrapped lines. Usually I forget to disable auto-fill-mode while writing.

So after finishing the text, I copy it into scratch, mark it and then: M-x replace-string Ctrl-q Ctrl-j Ctrl-q Ctrl-j RET XXXX RET. Result: Every new paragraph is replaced by XXXX.

Next step: M-x replace-string Ctrl-q Ctrl-j RET <space> RET : I'm replacing the single newlines with a singel space.

Next step: M-x replace-string XXX RET Ctrl-q Ctrl-j RET : I'm replacing the XXXX against the former new paragraphs.

Ready for copy and paste.


Edit:

After OP made a comment about the #+OPTIONS:, I found that you can write #+OPTIONS: \n:nil into the preamble of the org file, which is supposed to toggle whether to preserve line breaks (`org-export-preserve-breaks').

Then -- thanks to Tyler -- I customized org-ascii-text-width. Set it to 10000 and you don't get a line break. But unfortunately the exporter assumes the pagewidth were that large and pushes the sections and the title _far_far_ away.

  • Exporting to text seems to impose hard wrapping, even if the source is not filled to begin with – Tyler Aug 17 '17 at 19:27
  • @Tyler Maybe, but I just copy and paste the »unwrapped« text. – Keks Dose Aug 17 '17 at 19:56
  • 1
    Actually, I found the answer: #+OPTIONS: :: (Toggle fixed-width sections ->>(org-export-with-fixed-width)) – Emmanuel Goldstein Aug 18 '17 at 10:02
  • @EmmanuelGoldstein Sounds good. What exactly is the text after #+OPTIONS? – Keks Dose Aug 18 '17 at 11:57
  • exactly two colons: ::, as I wrote above. – Emmanuel Goldstein Aug 19 '17 at 21:31
0

John Kitchin initially wrote a simple program to do this. He then improved it and made it into ox-clip a org-mode based Emacs package, which is easy to get through Melpa's repository. Not only does it avoid wrapping text, it also preserves the format on the clipboard so that it is a breeze to paste.

ox-clip may need you to install a clipboard manager depending on your system. Specific installation instructions can be found here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.