Monday, October 7, 2019

Re: format=flowed and extra spaces

On 2019-10-08, martin f krafft wrote:
> Thanks, Gary, for your response. It made me realise something, namely
> that Mutt itself seems broken wrt format=flowed. I'll turn to the
> mutt-users list for that.
>
> However, I did have one comment relating to Vim:
>
> >Neither Vim nor mutt should do anything to messages to corrupt
> >their contents. In particular, neither should automatically remove
> >any leading spaces. See RFC 3676.
>
> I am 100% with you on that. However, with Vim being the composer of a
> message, I'd argue that there is no corruption of contents going on,
> if it differentiates between displaying spaces, and saving them to
> the file:
>
> Let me elaborate, using · for spaces and $ for EOL:
>
> Take the following paragraph.
>
> | 1. This is a multiline |
> | indented paragraph |
>
> If &formatoptions doesn't include "aw", then we need those leading
> spaces explicitly, because the indenting is done in such a way as to
> hard-code it into the file. Therefore, Vim should save:
>
> | 1. This is … a multiline$ |
> | ···indented paragraph.$ |
>
> However, if &fo=aw as well as &fo=n is in place, and there is a
> trailing space on the first line, then I would say Vim should really
> not be saving those spaces. Instead, the buffer should really be
>
> | 1. This is … a multiline$ |
> | indented paragraph.$ |
>
> But this then gets displayed as in the original example, i.e. Vim
> displays leading spaces, recognizing the numbered list.
>
> Or at least this should/could be configurable. Don't you agree?

I'm still thinking about this. You're asking for Vim to format its
display of a buffer according the formatting rules of
'formatoptions' without changing the actual contents of the buffer.
My first thought was, "Vim is an editor, not a word processor, and
it doesn't do that sort of formatting for display." But there are
exceptions. For example, I use 'linebreak', 'breakindent' and
conceal to make some text less cluttered more understandable.

However, as I wrote before, format=flowed is intended to help make
email text readable in mail readers that don't support it as well as
in those that do. So, in an email message sent to a general
audience, I would format it to look good in a mail reader that did
not understand format=flowed, then add the trailing spaces and the
Format=Flowed header to help a format=flowed-aware reader reflow the
text as necessary for its display.

So, if my message included a list item like this,

1. This is the first line
and this the second.

I would leave it like that for the benefit of
non-format=flowed-aware email readers, but add a trailing space to
the first line to show format=flowed-aware readers that the two
lines may be flowed together. I think it's up to the
format=flowed-aware reader to recognize that the leading spaces of
the second line are for indentation and should be collapsed to one
space, and that the leading "1. " indicates a list item and that
that line should be wrapped and indented according to its rules for
formatting list items.

> >If some receiving agent claims to support format=flowed, yet
> >blindly includes sequences of spaces in the middle of flowed lines,
> >as in your third example, I would say that agent is broken.
>
> Oh great. Yeah, I'll let the GMail admins know at noreply@gmail.com.

Yep, that's a problem.

> >Also, your second example suggests that mutt is using
> >quoted-printable encoding. RFC 3676 says that quoted-printable
> >encoding "SHOULD NOT be used for Format=Flowed unless absolutely
> >necessary...."
>
> Unfortunately, PGP/MIME needs quoted-printable (mutt's
> pgp_strict_enc), and so one could argue it is "absolutely necessary".
>
> I don't quite understand the ramifications of this though.

I don't either.

Regards,
Gary

--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20191008051043.GB18733%40phoenix.

No comments: