~rjarry/aerc-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
3 3

[PATCH aerc] config: make all message list symbols/icons configurable

Details
Message ID
<20230916095541.141532-1-owl@u8.is>
DKIM signature
missing
Download raw message
Patch: +42 -6
This patch removes the hardcoded letters (which don't make sense in all
languages), and replaces them with configurable icons, like the existing
`icon-attachment` and other icons.

Signed-off-by: owl <owl@u8.is>
---
 config/ui.go           |  6 ++++++
 doc/aerc-config.5.scd  | 30 ++++++++++++++++++++++++++++++
 lib/state/templates.go | 12 ++++++------
 3 files changed, 42 insertions(+), 6 deletions(-)

diff --git a/config/ui.go b/config/ui.go
index 699e8a0..ab5a34e 100644
--- a/config/ui.go
+++ b/config/ui.go
@@ -53,6 +53,12 @@ type UIConfig struct {
	IconUnknown                   string        `ini:"icon-unknown" default:"[s?]"`
	IconInvalid                   string        `ini:"icon-invalid" default:"[s!]"`
	IconAttachment                string        `ini:"icon-attachment" default:"a"`
	IconMessageReplied            string        `ini:"icon-message-replied" default:"r"`
	IconMessageNew                string        `ini:"icon-message-new" default:"N"`
	IconMessageOld                string        `ini:"icon-message-old" default:"O"`
	IconFlagged                   string        `ini:"icon-flagged" default:"!"`
	IconMarked                    string        `ini:"icon-marked" default:"*"`
	IconDeleted                   string        `ini:"icon-deleted" default:"D"`
	DirListDelay                  time.Duration `ini:"dirlist-delay" default:"200ms"`
	DirListTree                   bool          `ini:"dirlist-tree"`
	DirListCollapse               int           `ini:"dirlist-collapse"`
diff --git a/doc/aerc-config.5.scd b/doc/aerc-config.5.scd
index b09ce53..76efcd2 100644
--- a/doc/aerc-config.5.scd
+++ b/doc/aerc-config.5.scd
@@ -349,6 +349,36 @@ These options are configured in the *[ui]* section of _aerc.conf_.

	Default: _a_

*icon-message-new* = _<string>_
	The icon to display index-format when the message is unread and new.

	Default: _N_

*icon-message-old* = _<string>_
	The icon to display index-format when the message is unread and old.

	Default: _O_

*icon-message-replied* = _<string>_
	The icon to display index-format when the message has been replied to.

	Default: _r_

*icon-flagged* = _<string>_
	The icon to display index-format when the message is flagged.

	Default: _!_

*icon-marked* = _<string>_
	The icon to display index-format when the message is marked.

	Default: _\*_

*icon-deleted* = _<string>_
	The icon to display index-format when the message has been deleted.

	Default: _D_

*fuzzy-complete* = _true_|_false_
	When typing a command or option, the popover will now show not only the
	items /starting/ with the string input by the user, but it will also show
diff --git a/lib/state/templates.go b/lib/state/templates.go
index 22d0658..5ce440d 100644
--- a/lib/state/templates.go
+++ b/lib/state/templates.go
@@ -345,16 +345,16 @@ func (d *templateData) Flags() []string {

	switch {
	case d.info.Flags.Has(models.SeenFlag | models.AnsweredFlag):
		flags = append(flags, "r") // message has been replied to
		flags = append(flags, d.ui().IconMessageReplied) // message has been replied to
	case d.info.Flags.Has(models.SeenFlag):
		break
	case d.info.Flags.Has(models.RecentFlag):
		flags = append(flags, "N") // message is new
		flags = append(flags, d.ui().IconMessageNew) // message is new
	default:
		flags = append(flags, "O") // message is old
		flags = append(flags, d.ui().IconMessageOld) // message is old
	}
	if d.info.Flags.Has(models.DeletedFlag) {
		flags = append(flags, "D")
		flags = append(flags, d.ui().IconDeleted)
	}
	if d.info.BodyStructure != nil {
		for _, bS := range d.info.BodyStructure.Parts {
@@ -365,10 +365,10 @@ func (d *templateData) Flags() []string {
		}
	}
	if d.info.Flags.Has(models.FlaggedFlag) {
		flags = append(flags, "!")
		flags = append(flags, d.ui().IconFlagged)
	}
	if d.marked {
		flags = append(flags, "*")
		flags = append(flags, d.ui().IconMarked)
	}
	return flags
}
-- 
2.42.0

[aerc/patches] build success

builds.sr.ht <builds@sr.ht>
Details
Message ID
<CVK9665FINMT.1G0L6QSFDY9XW@cirno2>
In-Reply-To
<20230916095541.141532-1-owl@u8.is> (view parent)
DKIM signature
missing
Download raw message
aerc/patches: SUCCESS in 4m42s

[config: make all message list symbols/icons configurable][0] from [owl][1]

[0]: https://lists.sr.ht/~rjarry/aerc-devel/patches/44784
[1]: owl@u8.is

✓ #1058316 SUCCESS aerc/patches/openbsd.yml     https://builds.sr.ht/~rjarry/job/1058316
✓ #1058315 SUCCESS aerc/patches/alpine-edge.yml https://builds.sr.ht/~rjarry/job/1058315
Details
Message ID
<CVKO377XFY2G.1CPL3GGPFPEXQ@ferdinandy.com>
In-Reply-To
<20230916095541.141532-1-owl@u8.is> (view parent)
DKIM signature
missing
Download raw message
On Sat Sep 16, 2023 at 11:55, owl wrote:
> This patch removes the hardcoded letters (which don't make sense in all
> languages), and replaces them with configurable icons, like the existing
> `icon-attachment` and other icons.
>
> Signed-off-by: owl <owl@u8.is>
> ---
This is a good idea I think :)

Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>


--
+36305425054
bence.ferdinandy.com
Details
Message ID
<CVMSLK2988VN.LVO5Q8F2SOVP@ringo>
In-Reply-To
<CVKO377XFY2G.1CPL3GGPFPEXQ@ferdinandy.com> (view parent)
DKIM signature
missing
Download raw message
Bence Ferdinandy, Sep 16, 2023 at 23:42:
>
> On Sat Sep 16, 2023 at 11:55, owl wrote:
> > This patch removes the hardcoded letters (which don't make sense in all
> > languages), and replaces them with configurable icons, like the existing
> > `icon-attachment` and other icons.
> >
> > Signed-off-by: owl <owl@u8.is>
> > ---
> This is a good idea I think :)
>
> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com>

Acked-by: Robin-Jarry <robin@jarry.cc>

I have renamed the settings to make them consistent with other icon-*
stuff.

Applied. Thanks!
Reply to thread Export thread (mbox)