widgets/msgview: Reap the filter command

The filter command shells out and returns almost immediately. Call
Wait() so the filter process gets reaped. Prior to this patch, aerc
creates a zombie process for every email that is viewed.

Signed-off-by: Kevin Kuehler <keur@xcf.berkeley.edu>
Cleanup pager processes after closing a msgviewer

A pager is spawned every time an email is viewed but not killed off when
quitting the msgviewer, thus leading to process leakage. This patch
fixes this by adding a Close method to the msgview widget, which is
called in the close command.

Signed-off-by: Kevin Kuehler <keur@xcf.berkeley.edu>
Fix: oauthbearer runtime error

Configure an oauthbearer source without a token_endpoint
parameter would panic due to nil pointer dereference

  Example
    source=imaps+oauthbearer://frode.aa%40gmail.com@imap.gmail.com:993
    source-cred-cmd=pass oatuh2 frode.aa@gmail.com

token_endpoint is not required as it will use the provided
password as access_token when it is not set
lib/msgstore: fix invalid callback invocation

creating a directory must not invoke the callback, as this is meant for the
completion of the move
Fix tab refocus on remove

Previously removing a tab would always pop from the history of tabs.
This checks to see if the closing tab is the one selected, if it is then
we use the history, otherwise we only need to change the selected tab if
it was after (to the right of) the closing tab, in which case we just
decrement the selected index.
Fix pushing invalid tabs to history

A tab can now only be pushed onto the history if it is a selectable tab.
Revert "Show spinner when fetching contents"

This reverts commit 1339faf7881f33762c6e0a4915404e362fc51de1.
Preserve sorting order in search results

This ensures that the search results follow the order of the current
sort so that cycling throught the results proceeds in displayed order.
Show spinner when fetching contents

The spinner should be shown when fetching the contents as we don't know
at that point whether there are some messages or not.
Fix selected account to return for messageviewer

This ensures that the selectedaccount is returned if currently selected
tab is a messageviewer. This also makes it more extensible for adding
other ways of getting the selected account.
Open mailto links in a new aerc instance if needed.

Aerc tries to open mailto:// links via the socket of the already running aerc
instance.

If no socket exists this silently errored out.
This commit starts up a new aerc instance if it can't connect to the socket
(which I think is the most common error) and if not sets up a new aerc instance
and retries to open the compositor.

This fixes https://todo.sr.ht/~sircmpwn/aerc2/295 by implementing the desired
behaviour.
Print success to socket if no error was thrown

When Reto Brunners patch is applied (which works really well for me), the user gets to see the message
returned by AercServer. Since this is nil if no errors were thrown it
prints "result: <nil>" to the cmd. This patch fixes that by just
returning success instead of the error message when err != nil.
Config for deleting message from message viewer

As suggested in #268, this adds a behaviour setting for
deleting message from message viewer.
Sort path completions
Change search flags

This changes the search flags for maildir and imap backends.

They now no longer use -t for searching all text. This seems to make
more sense as being the targeted recipient. I have similarly added Cc
for -c. The text search now resides under -a for all text.
Make commands join args with spaces

This patch ensures the following commands join their arguments with
spaces to make it easier to interact with:

- cf
- mkdir
- cd
- attach
- detach
- ct
- copy
- move
- save
notmuch: add sort functionality
Add documentation for sort

This adds documentation for the config option and the command.
Add sorting functionality

There is a command and config option. The criteria are a list of the
sort criterion and each can be individually reversed.

This only includes support for sorting in the maildir backend currently.
The other backends are not supported in this patch.
Add directory info messages

This populates the directory info model properly when requested,
allowing the fields to be relied upon elsewhere.

This also sends the dirinfo when new messages come in.
Next