unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Ryan Kavanagh <rak@rak.ac>
To: help-gnu-emacs@gnu.org
Subject: Re: Unexpected fill-paragraph behaviour in message-mode
Date: Mon, 13 Feb 2023 09:41:13 -0500	[thread overview]
Message-ID: <20230213144113.igujfoal7ervxifu@asteria.rak.ac> (raw)
In-Reply-To: <83edqtg037.fsf@gnu.org>

On Mon, Feb 13, 2023 at 03:35:08PM +0200, Eli Zaretskii wrote:
> This problem doesn't happen if the buffer has the expected separator
> line saying "--text follows this line--".  Why are you trying to use
> message-mode in a buffer that is not formatted as an email message?

The line was missing because I use (neo)mutt as my email client and I
decided to try setting my editor to "emacsclient -c", but mutt does not
insert said separator. Is there an alternate mode I should be using when
compose emails with non-emacs MUAs?

> Without that separator, message-mode doesn't know where the headers
> end and the message body begins.

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:

    The body is simply a sequence of characters that follows the header
    section and is separated from the header section by an empty line
    (i.e., a line with nothing preceding the CRLF).

Looking at the source in message.el, it usually finds the separation
between header and body using:

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

It would be nice to be able to use emacs as an editor with non-emacs
MUAs, so I wonder if I shouldn't file a bug report asking message.el to
fallback on the RFC (and set mail-header-separator to "") in the cases
where "--text follows this line--" is missing.

Best wishes,
Ryan

[0] https://www.rfc-editor.org/rfc/rfc5322#section-2.1
[1] https://www.rfc-editor.org/rfc/rfc5536#section-2

-- 
|)|/  Ryan Kavanagh  | 4E46 9519 ED67 7734 268F
|\|\  https://rak.ac | BD95 8F7B F8FC 4A11 C97A



  reply	other threads:[~2023-02-13 14:41 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 [this message]
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

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=20230213144113.igujfoal7ervxifu@asteria.rak.ac \
    --to=rak@rak.ac \
    --cc=help-gnu-emacs@gnu.org \
    /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).