diff options
author | Eduardo Chappa <chappa@washington.edu> | 2013-02-05 00:59:30 -0700 |
---|---|---|
committer | Eduardo Chappa <chappa@washington.edu> | 2013-02-08 21:03:59 -0700 |
commit | 640d8845bffdf13007a10929ad0f18375a9a2473 (patch) | |
tree | 2c3fa0bb9b5dfc435dbde151cedf7b4f8b7b6660 /pith/mailindx.c | |
parent | dc6c0f8d846e14fc6841516ad772553fc5975bd6 (diff) | |
download | alpine-640d8845bffdf13007a10929ad0f18375a9a2473.tar.xz |
* Add color options for folders and index screen.
* Add silent token to display filter
* Add option to preserve To: and Cc: fields on replies.
Diffstat (limited to 'pith/mailindx.c')
-rw-r--r-- | pith/mailindx.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/pith/mailindx.c b/pith/mailindx.c index f3b68bfb..09cdc2c8 100644 --- a/pith/mailindx.c +++ b/pith/mailindx.c @@ -573,6 +573,17 @@ static INDEX_PARSE_T itokens[] = { {NULL, iNothing, FOR_NOTHING} }; +INDEX_PARSE_T itokensinv[sizeof(itokens)/sizeof(itokens[0])]; + +void +inverse_itokens(void) +{ + INDEX_PARSE_T *pt; + for (pt = itokens; pt->name; pt++) + itokensinv[pt->ctype].ctype = pt - itokens; + +} + INDEX_PARSE_T * itoken(int i) { @@ -1990,6 +2001,7 @@ format_index_index_line(INDEXDATA_S *idata) ICE_S *ice, **icep; IFIELD_S *ifield; IELEM_S *ielem; + COLOR_PAIR *color = NULL; struct variable *vars = ps_global->vars; dprint((8, "=== format_index_line(msgno=%ld,rawno=%ld) ===\n", @@ -2933,6 +2945,14 @@ format_index_index_line(INDEXDATA_S *idata) if(!ifield->ielem){ ielem = new_ielem(&ifield->ielem); + if(color = hdr_color(itokens[itokensinv[cdesc->ctype].ctype].name, NULL, ps_global->index_token_colors)){ + if(pico_usingcolor()){ + ielem->color = new_color_pair(color->fg, color->bg); + ielem->type = eTypeCol; + } + free_color_pair(&color); + } + ielem->freedata = 1; ielem->data = cpystr(str); ielem->datalen = strlen(str); |