help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unexpected fill-paragraph behaviour in message-mode


From: Stefan Monnier
Subject: Re: Unexpected fill-paragraph behaviour in message-mode
Date: Wed, 15 Feb 2023 12:02:59 -0500
User-agent: Gnus/5.13 (Gnus v5.13)

> ---------------------------------
> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]