if (!ctx->pattern)
{
m->v2r[m->vcount] = msgno;
- e->virtual = m->vcount++;
+ e->vnum = m->vcount++;
}
else
- e->virtual = -1;
+ e->vnum = -1;
e->msgno = msgno;
if (e->env->supersedes)
m->emails[i] = NULL;
}
m->emails[j]->msgno = j;
- if (m->emails[j]->virtual != -1)
+ if (m->emails[j]->vnum != -1)
{
m->v2r[m->vcount] = j;
- m->emails[j]->virtual = m->vcount++;
+ m->emails[j]->vnum = m->vcount++;
struct Body *b = m->emails[j]->content;
ctx->vsize += b->length + b->offset - b->hdr_offset + padding;
}
int lines; /**< how many lines in the body of this message? */
int index; /**< the absolute (unsorted) message number */
int msgno; /**< number displayed to the user */
- int virtual; /**< virtual message number */
+ int vnum; /**< virtual message number */
int score;
struct Envelope *env; /**< envelope information */
struct Body *content; /**< list of MIME parts */
struct MuttThread *top = NULL;
- if (cur->message && (cur->message->virtual >= 0))
+ if (cur->message && (cur->message->vnum >= 0))
return cur->message;
top = cur;
while (true)
{
- if (cur->message && (cur->message->virtual >= 0))
+ if (cur->message && (cur->message->vnum >= 0))
return cur->message;
if (cur->child)
else if (CAN_COLLAPSE(CUR_EMAIL))
final = mutt_collapse_thread(Context, CUR_EMAIL);
else
- final = CUR_EMAIL->virtual;
+ final = CUR_EMAIL->vnum;
if (final == -1)
return;
}
/* Restore the cursor */
- mutt_set_virtual(Context);
+ mutt_set_vnum(Context);
for (int j = 0; j < Context->mailbox->vcount; j++)
{
if (Context->mailbox->emails[Context->mailbox->v2r[j]]->index == base->index)
if (mutt_pattern_exec(SLIST_FIRST(ctx->limit_pattern),
MUTT_MATCH_FULL_ADDRESS, ctx->mailbox, e, NULL))
{
- /* virtual will get properly set by mutt_set_virtual(), which
+ /* vnum will get properly set by mutt_set_vnum(), which
* is called by mutt_sort_headers() just below. */
- e->virtual = 1;
+ e->vnum = 1;
e->limited = true;
}
}
;
mutt_uncollapse_thread(ctx, j->message);
}
- mutt_set_virtual(ctx);
+ mutt_set_vnum(ctx);
}
else if (oldcount)
{
mutt_uncollapse_thread(ctx, save_new[j]);
}
}
- mutt_set_virtual(ctx);
+ mutt_set_vnum(ctx);
}
}
ctx->mailbox, ctx->mailbox->emails[i], NULL))
{
assert(ctx->mailbox->vcount < ctx->mailbox->msg_count);
- ctx->mailbox->emails[i]->virtual = ctx->mailbox->vcount;
+ ctx->mailbox->emails[i]->vnum = ctx->mailbox->vcount;
ctx->mailbox->v2r[ctx->mailbox->vcount] = i;
ctx->mailbox->emails[i]->limited = true;
ctx->mailbox->vcount++;
flags |= MUTT_FORMAT_FORCESUBJ;
break;
}
- else if (tmp->message->virtual >= 0)
+ else if (tmp->message->vnum >= 0)
break;
}
if (flags & MUTT_FORMAT_FORCESUBJ)
/* ...but if a previous sibling is available, don't force it */
if (reverse ? (tmp->message->msgno > edgemsgno) : (tmp->message->msgno < edgemsgno))
break;
- else if (tmp->message->virtual >= 0)
+ else if (tmp->message->vnum >= 0)
{
flags &= ~MUTT_FORMAT_FORCESUBJ;
break;
e = mutt_hash_find(Context->mailbox->id_hash, buf);
if (e)
{
- if (e->virtual != -1)
+ if (e->vnum != -1)
{
- menu->current = e->virtual;
+ menu->current = e->vnum;
menu->redraw = REDRAW_MOTION_RESYNC;
}
else if (e->collapsed)
{
mutt_uncollapse_thread(Context, e);
- mutt_set_virtual(Context);
- menu->current = e->virtual;
+ mutt_set_vnum(Context);
+ menu->current = e->vnum;
menu->redraw = REDRAW_MOTION_RESYNC;
}
else
{
e = Context->mailbox->emails[Context->mailbox->msg_count - 1];
mutt_sort_headers(Context, false);
- menu->current = e->virtual;
+ menu->current = e->vnum;
menu->redraw = REDRAW_FULL;
}
else if (rc > 0)
* update the index */
if (menu->menu == MENU_PAGER)
{
- menu->current = oldcur->virtual;
+ menu->current = oldcur->vnum;
menu->redraw = REDRAW_STATUS | REDRAW_INDEX;
op = OP_DISPLAY_MESSAGE;
continue;
/* if the root message was retrieved, move to it */
e = mutt_hash_find(Context->mailbox->id_hash, buf);
if (e)
- menu->current = e->virtual;
+ menu->current = e->vnum;
/* try to restore old position */
else
{
if (Context->mailbox->emails[i]->index == oldindex)
{
- menu->current = Context->mailbox->emails[i]->virtual;
+ menu->current = Context->mailbox->emails[i]->vnum;
/* as an added courtesy, recenter the menu
* with the current entry at the middle of the screen */
menu_check_recenter(menu);
if (mutt_messages_in_thread(Context->mailbox, e, 1) > 1)
{
mutt_uncollapse_thread(Context, e);
- mutt_set_virtual(Context);
+ mutt_set_vnum(Context);
}
- menu->current = e->virtual;
+ menu->current = e->vnum;
}
if (menu->menu == MENU_PAGER)
if (oldcount < Context->mailbox->msg_count)
{
/* nm_read_entire_thread() triggers mutt_sort_headers() if necessary */
- menu->current = oldcur->virtual;
+ menu->current = oldcur->vnum;
menu->redraw = REDRAW_STATUS | REDRAW_INDEX;
if (oldcur->collapsed || Context->collapsed)
{
menu->current = mutt_uncollapse_thread(Context, CUR_EMAIL);
- mutt_set_virtual(Context);
+ mutt_set_vnum(Context);
}
}
if (menu->menu == MENU_PAGER)
if (((C_Sort & SORT_MASK) == SORT_THREADS) && CUR_EMAIL->collapsed)
{
mutt_uncollapse_thread(Context, CUR_EMAIL);
- mutt_set_virtual(Context);
+ mutt_set_vnum(Context);
if (C_UncollapseJump)
menu->current = mutt_thread_next_unread(Context, CUR_EMAIL);
}
mutt_break_thread(CUR_EMAIL);
mutt_sort_headers(Context, true);
- menu->current = oldcur->virtual;
+ menu->current = oldcur->vnum;
}
Context->mailbox->changed = true;
if (mutt_link_threads(CUR_EMAIL, &el, Context->mailbox))
{
mutt_sort_headers(Context, true);
- menu->current = oldcur->virtual;
+ menu->current = oldcur->vnum;
Context->mailbox->changed = true;
mutt_message(_("Threads linked"));
if (CUR_EMAIL->collapsed)
{
menu->current = mutt_uncollapse_thread(Context, CUR_EMAIL);
- mutt_set_virtual(Context);
+ mutt_set_vnum(Context);
if (C_UncollapseJump)
menu->current = mutt_thread_next_unread(Context, CUR_EMAIL);
}
else if (CAN_COLLAPSE(CUR_EMAIL))
{
menu->current = mutt_collapse_thread(Context, CUR_EMAIL);
- mutt_set_virtual(Context);
+ mutt_set_vnum(Context);
}
else
{
*/
static bool is_visible(struct Email *e, struct Context *ctx)
{
- return e->virtual >= 0 || (e->collapsed && (!ctx->pattern || e->limited));
+ return e->vnum >= 0 || (e->collapsed && (!ctx->pattern || e->limited));
}
/**
if ((C_Sort & SORT_MASK) != SORT_THREADS)
{
mutt_error(_("Threading is not enabled"));
- return e->virtual;
+ return e->vnum;
}
cur = e->thread;
} while (!tmp);
}
- return tmp->virtual;
+ return tmp->vnum;
}
/**
if ((C_Sort & SORT_MASK) != SORT_THREADS)
{
mutt_error(_("Threading is not enabled"));
- return e->virtual;
+ return e->vnum;
}
/* Root may be the current message */
mutt_error(_("Parent message is not visible in this limited view"));
return -1;
}
- return parent->virtual;
+ return parent->vnum;
}
/**
- * mutt_set_virtual - Set the virtual index number of all the messages in a mailbox
+ * mutt_set_vnum - Set the virtual index number of all the messages in a mailbox
* @param ctx Mailbox
*/
-void mutt_set_virtual(struct Context *ctx)
+void mutt_set_vnum(struct Context *ctx)
{
if (!ctx || !ctx->mailbox)
return;
for (int i = 0; i < m->msg_count; i++)
{
cur = m->emails[i];
- if (cur->virtual >= 0)
+ if (cur->vnum >= 0)
{
- cur->virtual = m->vcount;
+ cur->vnum = m->vcount;
m->v2r[m->vcount] = i;
m->vcount++;
ctx->vsize += cur->content->length + cur->content->offset -
int final, reverse = (C_Sort & SORT_REVERSE), minmsgno;
int num_hidden = 0, new = 0, old = 0;
bool flagged = false;
- int min_unread_msgno = INT_MAX, min_unread = cur->virtual;
+ int min_unread_msgno = INT_MAX, min_unread = cur->vnum;
#define CHECK_LIMIT (!ctx->pattern || cur->limited)
if (((C_Sort & SORT_MASK) != SORT_THREADS) && !(flag & MUTT_THREAD_GET_HIDDEN))
{
mutt_error(_("Threading is not enabled"));
- return cur->virtual;
+ return cur->vnum;
}
- final = cur->virtual;
+ final = cur->vnum;
thread = cur->thread;
while (thread->parent)
thread = thread->parent;
new = 1;
if (cur->msgno < min_unread_msgno)
{
- min_unread = cur->virtual;
+ min_unread = cur->vnum;
min_unread_msgno = cur->msgno;
}
}
if (cur->flagged && CHECK_LIMIT)
flagged = true;
- if ((cur->virtual == -1) && CHECK_LIMIT)
+ if ((cur->vnum == -1) && CHECK_LIMIT)
num_hidden++;
if (flag & (MUTT_THREAD_COLLAPSE | MUTT_THREAD_UNCOLLAPSE))
{
cur->pair = 0; /* force index entry's color to be re-evaluated */
cur->collapsed = flag & MUTT_THREAD_COLLAPSE;
- if (cur->virtual != -1)
+ if (cur->vnum != -1)
{
roothdr = cur;
if (flag & MUTT_THREAD_COLLAPSE)
- final = roothdr->virtual;
+ final = roothdr->vnum;
}
}
{
roothdr = cur;
if (flag & MUTT_THREAD_COLLAPSE)
- final = roothdr->virtual;
+ final = roothdr->vnum;
}
if (reverse && (flag & MUTT_THREAD_COLLAPSE) && (cur->msgno < minmsgno) && CHECK_LIMIT)
{
minmsgno = cur->msgno;
- final = cur->virtual;
+ final = cur->vnum;
}
if (flag & MUTT_THREAD_COLLAPSE)
{
if (cur != roothdr)
- cur->virtual = -1;
+ cur->vnum = -1;
}
else
{
if (CHECK_LIMIT)
- cur->virtual = cur->msgno;
+ cur->vnum = cur->msgno;
}
}
new = 1;
if (cur->msgno < min_unread_msgno)
{
- min_unread = cur->virtual;
+ min_unread = cur->vnum;
min_unread_msgno = cur->msgno;
}
}
if (cur->flagged && CHECK_LIMIT)
flagged = true;
- if ((cur->virtual == -1) && CHECK_LIMIT)
+ if ((cur->vnum == -1) && CHECK_LIMIT)
num_hidden++;
}
struct Hash * mutt_make_id_hash (struct Mailbox *m);
int mutt_messages_in_thread(struct Mailbox *m, struct Email *e, int flag);
int mutt_parent_message (struct Context *ctx, struct Email *e, bool find_root);
-void mutt_set_virtual (struct Context *ctx);
+void mutt_set_vnum (struct Context *ctx);
struct MuttThread *mutt_sort_subthreads (struct MuttThread *thread, bool init);
void mutt_sort_threads (struct Context *ctx, bool init);
rd->index->menu_make_entry = index_make_entry;
rd->index->menu_color = index_color;
rd->index->max = Context ? Context->mailbox->vcount : 0;
- rd->index->current = rd->extra->email->virtual;
+ rd->index->current = rd->extra->email->vnum;
rd->index->indexwin = rd->index_window;
rd->index->statuswin = rd->index_status_window;
}
for (int i = 0; i < Context->mailbox->msg_count; i++)
{
- Context->mailbox->emails[i]->virtual = -1;
+ Context->mailbox->emails[i]->vnum = -1;
Context->mailbox->emails[i]->limited = false;
Context->mailbox->emails[i]->collapsed = false;
Context->mailbox->emails[i]->num_hidden = 0;
{
struct Body *body = Context->mailbox->emails[i]->content;
- Context->mailbox->emails[i]->virtual = Context->mailbox->vcount;
+ Context->mailbox->emails[i]->vnum = Context->mailbox->vcount;
Context->mailbox->emails[i]->limited = true;
Context->mailbox->v2r[Context->mailbox->vcount] = i;
Context->mailbox->vcount++;
{
mutt_progress_update(&progress, i, -1);
/* new limit pattern implicitly uncollapses all threads */
- Context->mailbox->emails[i]->virtual = -1;
+ Context->mailbox->emails[i]->vnum = -1;
Context->mailbox->emails[i]->limited = false;
Context->mailbox->emails[i]->collapsed = false;
Context->mailbox->emails[i]->num_hidden = 0;
if (mutt_pattern_exec(SLIST_FIRST(pat), MUTT_MATCH_FULL_ADDRESS,
Context->mailbox, Context->mailbox->emails[i], NULL))
{
- Context->mailbox->emails[i]->virtual = Context->mailbox->vcount;
+ Context->mailbox->emails[i]->vnum = Context->mailbox->vcount;
Context->mailbox->emails[i]->limited = true;
Context->mailbox->v2r[Context->mailbox->vcount] = i;
Context->mailbox->vcount++;
for (int i = 0; i < ctx->mailbox->msg_count; i++)
{
struct Email *cur = ctx->mailbox->emails[i];
- if ((cur->virtual != -1) || (cur->collapsed && (!ctx->pattern || cur->limited)))
+ if ((cur->vnum != -1) || (cur->collapsed && (!ctx->pattern || cur->limited)))
{
- cur->virtual = ctx->mailbox->vcount;
+ cur->vnum = ctx->mailbox->vcount;
ctx->mailbox->v2r[ctx->mailbox->vcount] = i;
ctx->mailbox->vcount++;
}
mutt_collapse_thread(ctx, e);
top = top->next;
}
- mutt_set_virtual(ctx);
+ mutt_set_vnum(ctx);
}
if (!ctx->mailbox->quiet)