]> granicus.if.org Git - neomutt/commit
Re-enable and cleanup format-flowed space stuffing
authorKevin McCarthy <kevin@8t8.us>
Sat, 31 Aug 2019 20:37:16 +0000 (13:37 -0700)
committerRichard Russon <rich@flatcap.org>
Tue, 8 Oct 2019 16:43:58 +0000 (17:43 +0100)
commite4222d7332ae3056bddfdeb39b3fec4f6cc04197
treefcd5785ad7c5dfb62b8ff5dee1ee51651a0d1141
parent800462acf861776b73cdc57d6e73770e1c37983b
Re-enable and cleanup format-flowed space stuffing

Commit 04cb5bde tried to fix re-stuffing a postponed message more than
once, but unfortunately broke the normal case of composing a new
message.  So actually, space-stuffing has been turned off the past 7
years.

Move format=flowed parameter setting below the standard message
pre-processing block.  It shouldn't be performed for draft-files even
with $resume_draft_files set.  Moving out of the block makes that
clearer.

Create mutt_rfc3676_space_(un)stuff() functions, which check the
content type and stuff/unstuff apprpropriately.  Note that the
stuff/unstuff does not depend on $text_flowed, which is only in charge
of setting the format=flowed parameter.  This parameter can also come
from resumed/resent/draft messages and should still be respected.

Add unstuffing to mutt_prepare_template().  This is called by
postponed, resent, and draft files.  This will prevent double-stuffing
in those cases.

Unstuff/restuff around editing the message in the compose menu, to
keep everything transparent to the user.  I originally put the
stuffing *after* the compose menu, but previewing the messages in the
compose menu did not work properly in that case.  It's cleaner this
way too.

Change the stuff/unstuff functions to preserve the original
hdr->content->filename.  The "hack" previously used would interact
poorly with editable body files (mutt -i -E).  Fortunately space
stuffing was pretty much disabled except in unusual cases before.

Co-authored-by: Richard Russon <rich@flatcap.org>
compose.c
doc/manual.xml.head
init.h
postpone.c
rfc3676.c
rfc3676.h
send.c