inserting files into Thunderbird without reformatting
Let’s start with the observation that the Linux kernel community discourages sending patches as attachments (tpp, section 1a). Sending patches as attachments creates pain for the sender, regardless of what you or I might think of this fact.
Thus, it’s a shame that Thunderbird doesn’t have a trivial mechanism to insert a file in to its plain text composing interface without altering the file. There are at least three stumbling blocks: translating tabs into spaces, trimming trailing whitespace, and wrapping lines.
One suggested hack to work around this is to use an external editor extension which lets you fire up, say, vim to insert the file into the editing buffer. This doesn’t work well in OS X, for much the same reasons that it doesn’t work well for eclipse.
After some trial and error I found Quicktext, an extension for inserting signatures, which can be abused to insert files. After installing the extension, one:
- sets the word wrapping preference to 0 before composing the new message
- inserts the file as HTML, to preserve trailing whitespace
- restores the previous word wrapping preference
This is violently imperfect. Inserting as HTML to preserve whitespace runs the risk of escaping HTML which might be in the file. I do this so infrequently that it’ll do for now. I usually send patches with tools. (git-send-email, hg email, sendpatchset).
I was reasonably excited to find that it seems like someone who understands Mozilla extensions could build an extension to insert text without altering the input. nsIPlaintextEditor seems to have knobs to disable translation of whitespace and word wrapping. I might try my hand at this some day but would be even happier if someone beat me to it.
Anonymous wrote:
Ideally, I’d like Thunderbird to have something like Evolution’s ability to format plain text emails. In Evolution, you can mark text as preformatted, create bulleted or numbered lists, or set margins, all while remaining in plain text.
Posted on 31-Oct-07 at 12:31 pm | Permalink
Anonymous wrote:
You might find git-imap-send useful; drop mails directly in your drafts folder. Then you just need an MUA which won’t mangle drafts as soon as it opens them; that seems somewhat easier.
Also you can fix many whitespace issues in Thunderbird by disabling all support for format=flowed:
pref(”mailnews.send_plaintext_flowed”,false);
pref(”mailnews.display.disable_format_flowed_support”,true);
Posted on 31-Oct-07 at 12:33 pm | Permalink
Zach wrote:
> You might find git-imap-send useful; drop mails directly in your drafts folder.
Neat!
> Also you can fix many whitespace issues in Thunderbird by disabling all support for format=flowed:
Indeed, I should have mentioned that. It’s necessary, but not sufficient.
Posted on 31-Oct-07 at 12:51 pm | Permalink