NOTE: this patch does NOT make any code changes.
If only adds/removes whitespace.
Tidy our code in mutt functions as best we can.
Importantly, match up the indent to the surrounding code.
Delete trailing whitespace
{} in compact style
Tidy whitespace around ()'s and maths operators
buffy = (BUFFY *) safe_calloc (1, sizeof (BUFFY));
strfcpy (buffy->path, path, sizeof (buffy->path));
- r = realpath(path, rp);
+ r = realpath (path, rp);
strfcpy (buffy->realpath, r ? rp : path, sizeof (buffy->realpath));
buffy->next = NULL;
buffy->magic = 0;
else
(*tmp)->size = 0;
}
- Incoming = buffy_sort(Incoming);
+ Incoming = buffy_sort (Incoming);
return 0;
}
return 0;
}
- if (option(OPTSIDEBAR) && mailbox->msg_unread > 0) {
- mailbox->new = 1;
- return 1;
+ if (option (OPTSIDEBAR) && mailbox->msg_unread > 0) {
+ mailbox->new = 1;
+ return 1;
}
if ((dirp = opendir (path)) == NULL)
else
statcheck = sb->st_mtime > sb->st_atime
|| (mailbox->newly_created && sb->st_ctime == sb->st_mtime && sb->st_ctime == sb->st_atime);
- if ((!option(OPTSIDEBAR) && statcheck) || (option(OPTSIDEBAR) && mailbox->msg_unread > 0))
+ if ((!option (OPTSIDEBAR) && statcheck) || (option (OPTSIDEBAR) && mailbox->msg_unread > 0))
{
if (!option(OPTMAILCHECKRECENT) || sb->st_mtime > mailbox->last_visited)
{
case M_MBOX:
case M_MMDF:
if (sidebar_should_refresh()) {
- buffy_mbox_update (tmp, &sb);
- sidebar_updated();
+ buffy_mbox_update (tmp, &sb);
+ sidebar_updated();
}
if (buffy_mbox_hasnew (tmp, &sb) > 0)
BuffyCount++;
case M_MAILDIR:
if (sidebar_should_refresh()) {
- buffy_maildir_update (tmp);
- sidebar_updated();
+ buffy_maildir_update (tmp);
+ sidebar_updated();
}
if (buffy_maildir_hasnew (tmp) > 0)
BuffyCount++;
case M_MH:
if (sidebar_should_refresh()) {
- mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged, &tmp->sb_last_checked);
- sidebar_updated();
+ mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged, &tmp->sb_last_checked);
+ sidebar_updated();
}
- mh_buffy(tmp);
+ mh_buffy(tmp);
if (tmp->new)
BuffyCount++;
break;
short magic; /* mailbox type */
short newly_created; /* mbox or mmdf just popped into existence */
time_t last_visited; /* time of last exit from this mailbox */
- time_t sb_last_checked; /* time of last buffy check from sidebar */
+ time_t sb_last_checked; /* time of last buffy check from sidebar */
}
BUFFY;
do_buffy_notify = 1;
}
- if(option(OPTSIDEBAR))
+ if (option (OPTSIDEBAR))
menu->redraw |= REDRAW_SIDEBAR;
if (op != -1)
if (menu->redraw & REDRAW_FULL)
{
menu_redraw_full (menu);
- draw_sidebar(menu->menu);
+ draw_sidebar (menu->menu);
mutt_show_error ();
- } else if(menu->redraw & REDRAW_SIDEBAR) {
- draw_sidebar(menu->menu);
- menu->redraw &= ~REDRAW_SIDEBAR;
+ } else if (menu->redraw & REDRAW_SIDEBAR) {
+ draw_sidebar (menu->menu);
+ menu->redraw &= ~REDRAW_SIDEBAR;
}
if (menu->menu == MENU_MAIN)
DrawFullLine = 0;
move (option (OPTSTATUSONTOP) ? 0 : LINES-2, 0);
SETCOLOR (MT_COLOR_STATUS);
- set_buffystats(Context);
+ set_buffystats (Context);
mutt_paddstr (COLS, buf);
NORMAL_COLOR;
menu->redraw &= ~REDRAW_STATUS;
break;
CHECK_MSGCOUNT;
- CHECK_VISIBLE;
+ CHECK_VISIBLE;
CHECK_READONLY;
{
int oldvcount = Context->vcount;
{
mutt_buffy (buf, sizeof (buf));
- if ( op == OP_SIDEBAR_OPEN ) {
- if(!CurBuffy)
- break;
- strncpy( buf, CurBuffy->path, sizeof(buf) );
- } else if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1)
+ if (op == OP_SIDEBAR_OPEN) {
+ if (!CurBuffy)
+ break;
+ strncpy (buf, CurBuffy->path, sizeof (buf));
+ } else
+ if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1)
{
if (menu->menu == MENU_PAGER)
{
}
mutt_expand_path (buf, sizeof (buf));
- set_curbuffy(buf);
+ set_curbuffy (buf);
if (mx_get_magic (buf) <= 0)
{
mutt_error (_("%s is not a mailbox."), buf);
*/
if (h->searched && (changed != h->changed || deleted != ctx->deleted || tagged != ctx->tagged || flagged != ctx->flagged))
h->searched = 0;
- draw_sidebar(0);
+ draw_sidebar(0);
}
void mutt_tag_set_flag (int flag, int bf)
opened */
status->uidnext = oldun;
- /* Added to make the sidebar show the correct numbers */
- if (status->messages)
- {
- inc->msgcount = status->messages;
- inc->msg_unread = status->unseen;
- }
+ /* Added to make the sidebar show the correct numbers */
+ if (status->messages) {
+ inc->msgcount = status->messages;
+ inc->msg_unread = status->unseen;
+ }
FREE (&value);
return;
{
char tmpfolder[PATH_MAX];
strfcpy (tmpfolder, folder, sizeof (tmpfolder));
- if(!realpath(tmpfolder, folder))
- strfcpy (folder, tmpfolder, sizeof (tmpfolder));
+ if (!realpath (tmpfolder, folder))
+ strfcpy (folder, tmpfolder, sizeof (tmpfolder));
}
mutt_str_replace (&CurrentFolder, folder);
if((Context = mx_open_mailbox (folder, ((flags & M_RO) || option (OPTREADONLY)) ? M_READONLY : 0, NULL))
|| !explicit_folder)
{
- set_curbuffy(folder);
+ set_curbuffy (folder);
mutt_index_menu ();
if (Context)
FREE (&Context);
int do_color;
int attr;
- draw_sidebar(1);
+ draw_sidebar (1);
for (i = menu->top; i < menu->top + menu->pagelen; i++)
{
if (i < menu->max)
else
{
NORMAL_COLOR;
- CLEARLINE_WIN (i - menu->top + menu->offset);
+ CLEARLINE_WIN(i - menu->top + menu->offset);
}
}
NORMAL_COLOR;
#undef lines
#endif /* lines */
-#define CLEARLINE_WIN(x) move(x,SidebarWidth), clrtoeol()
+#define CLEARLINE_WIN(x) move (x,SidebarWidth), clrtoeol()
#define CLEARLINE(x) move(x,0), clrtoeol()
#define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x)
#define BEEP() do { if (option (OPTBEEP)) beep(); } while (0)
{
ut.actime = ctx->atime;
ut.modtime = ctx->mtime;
- utime (ctx->path, &ut);
+ utime (ctx->path, &ut);
}
#endif
/* never announce that a mailbox we've just left has new mail. #3290
* XXX: really belongs in mx_close_mailbox, but this is a nice hook point */
- if(!ctx->peekonly)
- mutt_buffy_setnotified(ctx->path);
+ if (!ctx->peekonly)
+ mutt_buffy_setnotified(ctx->path);
if (ctx->mx_close)
ctx->mx_close (ctx);
for (i = 0; i < ctx->msgcount; i++)
mutt_free_header (&ctx->hdrs[i]);
ctx->msgcount -= ctx->deleted;
- set_buffystats(ctx);
+ set_buffystats (ctx);
FREE (&ctx->hdrs);
FREE (&ctx->v2r);
FREE (&ctx->path);
&QuoteList, &q_level, &force_redraw, &SearchRE) > 0)
lines++;
curline++;
- move(lines + bodyoffset, SidebarWidth);
+ move (lines + bodyoffset, SidebarWidth);
}
last_offset = lineInfo[curline].offset;
} while (force_redraw);
addch ('~');
addch ('\n');
lines++;
- move(lines + bodyoffset, SidebarWidth);
+ move (lines + bodyoffset, SidebarWidth);
}
NORMAL_COLOR;
hfi.ctx = Context;
hfi.pager_progress = pager_progress_str;
- statuswidth = COLS - (option(OPTSTATUSONTOP) && PagerIndexLines > 0 ? SidebarWidth : 0);
+ statuswidth = COLS - (option (OPTSTATUSONTOP) && PagerIndexLines > 0 ? SidebarWidth : 0);
if (last_pos < sb.st_size - 1)
snprintf(pager_progress_str, sizeof(pager_progress_str), OFF_T_FMT "%%", (100 * last_offset / sb.st_size));
/* print out the pager status bar */
move (statusoffset, SidebarWidth);
SETCOLOR (MT_COLOR_STATUS);
- if(option(OPTSTATUSONTOP) && PagerIndexLines > 0) {
- CLEARLINE_WIN (statusoffset);
+ if (option (OPTSTATUSONTOP) && PagerIndexLines > 0) {
+ CLEARLINE_WIN (statusoffset);
} else {
- CLEARLINE (statusoffset);
- DrawFullLine = 1; /* for mutt_make_string_info */
+ CLEARLINE (statusoffset);
+ DrawFullLine = 1; /* for mutt_make_string_info */
}
if (IsHeader (extra) || IsMsgAttach (extra))
snprintf (bn, sizeof (bn), "%s (%s)", banner, pager_progress_str);
mutt_paddstr (statuswidth, bn);
}
- if(!option(OPTSTATUSONTOP) || PagerIndexLines == 0)
+ if (!option (OPTSTATUSONTOP) || PagerIndexLines == 0)
DrawFullLine = 0; /* reset */
NORMAL_COLOR;
if (option(OPTTSENABLED) && TSSupported)
/* redraw the pager_index indicator, because the
* flags for this message might have changed. */
menu_redraw_current (index);
- draw_sidebar(MENU_PAGER);
+ draw_sidebar (MENU_PAGER);
/* print out the index status bar */
menu_status_line (buffer, sizeof (buffer), index, NONULL(Status));
}
/* if we're not using the index, update every time */
- if ( index == 0 )
- draw_sidebar(MENU_PAGER);
+ if (index == 0)
+ draw_sidebar (MENU_PAGER);
redraw = 0;
case OP_SIDEBAR_SCROLL_DOWN:
case OP_SIDEBAR_SCROLL_UP:
scroll_sidebar(ch, MENU_PAGER);
- break;
+ break;
default:
ch = -1;