chaining multiple commands in key binds

In the notmuch client, I want to tag and move messages with a single keystroke:

A = :modify-labels -inbox +Archive<Enter>move Archive<Enter>

However, modify-labels only removes the tag inbox and does not apply the tag Archive. I've tried with single quotes and it still doesn't do what it should.

Assigned to
11 months ago
10 months ago
feature ui

~inwit 11 months ago

I also tried with a colon before the second command:

A = :modify-labels -inbox +Archive<Enter>:move Archive<Enter>

~rjarry 10 months ago

The issue here is that most commands are executed in the background. The main thread that handles keyboard inputs simply runs the command function which often posts a message to the worker thread and returns without waiting for a result (to avoid blocking the UI). That means that :modify-labels is still pending/running when :move is executed which results in undefined behavior.

We would need a way to properly chain commands.

~inwit referenced this from #174 4 months ago

Register here or Log in to comment, or comment via email.