Opening a notmuch DB gives you a snapshot of the stage at that specific time.
Prior to this, we only reopened the DB upon writing.
However, if say a mail sync program like offlineimap is fetching new mail,
we would never pick it up.
This commit caches a db for a while, so that we don't generate too much overhead
and does a reconnect cycle after that.
I hardcoded a value as I don't think that having an option would be beneficial.
Any write operation (meaning reading mail) anyhow flushes the DB by necessity.
(we need to close to commit tag changes, which changing the read state is)
If the message doesn't contain ':', we don't properly discard the
message, so we end up slicing it like msg[:-1].
This can be reproduced if one runs 'aerc foo', as the server receives
'foo' as the message.
'aerc foo' still doesn't do anything very user friendly, but at least it
doesn't panic horribly.
While at it, do the 'got message' log at the very beginning, so that the
user can see what message the server got before reporting the command as
invalid.
Signed-off-by: Daniel Martí <mvdan@mvdan.cc>
The docs of strings.Compare state:
> Compare is included only for symmetry with package bytes. It is usually
> clearer and always faster to use the built-in string comparison operators
> ==, <, >, and so on.
So let's do that.
The go compiler can't help much with untyped int constants.
Even though the only valid constants are 0-3 it will happily accept 4 as input.
Let's let the go compiler worry about correctness here. This also allows people
not very familiar with the code to use it properly via auto completion.
+ Adds parsing of contextual ui sections to aerc config.
+ Add GetUiConfig method for AercConfig that is used to get the
specialized UI config.
+ Add UiConfig method to AccountView to get specialized UI Config.
+ Modifies Aerc codebase to use specialized UIConfig instead.
+ Adds documentation for Contextual UI Configuration
Before, while the docs stated that template-dirs was a colon-separated
list, a delimiter was not specified in the struct tag, so it was falling
back to the default for the ini library (a comma). Also added a note to
the docs to clarify that templates are configured in the [templates]
section.
The functionality was broken since the decoding changes.
This commit also simplifies the code (in my view) to make the application logic
easier to follow.
The docs are updated accordingly (the feature was poorly documented).
As far as I am aware there should be no breaking changes (and is certainly
still in the spec of the prior documentation)
When the list of completions from the external command doesn't have
associated contact names, the email address we attempt to parse was
being terminated with a newline. Now, we strip the trailing newline if
present.
Previously the workers returned a mixture of decoded / encoded parts.
This lead to a whole bunch of issues.
This commit changes the msgviewer and the commands to assume parts to already
be decoded
Before, pressing <Enter> when completions were visible would execute the
selected completion. As soon as completions were provided, the first
item would be selected. This could cause issues e.g. when changing
folders:
:cf <Enter>
Previously, this would have selected the first folder in the list. Now,
since <Tab>, <C-n>, etc have not been pressed to select the first
completion, the command above simply executes `:cf `.
To accomplish this, a "no-op completion" has been added at index -1.
When addresses contain special characters, net/mail MIME-encodes them
to a valid RFC 5322 address for use in headers. However, these are not
pleasant for human consumption, so we decode them for use in the
completion list. Aerc properly encodes addresses when the message is
sent.
This patch also removes surrounding white space from contact names, if
present.
In order to accommodate for that, the headerlayout needed to be rewritten
to pass the filter criteria back to the msgviewer, instead of just using
the normal headers.
Note that, until we get color configuration, this means that the user *must*
have the %Z verb in the index format else it'll be horribly confusing
as no visual indication is provided