~rjarry/aerc

0798a428 — Maarten Aertsen 4 days ago master
config: add tag-modified hook to default config

Add `tag-modified=` to the hooks section of aerc.conf.

Signed-off-by: Maarten Aertsen <maarten@nlnetlabs.nl>
Acked-by: Robin Jarry <robin@jarry.cc>

15460727 — Maarten Aertsen 4 days ago
config: add flag-changed hook to default config

Add `flag-changed=` to the hooks section of aerc.conf, with a
(commented) default corrensponding to the docs.

Signed-off-by: Maarten Aertsen <maarten@nlnetlabs.nl>
Acked-by: Robin Jarry <robin@jarry.cc>

762242d2 — Maarten Aertsen 4 days ago
docs: correct flag-changed example

Correct the flag-changed example to use the flag-changed hook.

Signed-off-by: Maarten Aertsen <maarten@nlnetlabs.nl>
Acked-by: Robin Jarry <robin@jarry.cc>

notmuch: fix disappearing messages

The current implementation assumes that 'root[0].FirstChild' is nil, but
this is not always the case. Instead of overwriting the FirstChild,
detect and link the messages to the LastChild of root[0].

Fixes: 672b4edca7af ("notmuch: draw incomplete threads")
Signed-off-by: Julio B <julio.bacel@gmail.com>
Tested-by: Inwit <inwit@sindominio.net>
Acked-by: Robin Jarry <robin@jarry.cc>
attach: use absolute paths instead of relative

Sometimes it is easier to change folders when adding attachments, but
currently we store relative paths, which doesn't work with this. Add the
absolute paths when attaching files.

Replace the current user home dir with ~ to make it prettier in the UI.

Implements: https://todo.sr.ht/~rjarry/aerc/134
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
notmuch: add completions for :cf, :filter and :search

Add completion of notmuch search-terms for :cf, :filter and :search.

Implements: https://todo.sr.ht/~rjarry/aerc/244
Changelog-added: Notmuch completions for `:cf`, `:filter` and
 `:search`.
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Tested-by: Julio B <julio.bacel@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
query: add completions for notmuch search-terms

Add completions to :query for the notmuch search terms. Most search
terms that seemed valid for interactive use in aerc are listed as
options. Some of them (from, to, tag, path, and folder) get actual
completions. The function was designed, so later patches can reuse it to
add completions to :cf, :filter and :search for notmuch accounts.

References: https://todo.sr.ht/~rjarry/aerc/244
Changelog-added: Notmuch search term completions to `:query`.
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Tested-by: Julio B <julio.bacel@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
hooks: add flag-changed

Add the flag-changed hook.

References: https://todo.sr.ht/~rjarry/aerc/136
Changelog-added: New `flag-changed` hook.
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
hooks: add tag-modified

Add the tag-modified hook for notmuch and JMAP accounts.

References: https://todo.sr.ht/~rjarry/aerc/136
Changelog-added: New `tag-modified` hook for notmuch and JMAP accounts.
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
open: create a file even if filename is empty

Without a filename, aerc tries to open a directory. In this case, create
a random filename.

Fixes: d99c49de2fc1 ("open: preserve the original filename")
Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
compose,viewer: do not always wrap people names in quotes

Currently, names of recipients in From, To, Cc and Bcc headers are
(almost) always wrapped in quotes. Even if they are pure ASCII and
contain one upper case letter. E.g.:

	From: "Foo" <foo@baz.org>

There is no valid reason to add these quotes unless the name contains
special characters as specified by RFC 5322, section 3.2.3:

   specials        =   "(" / ")" /        ; Special characters that do
                       "<" / ">" /        ;  not appear in atext
                       "[" / "]" /
                       ":" / ";" /
                       "@" / "\" /
                       "," / "." /
                       DQUOTE

Adapt the check accordingly.

Link: https://datatracker.ietf.org/doc/html/rfc5322#section-3.2.3
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
sendemail-validate: add fallback for older git

Before version 2.41, the sendemail-validate script can only be used to
validate patches one by one, even when sending patch series.

