unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Stefan Monnier via Users list for the GNU Emacs text editor <help-gnu-emacs@gnu.org>
To: help-gnu-emacs@gnu.org
Subject: Re: Unexpected fill-paragraph behaviour in message-mode
Date: Wed, 15 Feb 2023 12:02:59 -0500	[thread overview]
Message-ID: <jwvmt5e6f4c.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: 87r0uu2wu3.fsf@rak.ac

> ---------------------------------
> From:
> To:
> Cc:
> Bcc:
> Subject: Weird fill-paragraph behaviour
> Reply-To:
>
> Emacs has weird wrapping behaviour in message mode. To reproduce,
> first (M-x message-mode).
>
> Filling this long line (M-q anywhere on it) joins it with the following
> indented text, which it should not because there is an empty line marking
> the end of this paragraph:

It looks like `message-mode` thinks you're still in the header part of
the message because of the lack of the separator that `message-mode`
uses (i.e. "--text follows this line--")

> Quickly skimming message.el, it looks like message-mode (only?) supports
> mail and news. In those cases, RFC 5322 §2.1 [0] and RFC 5536 §2 [1]
> give the following separator:

These RFCs document the format of messages when they leave the MUA, but
the format within the MUA (e.g. within a `message-mode` buffer) if up to
the MUA, of course.

> (re-search-forward
>        (concat "^" (regexp-quote mail-header-separator) "$")

For a more graceful degradation, `message-mode` should treat an empty
line as the header separator when the "--text follows this line--"
thingy is missing, indeed.  [ I wouldn't be surprised if `message-mode`
ends up generating incorrectly formatted messages if you include an
empty line the header.  ]

Patch welcome :-)


        Stefan




      parent reply	other threads:[~2023-02-15 17:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-13  1:11 Unexpected fill-paragraph behaviour in message-mode Ryan Kavanagh
2023-02-13 13:35 ` Eli Zaretskii
2023-02-13 14:41   ` Ryan Kavanagh
2023-02-13 15:20     ` Teemu Likonen
2023-02-13 15:21     ` Eli Zaretskii
2023-02-14 12:54       ` Ryan Kavanagh
2023-02-14 13:24         ` Jean Louis
2023-02-15  2:21           ` Emanuel Berg
2023-02-15 17:06           ` Stefan Monnier via Users list for the GNU Emacs text editor
2023-02-13 19:07     ` Jean Louis
2023-02-15 17:02 ` Stefan Monnier via Users list for the GNU Emacs text editor [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvmt5e6f4c.fsf-monnier+emacs@gnu.org \
    --to=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).