[Kde-pim] Review Request 110975: Add X-KMailWordWrap flag to enable/disable wordwrap

Jan Kundrát jkt at flaska.net
Sun Jan 19 15:43:15 GMT 2014


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/110975/#review47702
-----------------------------------------------------------


So this patch is about adding yet another non-standard header which will make sure that one particular e-mail client is able to understand git's patches formatting. Looking further at git's format-patch documentation, it talks about the preference for sending patches inline as opposed to attachments. Let's see what "inline" actually means, though.

One possibility is that it might refer to a single MIME entity, i.e. a text/plain message where each patch is literalle "pasted" into the text. Doing that would be horrible, but I understand that some projects do want to support a random webmail interface which might be rather dumb to offer preview of "attachments".

The second option is "attaching" the patches as "inline attachments", i.e. using a separate MIME entity for each patch, with header "Content-Disposition: inline; filename=..." and "Content-Type: text/x-patch" or text/x-diff. This is a completely standard way of specifying "hey, dear MUA, please show the patch inline *and* allow the user to save it without much hassle at the same time". If a MUA sees a message like this, it has every information needed to know that the mail contains patches, that these patches shall be shown to the user without extra clicking *and* available for saving at the same time. The MUA can even use a reasonable renderer with such "attachments", i.e. something which colorizes the individual lines of the patch.

Turns out that this is *exactly* how `git format-patch --inline` works. And to clarify, this "inline" is about the attachment visibility, *not* about pasting the contents of patches directly into the main body of the mail.

So what I would recommend is making sure that KMail renders these e-mails directly, and if not, tweak the heuristic for word wrapping based on the Content-Type of the attachments, *not* about some random e-mail header.

Disclaimer: I'm not a KMail developer; I hack on a competing project which supports all of the above already (except the syntax highlighting, unfortunately).

- Jan Kundrát


On June 12, 2013, 2:30 p.m., Rüdiger Sonderfeld wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/110975/
> -----------------------------------------------------------
> 
> (Updated June 12, 2013, 2:30 p.m.)
> 
> 
> Review request for KDEPIM.
> 
> 
> Repository: kdepim
> 
> 
> Description
> -------
> 
> kmcomposewin.cpp - Add X-KMailWordWrap flag to enable/disable wordwrap
> 
> This flag is very useful in combination with git format-patch and
> imap-send.  Sending patches with enabled word wrap usually breaks the
> diff and makes it impossible to apply the patch.  By supporting a flag
> to disable word wrap based on the message, this can be automatically
> prevented by git format-patch.
> 
> With
> 
>   git config format.headers "X-KMail-WordWrap: false\n"
> 
> format-patch will thus automatically prevent KMail from word wrapping
> the message.
> 
> See also KMail section in "git help format-patch".
> 
> Signed-off-by: Rüdiger Sonderfeld <ruediger at c-plusplus.de>
> 
> 
> Diffs
> -----
> 
>   kmail/kmcomposewin.cpp 8584ebc 
> 
> Diff: https://git.reviewboard.kde.org/r/110975/diff/
> 
> 
> Testing
> -------
> 
> Tested it manually.
> 
> 
> Thanks,
> 
> Rüdiger Sonderfeld
> 
>

_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/


More information about the kde-pim mailing list