Subject: bug#72870: [PATCH] Flow fill texts after the last hard newline

From: Pengji Zhang <[email-masked]>
Date: Mon, 09 Sep 2024 12:04:02 +0800

Pengji Zhang <[email-masked]> writes:

> Eli Zaretskii <[email-masked]> writes: 
> 
>> AFAICT, this function exists for the special case of decoding 
>> email messages. Can email messages have flowed-encoded text 
>> without a hard newline at the end?  
> 
> I think you meant "encoding"? Anyway, if I understand it 
> correctly, an email message should always end with a newline, 
> but  it is not necessarily a hard newline. For example, 
> 'message.el'  inserts a normal newline: 
> 
>   https://git.savannah.gnu.org/cgit/emacs.git/tree/lisp/gnus/message.el#n4944 

I just realized this insertion of newline happens after encoding, 
so this is irrelevant here. Sorry.

It seems that during encoding, no such a newline is added at all. 
To reproduce:

  - Run 'emacs -Q'
  - C-x m C-c C-b
  - M-x use-hard-newlines RET n
  - C-x f 10 RET
  - Eval: (dotimes (i 10) (insert "word "))
  - RET RET
  - Eval: (dotimes (i 10) (insert "word "))
  - M-q
  - C-u M-x mml-preview RET

In the preview buffer, the first paragraph is filled but the 
second is not.