Set both GIT_SENDEMAIL_FILE_{COUNTER,TOTAL} to 1 in case they are not
defined to avoid obscure errors. At least with older git versions,
single patch validation should be possible.

Signed-off-by: Robin Jarry <robin@jarry.cc>
Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>
compose: explicitly identify converted text/* parts

When running :accept, an error is displayed on the review screen:

 text/calendar error: no command defined for mime/type

When running :multipart text/xxx, its contents are not specified. They
are regenerated every time the review screen is displayed. When running
:accept, a text/calendar part is added with actual contents.

Update the Part object to hold a boolean initialized when first being
created. If body is nil, identify the part as "Converted" and update its
contents every time the review screen is displayed. When body is not nil
but contains text (e.g. when running :accept), identify the part as
*not* converted and ignore the conversion step.

Fixes: cbcabfafaab2 ("compose: allow writing multipart/alternative messages")
Reported-by: Inwit <inwit@sindominio.net>
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Inwit <inwit@sindominio.net>
vaxis: fix panic trace print on stderr

By default, vaxis tries to open stderr, stdout and stdin in that order
and uses the first one as its TTY file descriptor.

Upon exit, vaxis.Close() closes that file descriptor. When aerc panics,
our panic handler calls UICleanup() which is an alias for vaxis.Close().
This effectively makes os.Stderr unusable and all error messages are
written to a closed file descriptor. This also break the regular go
runtime panic() handler which prints on stderr as well.

Use an explicit /dev/tty path instead of stderr to keep it open.

Fixes: 6eff242090dc ("ui: so long tcell")
Signed-off-by: Robin Jarry <robin@jarry.cc>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Reviewed-by: Tim Culverhouse <tim@timculverhouse.com>
98496019 — Johannes Thyssen Tishman 24 days ago
pipe: allow closing the terminal automatically

Add a new -s flag to :pipe. When specified, the terminal tab opened by
the :pipe command will be automatically closed after the process is
completed instead of prompting for a key press. While this doesn't
technically silence the command (the output is not suppressed), the
output is not shown to the user.

Changelog-added: Silently close the terminal tab after piping a
 message to a command with `:pipe -s <cmd>`.
Signed-off-by: Johannes Thyssen Tishman <johannes@thyssentishman.com>
Acked-by: Robin Jarry <robin@jarry.cc>
gitignore: add tags and aerc-release-stats.png

Ignore the tags file generated by ctags and the image generated by
python3 contrib/git-stats-graph.py (i.e. the default output of the
script.

Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Moritz Poldrack <moritz@poldrack.dev>
Acked-by: Robin Jarry <robin@jarry.cc>
docs: be more explicit about the behaviour of :accept

Accept can be a bit confusing when coming from something like gmail or
outlook, where clicking the accept button not only sends the accept
email, but also inserts the meeting into one's calendar. Be more
explicit about what happens.

Signed-off-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
c6a8071f — Johannes Thyssen Tishman 8 days ago
config: allow global options in accounts.conf

Global options may be configured by placing them at the top of the
accounts.conf file, before any account-specific sections. These can be
overridden for an account by specifying them again in the account
section.

Changelog-added: Set global options in `accounts.conf` by placing
 them at the top of the file.
Signed-off-by: Johannes Thyssen Tishman <johannes@thyssentishman.com>
Tested-by: Bence Ferdinandy <bence@ferdinandy.com>
Acked-by: Robin Jarry <robin@jarry.cc>
composer: block :quit command if composer is active

Prevent aerc from quiting if there is an active composer instance,
unless `:quit -f` is used.

Signed-off-by: Vitaly Ovchinnikov <v@ovch.ru>
Acked-by: Robin Jarry <robin@jarry.cc>
binds: fix FormatKeyStrokes to properly display certain keystrokes

Fix FormatKeyStrokes so it properly displays the strokes that are not
directly listed in `keyNames`, like ctrl+left, ctrl+pgup etc.

Add a test to check that the strokes are now formatted.

Signed-off-by: Vitaly Ovchinnikov <v@ovch.ru>
Acked-by: Robin Jarry <robin@jarry.cc>
Next