From c6073eb8bbed1645ad990b59d39cbecb69bec893 Mon Sep 17 00:00:00 2001 From: Richard Russon Date: Fri, 19 Jul 2019 12:09:37 +0100 Subject: [PATCH] context: tidy for clarity - rename msgnotreadyet - insert whitespace into header --- context.h | 30 +++++++++++++++--------------- hdrline.c | 6 +++--- mx.c | 2 +- pager.c | 6 +++--- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/context.h b/context.h index a18b3d52e..0cf36f7e1 100644 --- a/context.h +++ b/context.h @@ -36,30 +36,30 @@ struct NotifyCallback; struct Context { off_t vsize; - char *pattern; /**< limit pattern string */ - struct PatternHead *limit_pattern; /**< compiled limit pattern */ - struct Email *last_tag; /**< last tagged msg. used to link threads */ - struct MuttThread *tree; /**< top of thread tree */ - struct Hash *thread_hash; /**< hash table for threading */ - int msgnotreadyet; /**< which msg "new" in pager, -1 if none */ + char *pattern; ///< Limit pattern string + struct PatternHead *limit_pattern; ///< Compiled limit pattern + struct Email *last_tag; ///< Last tagged msg (used to link threads) + struct MuttThread *tree; ///< Top of thread tree + struct Hash *thread_hash; ///< Hash table for threading + int msg_not_read_yet; ///< Which msg "new" in pager, -1 if none - struct Menu *menu; /**< needed for pattern compilation */ + struct Menu *menu; ///< Needed for pattern compilation - bool collapsed : 1; /**< are all threads collapsed? */ + bool collapsed : 1; ///< Are all threads collapsed? struct Mailbox *mailbox; }; -void ctx_free(struct Context **ptr); -int ctx_mailbox_observer(struct NotifyCallback *nc); -void ctx_update(struct Context *ctx); -void ctx_update_tables(struct Context *ctx, bool committing); +void ctx_free (struct Context **ptr); +int ctx_mailbox_observer(struct NotifyCallback *nc); +void ctx_update (struct Context *ctx); +void ctx_update_tables (struct Context *ctx, bool committing); -bool message_is_tagged(struct Context *ctx, int index); +bool message_is_tagged (struct Context *ctx, int index); bool message_is_visible(struct Context *ctx, int index); -int el_add_email(struct EmailList *el, struct Email *e); -int el_add_tagged(struct EmailList *el, struct Context *ctx, struct Email *e, bool use_tagged); +int el_add_email (struct EmailList *el, struct Email *e); +int el_add_tagged (struct EmailList *el, struct Context *ctx, struct Email *e, bool use_tagged); void emaillist_clear(struct EmailList *el); #endif /* MUTT_CONTEXT_H */ diff --git a/hdrline.c b/hdrline.c index 70990b094..c5a61c0ac 100644 --- a/hdrline.c +++ b/hdrline.c @@ -1172,7 +1172,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co wch = get_nth_wchar(C_FlagChars, FLAG_CHAR_IMPORTANT); else if (e->replied) wch = get_nth_wchar(C_FlagChars, FLAG_CHAR_REPLIED); - else if (e->read && (ctx && (ctx->msgnotreadyet != e->msgno))) + else if (e->read && (ctx && (ctx->msg_not_read_yet != e->msgno))) wch = get_nth_wchar(C_FlagChars, FLAG_CHAR_SEMPTY); else if (e->old) wch = get_nth_wchar(C_FlagChars, FLAG_CHAR_OLD); @@ -1330,7 +1330,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co ch = get_nth_wchar(C_FlagChars, FLAG_CHAR_NEW_THREAD); else if (threads && thread_is_old(ctx, e)) ch = get_nth_wchar(C_FlagChars, FLAG_CHAR_OLD_THREAD); - else if (e->read && (ctx && (ctx->msgnotreadyet != e->msgno))) + else if (e->read && (ctx && (ctx->msg_not_read_yet != e->msgno))) { if (e->replied) ch = get_nth_wchar(C_FlagChars, FLAG_CHAR_REPLIED); @@ -1396,7 +1396,7 @@ static const char *index_format_str(char *buf, size_t buflen, size_t col, int co first = get_nth_wchar(C_FlagChars, FLAG_CHAR_NEW_THREAD); else if (threads && thread_is_old(ctx, e)) first = get_nth_wchar(C_FlagChars, FLAG_CHAR_OLD_THREAD); - else if (e->read && (ctx && (ctx->msgnotreadyet != e->msgno))) + else if (e->read && (ctx && (ctx->msg_not_read_yet != e->msgno))) { if (e->replied) first = get_nth_wchar(C_FlagChars, FLAG_CHAR_REPLIED); diff --git a/mx.c b/mx.c index 2ce9d7b8a..fd2828c95 100644 --- a/mx.c +++ b/mx.c @@ -291,7 +291,7 @@ struct Context *mx_mbox_open(struct Mailbox *m, OpenMailboxFlags flags) } } - ctx->msgnotreadyet = -1; + ctx->msg_not_read_yet = -1; ctx->collapsed = false; m->size = 0; diff --git a/pager.c b/pager.c index 6ed6a3994..63484a807 100644 --- a/pager.c +++ b/pager.c @@ -2287,7 +2287,7 @@ int mutt_pager(const char *banner, const char *fname, PagerFlags flags, struct P if (Context && IsEmail(extra) && !extra->email->read) { - Context->msgnotreadyet = extra->email->msgno; + Context->msg_not_read_yet = extra->email->msgno; mutt_set_flag(Context->mailbox, extra->email, MUTT_READ, true); } @@ -3379,7 +3379,7 @@ int mutt_pager(const char *banner, const char *fname, PagerFlags flags, struct P else if (!first) mutt_set_flag(Context->mailbox, extra->email, MUTT_READ, true); first = false; - Context->msgnotreadyet = -1; + Context->msg_not_read_yet = -1; pager_menu->redraw |= REDRAW_STATUS | REDRAW_INDEX; if (C_Resolve) { @@ -3553,7 +3553,7 @@ int mutt_pager(const char *banner, const char *fname, PagerFlags flags, struct P if (IsEmail(extra)) { if (Context) - Context->msgnotreadyet = -1; + Context->msg_not_read_yet = -1; switch (rc) { case -1: -- 2.50.1