#3799: mutt -H <file> should modify the draft <file>, not create a copy
---------------------+----------------------
Reporter: vinc17 | Owner: mutt-dev
Type: defect | Status: new
Priority: major | Milestone:
Component: mutt | Version: 1.5.24
Resolution: | Keywords:
---------------------+----------------------
Comment (by kevin8t8):
I'm attaching an alpha version of a patch for feedback. Note that I
haven't updated the documentation yet, nor have I done extensive testing.
This version adds the -E command line flag, modifying -i and -H.
When used with -i, the include file is directly edited as the body of the
email, so all changes are immediately saved ($edit_headers redirects to a
tempfile during editing, but then writes back out to the include file).
When used with -H, the draft file is regenerated after exiting from
ci_send_message(). For now, I have essentially used the same code that
"postpone" does, truncating the draft file and using it as an empty mbox.
Some problems:
* If you add attachments, the code will happily save out a multipart
email. However, the -H flag currently doesn't attempt to parse out
multiparts: everything after the headers is treated as the body of the
email.
* Each time you re-invoke -E -H on the draft file, saving back out appends
another newline (mbox separator). The -H is not actually parsing
anything, so it includes that newline in the body of the email the next
time.
I'd appreciate feedback: does it work for you, is this the wrong approach,
opinions on the multipart issue. Thanks.
--
Ticket URL: <http://dev.mutt.org/trac/ticket/3799#comment:5>
Mutt <http://www.mutt.org/>
The Mutt mail user agent