Hi Paul,
On 2012-08-09 19:11, Paul Provost wrote:
> Hi Dirk,
> Thanks for the quick response. So I just have to
> modify lib/mu-msg-file.c to test it out? Sounds great. I'll still be on the
> lookout for the next version though.
I have something like below (to replace the get_tags in mu-msg-file.c),
which will get both X-Label and X-Keywords; I'll push it once I have
tested it a bit more.
--8<---------------cut here---------------start------------->8---
/* see:
http://does-not-exist.org/mail-archives/mutt-dev/msg08249.html */
static GSList*
get_tags (MuMsgFile *self)
{
GSList *lst1, *lst2, *last;
char *hdr;
lst1 = lst2 = NULL;
/* X-Label are space-separated */
hdr = mu_msg_file_get_header (self, "X-Label");
if (hdr) {
lst1 = mu_str_to_list (hdr, ' ', TRUE);
g_free (hdr);
}
/* X-Keywords are ','-separated */
hdr = mu_msg_file_get_header (self, "X-Keywords");
if (hdr) {
lst2 = mu_str_to_list (hdr, ',', TRUE);
g_free (hdr);
}
if (!lst1)
return lst2;
/* append lst2, if any */
last = g_slist_last (lst1);
last->next = lst2;
return lst1;
}
--8<---------------cut here---------------end--------------->8---
> As long as we're talking, would there be a way to list all the
> tags/labels/keywords that are in the index? To generate a tag cloud or some
> other info.
Someone was working on this, see
https://github.com/djcb/mu/pull/38
Not sure of the current status though.
Best wishes,
Dirk.
--
Dirk-Jan C. Binnema Helsinki, Finland
e:dj...@djcbsoftware.nl w:
www.djcbsoftware.nl