On Sun, Feb 09, 2020 at 06:07:18PM -0800, Kevin J. McCarthy wrote:
Recently, I've been playing around with background editing. This is still in the early stages, and is very much "work in progress" - meaning the code is a mess, light on testing, and subject to rebasing. But if any of you want to try it out I'm working in branch "kevin/background-edit".
This week progress was a little slow, because of the stable fixes for 1.13.4. However, I did finally create the landing page when composing. When the $editor exits, the landing page will automatically take you back to the compose menu. Alternatively, you can hit 'q' to return to the index while the landing page is still up.
One of the issues with background editing are the carefully made setting changes by reply-hook, send-hook, and send2-hook. Not to mention folder-hooks that might change $record, $postponed, etc if you change to a different folder associated with a different "account".
The past week, I investigated a couple possibilities. One was introducing scopes (e.g. account scope, folder scope, compose scope), but the changes for that would be quite large and probably have a performance impact.
So instead, I'll do manual saving and swapping. When you background and leave the compose menu, Mutt will save some of the config settings to the send-context. Resuming editing will save current global settings, and swap in the send-context values. Finishing up will then restore the saved global values (if any).
Currently I plan to save *all* boolean and quadoptions, along with $from, $envelope_from_address, $record, $postponed, $sendmail, $smtp_url, $pgp_sign_as, $smime_sign_as, $smime_encrypt_with.
If there are other variables you think would be important please chime in.
[As a side note, the patch-set already changed the compose menu so pgp/smime-sign and smime-encrypt prompts are saved to the send-context instead of globals].
After I get the above working, I'll start working on multiple-background processes along with a "resume" menu.
Then I'll work on emails that reply to an existing message. Those are trickier because we can't keep a handle on the cur message, and setting reply flags may require reopening the original mailbox.
-- Kevin J. McCarthy GPG Fingerprint: 8975 A9B3 3AA3 7910 385C 5308 ADEF 7684 8031 6BDA
signature.asc
Description: PGP signature