From Robert Günzler to ~rjarry/aerc-devel
Since 65dc87db62935950550f6c01f5966d402477852e the regex for picking up dynamic header patterns would split on occurences of '.', thus preventing regexes like shown in the test case to be used for matching messages. This introduces `~/<pattern>/` as a way to wrap such expressions. Fixes: 65dc87db6293 ("style: allow specifying multiple headers on dynamic styles") Signed-off-by: Robert Günzler <r@gnzler.io> --- config/style.go | 9 ++++++--- config/style_test.go | 12 ++++++++++++ doc/aerc-stylesets.7.scd | 4 +++- 3 files changed, 21 insertions(+), 4 deletions(-) [message trimmed]
From Robert Günzler to ~rjarry/aerc-devel
As shown by the patch to the test, the regex was only matching the last header pair and thus swapping the order of the "From" and "Subject" patterns leads to this config no longer matching a message it should match. Fixes: 65dc87db6293 ("style: allow specifying multiple headers on dynamic styles") Signed-off-by: Robert Günzler <r@gnzler.io> --- config/style.go | 2 +- config/style_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/style.go b/config/style.go index bf827bc9..31d84e98 100644 [message trimmed]
From Robert Günzler to ~rjarry/aerc-devel
this is v3, this time i hopefully didn't forget anything :P On Fri Jan 10, 2025 at 5:14 PM CET, Robin Jarry <robin@jarry.cc> wrote: >> func (ss *StyleSet) parseKey(key *ini.Key, selected bool) error { >> @@ -577,9 +577,12 @@ func (c *StyleConf) update(headerPatterns map[string]*StyleHeaderPattern, attr, >> >> for _, p := range headerPatterns { >> var pattern string >> - if strings.HasPrefix(p.RawPattern, "~") { >> + switch { >> + case strings.HasPrefix(p.RawPattern, "~/"): >> + pattern = p.RawPattern[2 : len(p.RawPattern)-1] > > It is unclear to me what you are doing precisely here. How is this
From Robert Günzler to ~rjarry/aerc-devel
just out of curiosity, i was only familiar with that from lists that accept patches for multiple projects (like with a public inbox) is there any specific reason we use it here?
From Robert Günzler to ~rjarry/aerc-devel
Since 65dc87db62935950550f6c01f5966d402477852e the regex for picking up dynamic header patterns would split on occurences of '.', thus preventing regexes like shown in the test case to be used for matching messages. This introduces `~/<pattern>/` as a way to wrap such expressions. Signed-off-by: Robert Günzler <r@gnzler.io> --- config/style.go | 9 ++++++--- config/style_test.go | 12 ++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/config/style.go b/config/style.go [message trimmed]
From Robert Günzler to ~rjarry/aerc-devel
As shown by the patch to the test, the regex was only matching the last header pair and thus swapping the order of the "From" and "Subject" patterns leads to this config no longer matching a message it should match. Signed-off-by: Robert Günzler <r@gnzler.io> --- config/style.go | 2 +- config/style_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/style.go b/config/style.go index bf827bc9..31d84e98 100644 --- a/config/style.go [message trimmed]
From Robert Günzler to ~rjarry/aerc-devel
after building from master my styleset wasn't applying any rules for highlighting list emails in my inbox. for reference here's a excerpt of that, in case anyone wants to see why this is important to me :) msglist_default.List-ID,~github\.com.bg = #52433d msglist_default.List-ID,~github\.com.selected.fg = toggle msglist_default.List-ID,~github\.com.selected.bg = toggle msglist_default.List-ID,~lists\.sr\.ht.bg = #0f2540 msglist_default.List-ID,~lists\.sr\.ht.selected.fg = toggle msglist_default.List-ID,~lists\.sr\.ht.selected.bg = toggle I was contemplating wether it would be easier to maintain if this wasn't done using these two relatively complex regexes. But I guess having
From Robert Günzler to ~rjarry/aerc-devel
As shown by the patch to the test, the regex was only matching the last header pair and thus swapping the order of the "From" and "Subject" patterns leads to this config no longer matching a message it should match. Signed-off-by: Robert Günzler <r@gnzler.io> --- config/style.go | 2 +- config/style_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/config/style.go b/config/style.go index bf827bc9..31d84e98 100644 --- a/config/style.go [message trimmed]
From Robert Günzler to ~rjarry/aerc-devel
Since 65dc87db62935950550f6c01f5966d402477852e the regex for picking up dynamic header patterns would split on occurences of '.', thus preventing regexes like shown in the test case to be used for matching messages. This introduces `~/<pattern>/` as a way to wrap such expressions. Signed-off-by: Robert Günzler <r@gnzler.io> --- config/style.go | 9 ++++++--- config/style_test.go | 12 ++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/config/style.go b/config/style.go [message trimmed]
From Robert Günzler to ~rjarry/aerc-devel
after building from master my styleset wasn't applying any rules for highlighting list emails in my inbox. for reference here's a excerpt of that, in case anyone wants to see why this is important to me :) msglist_default.List-ID,~github\.com.bg = #52433d msglist_default.List-ID,~github\.com.selected.fg = toggle msglist_default.List-ID,~github\.com.selected.bg = toggle msglist_default.List-ID,~lists\.sr\.ht.bg = #0f2540 msglist_default.List-ID,~lists\.sr\.ht.selected.fg = toggle msglist_default.List-ID,~lists\.sr\.ht.selected.bg = toggle I was contemplating wether it would be easier to maintain if this wasn't done using these two relatively complex regexes. But I guess having