From 02099cc6ea29e8595f43abe5b6a475edc92e24e0 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Mon, 15 May 2023 14:36:42 +0200 Subject: templates: add boolean flags MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Allow accessing email flags via boolean properties instead of having to rely on obscure regular expressions on (.Flags | join ""). With this patch, it is now possible to do this: [ui] index-columns = star:1,name<15%,reply:1,subject,size>=,date>= column-star = {{if .IsFlagged}}★{{end}} column-name = {{if eq .Role "sent"}}{{.To | names | join ", "}}{{else}}{{.From | names | join ", "}}{{end}} column-reply = {{if .IsReplied}}{{end}} column-subject = {{.ThreadPrefix}}{{.Subject}} column-size = {{if .HasAttachment}}📎 {{end}}{{humanReadable .Size}} column-date = {{.DateAutoFormat .Date.Local}} Signed-off-by: Robin Jarry Acked-by: Koni Marti --- doc/aerc-templates.7.scd | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'doc/aerc-templates.7.scd') diff --git a/doc/aerc-templates.7.scd b/doc/aerc-templates.7.scd index ae9bc6dc..6919e5dd 100644 --- a/doc/aerc-templates.7.scd +++ b/doc/aerc-templates.7.scd @@ -98,6 +98,14 @@ available always. {{.Flags | join ""}} ``` +*IsReplied*, *HasAttachment*, *IsFlagged*, *IsRecent*, *IsUnread*, *IsMarked* + Individual boolean flags. not available when composing, replying nor + forwarding. + + ``` + {{if .IsFlagged}}★{{end}} + ``` + *Labels* Message labels (for example notmuch tags). Not available when composing, replying nor forwarding. This is a list of strings that may be converted -- cgit