From e78540990496cb3f4ff611c680b005022d9d2fad Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Sun, 19 Jun 2022 16:41:15 -0500 Subject: binds: add folder context for message list binds Add option to specify folder-specific binds for message lists. The binds are layered: any existing binds in [messages] are overwritten by a more specific bind in say, [messages:folder=Drafts]. The order is currently: [messages] < [messages:account=] < [messages:folder=] Signed-off-by: Tim Culverhouse Acked-by: Robin Jarry --- config/config.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'config/config.go') diff --git a/config/config.go b/config/config.go index dae32b7c..64106329 100644 --- a/config/config.go +++ b/config/config.go @@ -72,6 +72,7 @@ const ( UI_CONTEXT_ACCOUNT UI_CONTEXT_SUBJECT BIND_CONTEXT_ACCOUNT + BIND_CONTEXT_FOLDER ) type UIConfigContext struct { @@ -910,6 +911,10 @@ func (config *AercConfig) LoadBinds(binds *ini.File, baseName string, baseGroup continue } contextualBind.ContextType = BIND_CONTEXT_ACCOUNT + case "folder": + // No validation needed. If the folder doesn't exist, the binds + // never get used + contextualBind.ContextType = BIND_CONTEXT_FOLDER default: return fmt.Errorf("Unknown Context Bind Section: %s", sectionName) } -- cgit