This ticket is to track the progress of removing the trigger-system in favour of a more comprehensive hooks system. Hooks that have been suggested are:
Hook | triggered when | Status |
---|---|---|
message-received |
a mail is received | ✅ |
flag-changed |
a message's flags have been modified | ✅ |
mesage-moved |
a message has been moved | ✅ (mail-{added,deleted} ) |
message-copied |
a message has been copied | ✅ (mail-{added,deleted} ) |
message-deleted |
a message has been deleted | ✅ |
message-post-compose |
a message's content has been edited | |
message-postponed |
a message has been postponed | |
message-sent |
a message has been sent | ✅ |
folder-created |
a folder/inbox is created | |
folder-moved |
a folder/inbox is renamed/moved | |
folder-deleted |
a folder/inbox is deleted | |
aerc-startup |
aerc is starting | ✅ |
aerc-shutdown |
aerc is quit | ✅ |
tag-modified |
a notmuch tag is added/removed | ✅ |
Discussion on aerc-discuss
Suggested-by: ~ferdinandyb
This requires a completely different system from triggers. To avoid keeping two ways of doing it, triggers will be deprecated as soon as the
message-received
hook has been implemented.
There are no arguments for actually "replacing" triggers with hooks. Simply adding more triggers would be less disruptive as you will not need to deprecate anything. The current only
new-email
trigger can remain and you can add all these new ones. The triggers already allow running shell commands.
Moritz Poldrack referenced this ticket in commit 2fef0f4.
Moritz Poldrack referenced this ticket in commit f10b184.
Moritz Poldrack referenced this ticket in commit b46b2d2.
Jason Cox referenced this ticket in commit 31b50f2.
Jason Cox referenced this ticket in commit faa879f.
Moritz Poldrack referenced this ticket in commit 0e592b2.
~mpldr is this still a breaking feature? Not any more right?
No, the only thing that was breaking is over.
-- Moritz Poldrack https://moritz.sh
Printed on recycled paper.
Bence Ferdinandy referenced this ticket in commit cee5d5a.
Bence Ferdinandy referenced this ticket in commit 939000c.
setting something like
mail-added = sleep 120 mail-deleted = sleep 120
and then archiving two emails will completely block aerc for a very long time
#This is by design, if something should run asynchronously, that should be made explicit to avoid undefined behavior. We should probably document this.
Moritz Poldrack https://moritz.sh
Used with permission.
actually setting
sleep 1
is also pretty bad. We should at least update our examples, but much better would be imho to offer async hook execution
That would be a race condition in itself. see also: aerc-shutdown
#How would this run async and be unracy?
Moritz Poldrack https://moritz.sh
Available while quantities last.
Yes, we should definitely document this, and also change the examples, since right now we have an example running mbsync on a folder synchronously, and I doubt that's a sane choice for anyone.