Loading ...
Sorry, an error occurred while loading the content.

Re: vim, format=flowed and hanging indents

Expand Messages
  • Tim Gray
    ... I can t necessarily answer all of your questions. As I saw it, this email did NOT have format=flowed set in the headers. It displayed fine in mutt, but
    Message 1 of 4 , Apr 30, 2013
    • 0 Attachment
      On Apr 30, 2013 at 04:53 AM -0700, Michael Williams wrote:
      >vim adds a trailing space to each line except the last, per set fo+=w.
      >It also adds spaces for the hanging indent. It looks great!

      I can't necessarily answer all of your questions. As I saw it, this
      email did NOT have format=flowed set in the headers. It displayed fine
      in mutt, but not on my iphone. (I can't be bothered to fire up Mail.app.
      Sorry.)

      >In case my/your news client screws this up, all the lines have been
      >correctly joined back together and the text reflows as expected when
      >you resize the window. Fine. But there are 5 spaces between "Etiam" and
      >"posuere" at all the other joins.

      The 'reflowed' paragraph did have too many spaces over here.

      >Is there a fix for this in vim? Or is this a limitation of the
      >format=flowed spec? If so, how do other people handle this?

      Yes, there is a way to fix it. Mailing your sample paragraphs to myself
      caused the same thing to happen. But, it's supposed to as I understand
      f=f. Here's why. I think the spec states that if you have a line that
      ends with space, the reader should reformat it. If your formatting is
      important, then don't put a space at the end of those lines. Since your
      numbered list has formating that you want to keep, remove the spaces
      from the end of those lines.

      So, you need to either remove those spaces with a quick search and
      replace (or a macro) or set 'fo-=w' and reformat those lines. Note
      however that when you do this, programs which can't display the full
      width of your fixed formatted paragraphs are going to mangle the
      display. I know my phone just did. (Presumably Mail.app gets this
      right since it displays more than 80 columns).

      What I can't answer for you is why, when you do that, mutt seems to
      delete a space at the beginning of the indented lines.

      My ultimate advice is to skip fancy formatting like that in email, and
      just go with f=f. So, maybe set 'fo-=n'. (Also, check out the j
      option. Nice for reformatting quoted text.)

      --
      --
      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@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Gary Johnson
      ... No. ... The Format=Flowed spec, RFC 3676, does not provide for indentation except for the first line of a paragraph. All lines are considered to start at
      Message 2 of 4 , Apr 30, 2013
      • 0 Attachment
        On 2013-04-30, Michael Williams wrote:
        > Is there a good way to configure vim to send format=flowed emails
        > that include hanging indents.

        No.

        > My complete vimrc (for testing purposes) is:
        >
        > set nocompatible
        > set fo+=awn
        > set tw=72
        > set ai
        >
        > I'm typing something like:
        >
        > 1. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam
        > posuere dui lorem, et condimentum nulla. Sed pharetra justo nec ante
        > fringilla non mattis nisi blandit. Donec molestie ligula dolor.
        > Nulla facilisi. Aliquam vel nulla elit, mollis facilisis metus. Sed
        > id eros a ante blandit convallis id sit amet elit. Duis malesuada
        > lobortis leo a placerat. Sed ut ipsum nisl. Sed pretium mauris vitae
        > velit sollicitudin iaculis.
        >
        > vim adds a trailing space to each line except the last, per set
        > fo+=w. It also adds spaces for the hanging indent. It looks great!
        >
        > My mail client sets the format=flowed header. The result when this
        > email is viewed in either Mail.app or mutt is not pretty:
        >
        > 1. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam posuere dui lorem, et condimentum nulla. Sed pharetra justo nec ante fringilla non mattis nisi blandit. Donec molestie ligula dolor. Nulla facilisi. Aliquam vel nulla elit, mollis facilisis metus. Sed id eros a ante blandit convallis id sit amet elit. Duis malesuada lobortis leo a placerat. Sed ut ipsum nisl. Sed pretium mauris vitae velit sollicitudin iaculis.
        >
        > In case my/your news client screws this up, all the lines have
        > been correctly joined back together and the text reflows as
        > expected when you resize the window. Fine. But there are 5 spaces
        > between "Etiam" and "posuere" at all the other joins.
        >
        > Is there a fix for this in vim? Or is this a limitation of the
        > format=flowed spec? If so, how do other people handle this?

        The Format=Flowed spec, RFC 3676, does not provide for indentation
        except for the first line of a paragraph. All lines are considered
        to start at the left margin and are wrapped to the left margin. See
        section 3.1.

        Your example paragraph is being flowed correctly according to the
        RFC.

        I handle it by not using format=flowed.

        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@....
        For more options, visit https://groups.google.com/groups/opt_out.
      • Michael Williams
        ... Sorry, I should have been clear. I m posting here using the Google Groups web interface. ... Thanks very much for the explanation. The fo-=w solution is
        Message 3 of 4 , Apr 30, 2013
        • 0 Attachment
          On Tuesday, April 30, 2013 4:03:50 PM UTC+2, Tim Gray wrote:
          > I can't necessarily answer all of your questions. As I saw it, this
          > email did NOT have format=flowed set in the headers.

          Sorry, I should have been clear. I'm posting here using the Google Groups web interface.

          > Yes, there is a way to fix it. Mailing your sample paragraphs to myself
          > caused the same thing to happen. But, it's supposed to as I understand
          > f=f. Here's why. I think the spec states that if you have a line that
          > ends with space, the reader should reformat it. If your formatting is
          > important, then don't put a space at the end of those lines. Since your
          > numbered list has formating that you want to keep, remove the spaces
          > from the end of those lines.
          >
          > So, you need to either remove those spaces with a quick search and
          > replace (or a macro) or set 'fo-=w' and reformat those lines.

          Thanks very much for the explanation. The fo-=w solution is not ideal, but "absolutely necessary to do fancy formatting in an email likely to be read on a phone" is enough of an edge case that I can live with it!

          > My ultimate advice is to skip fancy formatting like that in email, and
          > just go with f=f. So, maybe set 'fo-=n'. (Also, check out the j
          > option. Nice for reformatting quoted text.)

          fo-=n is what I'm going with. Thanks.

          --
          --
          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@....
          For more options, visit https://groups.google.com/groups/opt_out.
        Your message has been successfully submitted and would be delivered to recipients shortly.