1 *** mutt-1.5.19-orig/buffy.c 2008-08-29 18:39:48.000000000 -0500
2 --- mutt-1.5.19-patched/buffy.c 2009-05-22 08:45:01.000000000 -0500
5 char path[_POSIX_PATH_MAX];
10 /* update postponed count as well, on force */
13 char path[_POSIX_PATH_MAX];
14 struct stat contex_sb;
18 /* update postponed count as well, on force */
24 for (tmp = Incoming; tmp; tmp = tmp->next)
26 + if ( tmp->new == 1 )
29 if (tmp->magic != M_IMAP)
41 else if (option(OPTCHECKMBOXSIZE))
48 ! if (STAT_CHECK || tmp->msgcount == 0)
53 ! /* parse the mailbox, to see how much mail there is */
54 ! ctx = mx_open_mailbox( tmp->path, M_READONLY | M_QUIET | M_NOSORT | M_PEEK, NULL);
57 ! msgcount = ctx->msgcount;
58 ! msg_unread = ctx->unread;
59 ! mx_close_mailbox(ctx, 0);
62 ! tmp->msgcount = msgcount;
63 ! tmp->msg_unread = msg_unread;
65 ! tmp->has_new = tmp->new = 1;
69 else if (option(OPTCHECKMBOXSIZE))
73 if (tmp->newly_created &&
74 (sb.st_ctime != sb.st_mtime || sb.st_ctime != sb.st_atime))
75 tmp->newly_created = 0;
81 snprintf (path, sizeof (path), "%s/new", tmp->path);
82 if ((dirp = opendir (path)) == NULL)
87 while ((de = readdir (dirp)) != NULL)
90 if (*de->d_name != '.' &&
91 (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')))
93 ! /* one new and undeleted message is enough */
103 if ((tmp->new = mh_buffy (tmp->path)) > 0)
109 if (tmp->newly_created &&
110 (sb.st_ctime != sb.st_mtime || sb.st_ctime != sb.st_atime))
111 tmp->newly_created = 0;
117 + /* count new message */
118 snprintf (path, sizeof (path), "%s/new", tmp->path);
119 if ((dirp = opendir (path)) == NULL)
125 + tmp->msg_unread = 0;
126 + tmp->msg_flagged = 0;
127 while ((de = readdir (dirp)) != NULL)
130 if (*de->d_name != '.' &&
131 (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')))
133 ! tmp->has_new = tmp->new = 1;
138 ! if(tmp->msg_unread)
144 ! * count read messages (for folderlist (sidebar) we also need to count
145 ! * messages in cur so that we the total number of messages
147 ! snprintf (path, sizeof (path), "%s/cur", tmp->path);
148 ! if ((dirp = opendir (path)) == NULL)
153 ! while ((de = readdir (dirp)) != NULL)
156 ! if (*de->d_name != '.') {
157 ! if ((p = strstr (de->d_name, ":2,"))) {
158 ! if (!strchr (p + 3, 'T')) {
160 ! if ( !strchr (p + 3, 'S'))
162 ! if (strchr(p + 3, 'F'))
163 ! tmp->msg_flagged++;
176 if ((tmp->new = mh_buffy (tmp->path)) > 0)
179 + if ((dp = opendir (path)) == NULL)
182 + while ((de = readdir (dp)))
184 + if (mh_valid_message (de->d_name))
187 + tmp->has_new = tmp->new = 1;
195 *** mutt-1.5.19-orig/buffy.h 2008-05-22 13:25:19.000000000 -0500
196 --- mutt-1.5.19-patched/buffy.h 2009-05-21 23:08:38.000000000 -0500
202 struct buffy_t *next;
203 + struct buffy_t *prev;
204 short new; /* mailbox has new mail */
205 + short has_new; /* set it new if new and not read */
206 + int msgcount; /* total number of messages */
207 + int msg_unread; /* number of unread messages */
208 + int msg_flagged; /* number of flagged messages */
209 short notified; /* user has been notified */
210 short magic; /* mailbox type */
211 short newly_created; /* mbox or mmdf just popped into existence */
212 *** mutt-1.5.19-orig/color.c 2008-03-19 15:07:57.000000000 -0500
213 --- mutt-1.5.19-patched/color.c 2009-05-21 23:08:38.000000000 -0500
217 { "bold", MT_COLOR_BOLD },
218 { "underline", MT_COLOR_UNDERLINE },
219 { "index", MT_COLOR_INDEX },
220 + { "sidebar_new", MT_COLOR_NEW },
221 + { "sidebar_flagged", MT_COLOR_FLAGGED },
225 *** mutt-1.5.19-orig/compose.c 2009-01-05 13:20:53.000000000 -0600
226 --- mutt-1.5.19-patched/compose.c 2009-05-21 23:08:38.000000000 -0500
230 #define HDR_XOFFSET 10
231 #define TITLE_FMT "%10s" /* Used for Prompts, which are ASCII */
232 ! #define W (COLS - HDR_XOFFSET)
234 static char *Prompts[] =
238 #define HDR_XOFFSET 10
239 #define TITLE_FMT "%10s" /* Used for Prompts, which are ASCII */
240 ! #define W (COLS - HDR_XOFFSET - SidebarWidth)
242 static char *Prompts[] =
246 if ((WithCrypto & APPLICATION_PGP) && (WithCrypto & APPLICATION_SMIME))
249 ! mvaddstr (HDR_CRYPT, 0, "Security: ");
250 else if (msg->security & APPLICATION_SMIME)
251 ! mvaddstr (HDR_CRYPT, 0, " S/MIME: ");
252 else if (msg->security & APPLICATION_PGP)
253 ! mvaddstr (HDR_CRYPT, 0, " PGP: ");
255 else if ((WithCrypto & APPLICATION_SMIME))
256 ! mvaddstr (HDR_CRYPT, 0, " S/MIME: ");
257 else if ((WithCrypto & APPLICATION_PGP))
258 ! mvaddstr (HDR_CRYPT, 0, " PGP: ");
263 if ((WithCrypto & APPLICATION_PGP) && (WithCrypto & APPLICATION_SMIME))
266 ! mvaddstr (HDR_CRYPT, SidebarWidth, "Security: ");
267 else if (msg->security & APPLICATION_SMIME)
268 ! mvaddstr (HDR_CRYPT, SidebarWidth, " S/MIME: ");
269 else if (msg->security & APPLICATION_PGP)
270 ! mvaddstr (HDR_CRYPT, SidebarWidth, " PGP: ");
272 else if ((WithCrypto & APPLICATION_SMIME))
273 ! mvaddstr (HDR_CRYPT, SidebarWidth, " S/MIME: ");
274 else if ((WithCrypto & APPLICATION_PGP))
275 ! mvaddstr (HDR_CRYPT, SidebarWidth, " PGP: ");
284 ! move (HDR_CRYPTINFO, 0);
286 if ((WithCrypto & APPLICATION_PGP)
287 && msg->security & APPLICATION_PGP && msg->security & SIGN)
292 ! move (HDR_CRYPTINFO, SidebarWidth);
294 if ((WithCrypto & APPLICATION_PGP)
295 && msg->security & APPLICATION_PGP && msg->security & SIGN)
298 && (msg->security & ENCRYPT)
301 ! mvprintw (HDR_CRYPTINFO, 40, "%s%s", _("Encrypt with: "),
302 NONULL(SmimeCryptAlg));
306 && (msg->security & ENCRYPT)
309 ! mvprintw (HDR_CRYPTINFO, SidebarWidth + 40, "%s%s", _("Encrypt with: "),
310 NONULL(SmimeCryptAlg));
318 ! mvaddstr (HDR_MIX, 0, " Mix: ");
326 ! mvaddstr (HDR_MIX, SidebarWidth, " Mix: ");
332 if (t && t[0] == '0' && t[1] == '\0')
335 ! if (c + mutt_strlen (t) + 2 >= COLS)
340 if (t && t[0] == '0' && t[1] == '\0')
343 ! if (c + mutt_strlen (t) + 2 >= COLS - SidebarWidth)
351 rfc822_write_address (buf, sizeof (buf), addr, 1);
352 ! mvprintw (line, 0, TITLE_FMT, Prompts[line - 1]);
353 mutt_paddstr (W, buf);
359 rfc822_write_address (buf, sizeof (buf), addr, 1);
360 ! mvprintw (line, SidebarWidth, TITLE_FMT, Prompts[line - 1]);
361 mutt_paddstr (W, buf);
366 draw_envelope_addr (HDR_TO, msg->env->to);
367 draw_envelope_addr (HDR_CC, msg->env->cc);
368 draw_envelope_addr (HDR_BCC, msg->env->bcc);
369 ! mvprintw (HDR_SUBJECT, 0, TITLE_FMT, Prompts[HDR_SUBJECT - 1]);
370 mutt_paddstr (W, NONULL (msg->env->subject));
371 draw_envelope_addr (HDR_REPLYTO, msg->env->reply_to);
372 ! mvprintw (HDR_FCC, 0, TITLE_FMT, Prompts[HDR_FCC - 1]);
373 mutt_paddstr (W, fcc);
377 draw_envelope_addr (HDR_TO, msg->env->to);
378 draw_envelope_addr (HDR_CC, msg->env->cc);
379 draw_envelope_addr (HDR_BCC, msg->env->bcc);
380 ! mvprintw (HDR_SUBJECT, SidebarWidth, TITLE_FMT, Prompts[HDR_SUBJECT - 1]);
381 mutt_paddstr (W, NONULL (msg->env->subject));
382 draw_envelope_addr (HDR_REPLYTO, msg->env->reply_to);
383 ! mvprintw (HDR_FCC, SidebarWidth, TITLE_FMT, Prompts[HDR_FCC - 1]);
384 mutt_paddstr (W, fcc);
391 SETCOLOR (MT_COLOR_STATUS);
392 ! mvaddstr (HDR_ATTACH - 1, 0, _("-- Attachments"));
393 BKGDSET (MT_COLOR_STATUS);
399 SETCOLOR (MT_COLOR_STATUS);
400 ! mvaddstr (HDR_ATTACH - 1, SidebarWidth, _("-- Attachments"));
401 BKGDSET (MT_COLOR_STATUS);
406 /* redraw the expanded list so the user can see the result */
408 rfc822_write_address (buf, sizeof (buf), *addr, 1);
409 ! move (line, HDR_XOFFSET);
410 mutt_paddstr (W, buf);
414 /* redraw the expanded list so the user can see the result */
416 rfc822_write_address (buf, sizeof (buf), *addr, 1);
417 ! move (line, HDR_XOFFSET+SidebarWidth);
418 mutt_paddstr (W, buf);
423 if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0)
425 mutt_str_replace (&msg->env->subject, buf);
426 ! move (HDR_SUBJECT, HDR_XOFFSET);
428 if (msg->env->subject)
429 mutt_paddstr (W, msg->env->subject);
431 if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0)
433 mutt_str_replace (&msg->env->subject, buf);
434 ! move (HDR_SUBJECT, HDR_XOFFSET + SidebarWidth);
436 if (msg->env->subject)
437 mutt_paddstr (W, msg->env->subject);
441 strfcpy (fcc, buf, fcclen);
442 mutt_pretty_mailbox (fcc, fcclen);
443 ! move (HDR_FCC, HDR_XOFFSET);
444 mutt_paddstr (W, fcc);
449 strfcpy (fcc, buf, fcclen);
450 mutt_pretty_mailbox (fcc, fcclen);
451 ! move (HDR_FCC, HDR_XOFFSET + SidebarWidth);
452 mutt_paddstr (W, fcc);
455 *** mutt-1.5.19-orig/curs_main.c 2009-01-05 13:20:53.000000000 -0600
456 --- mutt-1.5.19-patched/curs_main.c 2009-05-21 23:08:38.000000000 -0500
465 + #include "sidebar.h"
471 menu->redraw |= REDRAW_STATUS;
474 ! if (mutt_buffy_notify () && option (OPTBEEPNEW))
480 menu->redraw |= REDRAW_STATUS;
483 ! if (mutt_buffy_notify ())
485 ! menu->redraw |= REDRAW_FULL;
486 ! if (option (OPTBEEPNEW))
495 if (menu->redraw & REDRAW_FULL)
497 menu_redraw_full (menu);
498 + draw_sidebar(menu->menu);
506 if (menu->redraw & REDRAW_STATUS)
509 menu_status_line (buf, sizeof (buf), menu, NONULL (Status));
511 CLEARLINE (option (OPTSTATUSONTOP) ? 0 : LINES-2);
512 SETCOLOR (MT_COLOR_STATUS);
513 BKGDSET (MT_COLOR_STATUS);
514 + set_buffystats(Context);
515 mutt_paddstr (COLS, buf);
516 SETCOLOR (MT_COLOR_NORMAL);
517 BKGDSET (MT_COLOR_NORMAL);
520 menu->oldcurrent = -1;
522 if (option (OPTARROWCURSOR))
523 ! move (menu->current - menu->top + menu->offset, 2);
524 else if (option (OPTBRAILLEFRIENDLY))
525 move (menu->current - menu->top + menu->offset, 0);
528 menu->oldcurrent = -1;
530 if (option (OPTARROWCURSOR))
531 ! move (menu->current - menu->top + menu->offset, SidebarWidth + 2);
532 else if (option (OPTBRAILLEFRIENDLY))
533 move (menu->current - menu->top + menu->offset, 0);
538 menu->redraw = REDRAW_FULL;
541 + case OP_SIDEBAR_OPEN:
542 case OP_MAIN_CHANGE_FOLDER:
543 case OP_MAIN_NEXT_UNREAD_MAILBOX:
548 mutt_buffy (buf, sizeof (buf));
550 ! if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1)
552 if (menu->menu == MENU_PAGER)
556 mutt_buffy (buf, sizeof (buf));
558 ! if ( op == OP_SIDEBAR_OPEN ) {
561 ! strncpy( buf, CurBuffy->path, sizeof(buf) );
562 ! } else if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1)
564 if (menu->menu == MENU_PAGER)
571 mutt_expand_path (buf, sizeof (buf));
573 if (mx_get_magic (buf) <= 0)
575 mutt_error (_("%s is not a mailbox."), buf);
582 + case OP_SIDEBAR_SCROLL_UP:
583 + case OP_SIDEBAR_SCROLL_DOWN:
584 + case OP_SIDEBAR_NEXT:
585 + case OP_SIDEBAR_PREV:
586 + scroll_sidebar(op, menu->menu);
589 if (menu->menu == MENU_MAIN)
590 km_error_key (MENU_MAIN);
591 *** mutt-1.5.19-orig/flags.c 2009-01-03 17:27:10.000000000 -0600
592 --- mutt-1.5.19-patched/flags.c 2009-05-21 23:08:38.000000000 -0500
598 #include "mutt_curses.h"
599 + #include "mutt_menu.h"
602 + #include "sidebar.h"
604 void _mutt_set_flag (CONTEXT *ctx, HEADER *h, int flag, int bf, int upd_ctx)
610 if (h->searched && (changed != h->changed || deleted != ctx->deleted || tagged != ctx->tagged || flagged != ctx->flagged))
615 void mutt_tag_set_flag (int flag, int bf)
616 *** mutt-1.5.19-orig/functions.h 2009-01-05 13:20:53.000000000 -0600
617 --- mutt-1.5.19-patched/functions.h 2009-05-21 23:08:38.000000000 -0500
621 { "decrypt-save", OP_DECRYPT_SAVE, NULL },
624 + { "sidebar-scroll-up", OP_SIDEBAR_SCROLL_UP, NULL },
625 + { "sidebar-scroll-down", OP_SIDEBAR_SCROLL_DOWN, NULL },
626 + { "sidebar-next", OP_SIDEBAR_NEXT, NULL },
627 + { "sidebar-prev", OP_SIDEBAR_PREV, NULL },
628 + { "sidebar-open", OP_SIDEBAR_OPEN, NULL },
636 { "what-key", OP_WHAT_KEY, NULL },
638 + { "sidebar-scroll-up", OP_SIDEBAR_SCROLL_UP, NULL },
639 + { "sidebar-scroll-down", OP_SIDEBAR_SCROLL_DOWN, NULL },
640 + { "sidebar-next", OP_SIDEBAR_NEXT, NULL },
641 + { "sidebar-prev", OP_SIDEBAR_PREV, NULL },
642 + { "sidebar-open", OP_SIDEBAR_OPEN, NULL },
646 *** mutt-1.5.19-orig/globals.h 2009-01-03 17:27:10.000000000 -0600
647 --- mutt-1.5.19-patched/globals.h 2009-05-21 23:08:38.000000000 -0500
651 WHERE char *SendCharset;
652 WHERE char *Sendmail;
654 + WHERE char *SidebarDelim;
655 WHERE char *Signature;
656 WHERE char *SimpleSearch;
661 WHERE short ScoreThresholdRead;
662 WHERE short ScoreThresholdFlag;
664 + WHERE struct buffy_t *CurBuffy INITVAL(0);
665 + WHERE short DrawFullLine INITVAL(0);
666 + WHERE short SidebarWidth;
668 WHERE short ImapKeepalive;
669 WHERE short ImapPipelineDepth;
670 *** mutt-1.5.19-orig/init.h 2009-01-05 13:20:53.000000000 -0600
671 --- mutt-1.5.19-patched/init.h 2009-05-21 23:08:38.000000000 -0500
675 ** you may \fIunset\fP this setting.
678 + {"sidebar_delim", DT_STR, R_BOTH, UL &SidebarDelim, "|"},
681 + ** This specifies the delimiter between the sidebar (if visible) and
684 + { "sidebar_visible", DT_BOOL, R_BOTH, OPTSIDEBAR, 0 },
687 + ** This specifies whether or not to show sidebar (left-side list of folders).
689 + { "sidebar_width", DT_NUM, R_BOTH, UL &SidebarWidth, 0 },
692 + ** The width of the sidebar.
694 { "pgp_use_gpg_agent", DT_BOOL, R_NONE, OPTUSEGPGAGENT, 0},
697 *** mutt-1.5.19-orig/mailbox.h 2008-03-19 15:07:06.000000000 -0500
698 --- mutt-1.5.19-patched/mailbox.h 2009-05-21 23:08:38.000000000 -0500
702 #define M_NEWFOLDER (1<<4) /* create a new folder - same as M_APPEND, but uses
703 * safe_fopen() for mbox-style folders.
705 + #define M_PEEK (1<<5) /* revert atime back after taking a look (if applicable) */
707 /* mx_open_new_message() */
708 #define M_ADD_FROM 1 /* add a From_ line */
709 *** mutt-1.5.19-orig/Makefile.am 2009-01-05 13:20:53.000000000 -0600
710 --- mutt-1.5.19-patched/Makefile.am 2009-05-21 23:08:38.000000000 -0500
713 score.c send.c sendlib.c signal.c sort.c \
714 status.c system.c thread.c charset.c history.c lib.c \
715 muttlib.c editmsg.c mbyte.c \
716 ! url.c ascii.c crypt-mod.c crypt-mod.h
718 nodist_mutt_SOURCES = $(BUILT_SOURCES)
721 score.c send.c sendlib.c signal.c sort.c \
722 status.c system.c thread.c charset.c history.c lib.c \
723 muttlib.c editmsg.c mbyte.c \
724 ! url.c ascii.c crypt-mod.c crypt-mod.h \
727 nodist_mutt_SOURCES = $(BUILT_SOURCES)
729 *** mutt-1.5.19-orig/Makefile.in 2009-01-05 13:24:13.000000000 -0600
730 --- mutt-1.5.19-patched/Makefile.in 2009-05-21 23:08:38.000000000 -0500
733 system.$(OBJEXT) thread.$(OBJEXT) charset.$(OBJEXT) \
734 history.$(OBJEXT) lib.$(OBJEXT) muttlib.$(OBJEXT) \
735 editmsg.$(OBJEXT) mbyte.$(OBJEXT) url.$(OBJEXT) \
736 ! ascii.$(OBJEXT) crypt-mod.$(OBJEXT)
737 am__objects_1 = patchlist.$(OBJEXT)
738 nodist_mutt_OBJECTS = $(am__objects_1)
739 mutt_OBJECTS = $(am_mutt_OBJECTS) $(nodist_mutt_OBJECTS)
741 system.$(OBJEXT) thread.$(OBJEXT) charset.$(OBJEXT) \
742 history.$(OBJEXT) lib.$(OBJEXT) muttlib.$(OBJEXT) \
743 editmsg.$(OBJEXT) mbyte.$(OBJEXT) url.$(OBJEXT) \
744 ! ascii.$(OBJEXT) crypt-mod.$(OBJEXT) \
746 am__objects_1 = patchlist.$(OBJEXT)
747 nodist_mutt_OBJECTS = $(am__objects_1)
748 mutt_OBJECTS = $(am_mutt_OBJECTS) $(nodist_mutt_OBJECTS)
751 score.c send.c sendlib.c signal.c sort.c \
752 status.c system.c thread.c charset.c history.c lib.c \
753 muttlib.c editmsg.c mbyte.c \
754 ! url.c ascii.c crypt-mod.c crypt-mod.h
756 nodist_mutt_SOURCES = $(BUILT_SOURCES)
757 mutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(MUTTLIBS) \
759 score.c send.c sendlib.c signal.c sort.c \
760 status.c system.c thread.c charset.c history.c lib.c \
761 muttlib.c editmsg.c mbyte.c \
762 ! url.c ascii.c crypt-mod.c crypt-mod.h \
765 nodist_mutt_SOURCES = $(BUILT_SOURCES)
766 mutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(MUTTLIBS) \
770 muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \
771 ChangeLog mkchangelog.sh mutt_idna.h \
772 ! snprintf.c regex.c crypt-gpgme.h hcachever.sh.in
774 EXTRA_SCRIPTS = smime_keys
775 mutt_dotlock_SOURCES = mutt_dotlock.c
778 muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \
779 ChangeLog mkchangelog.sh mutt_idna.h \
780 ! snprintf.c regex.c crypt-gpgme.h sidebar.h hcachever.sh.in
782 EXTRA_SCRIPTS = smime_keys
783 mutt_dotlock_SOURCES = mutt_dotlock.c
784 *** mutt-1.5.19-orig/mbox.c 2008-08-15 13:30:12.000000000 -0500
785 --- mutt-1.5.19-patched/mbox.c 2009-05-21 23:08:38.000000000 -0500
789 mutt_perror (ctx->path);
792 + ctx->atime = sb.st_atime;
793 ctx->mtime = sb.st_mtime;
794 ctx->size = sb.st_size;
800 ctx->size = sb.st_size;
801 ctx->mtime = sb.st_mtime;
802 + ctx->atime = sb.st_atime;
804 #ifdef NFS_ATTRIBUTE_HACK
805 if (sb.st_mtime > sb.st_atime)
806 *** mutt-1.5.19-orig/menu.c 2009-01-05 13:20:53.000000000 -0600
807 --- mutt-1.5.19-patched/menu.c 2009-05-21 23:08:38.000000000 -0500
811 #include "mutt_curses.h"
812 #include "mutt_menu.h"
814 + #include "sidebar.h"
821 char *scratch = safe_strdup (s);
822 int shift = option (OPTARROWCURSOR) ? 3 : 0;
823 ! int cols = COLS - shift;
825 mutt_format_string (s, n, cols, cols, FMT_LEFT, ' ', scratch, mutt_strlen (scratch), 1);
829 char *scratch = safe_strdup (s);
830 int shift = option (OPTARROWCURSOR) ? 3 : 0;
831 ! int cols = COLS - shift - SidebarWidth;
833 mutt_format_string (s, n, cols, cols, FMT_LEFT, ' ', scratch, mutt_strlen (scratch), 1);
838 char buf[LONG_STRING];
842 for (i = menu->top; i < menu->top + menu->pagelen; i++)
847 if (option (OPTARROWCURSOR))
849 attrset (menu->color (i));
850 ! CLEARLINE (i - menu->top + menu->offset);
852 if (i == menu->current)
855 if (option (OPTARROWCURSOR))
857 attrset (menu->color (i));
858 ! CLEARLINE_WIN (i - menu->top + menu->offset);
860 if (i == menu->current)
864 BKGDSET (MT_COLOR_INDICATOR);
867 ! CLEARLINE (i - menu->top + menu->offset);
868 print_enriched_string (menu->color(i), (unsigned char *) buf, i != menu->current);
869 SETCOLOR (MT_COLOR_NORMAL);
870 BKGDSET (MT_COLOR_NORMAL);
874 ! CLEARLINE (i - menu->top + menu->offset);
879 BKGDSET (MT_COLOR_INDICATOR);
882 ! CLEARLINE_WIN (i - menu->top + menu->offset);
883 print_enriched_string (menu->color(i), (unsigned char *) buf, i != menu->current);
884 SETCOLOR (MT_COLOR_NORMAL);
885 BKGDSET (MT_COLOR_NORMAL);
889 ! CLEARLINE_WIN (i - menu->top + menu->offset);
898 ! move (menu->oldcurrent + menu->offset - menu->top, 0);
899 SETCOLOR (MT_COLOR_NORMAL);
900 BKGDSET (MT_COLOR_NORMAL);
906 ! move (menu->oldcurrent + menu->offset - menu->top, SidebarWidth);
907 SETCOLOR (MT_COLOR_NORMAL);
908 BKGDSET (MT_COLOR_NORMAL);
913 menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent);
914 menu_pad_string (buf, sizeof (buf));
915 ! move (menu->oldcurrent + menu->offset - menu->top, 3);
916 print_enriched_string (menu->color(menu->oldcurrent), (unsigned char *) buf, 1);
917 SETCOLOR (MT_COLOR_NORMAL);
920 /* now draw it in the new location */
921 ! move (menu->current + menu->offset - menu->top, 0);
922 attrset (menu->color (menu->current));
923 ADDCOLOR (MT_COLOR_INDICATOR);
927 menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent);
928 menu_pad_string (buf, sizeof (buf));
929 ! move (menu->oldcurrent + menu->offset - menu->top, SidebarWidth + 3);
930 print_enriched_string (menu->color(menu->oldcurrent), (unsigned char *) buf, 1);
931 SETCOLOR (MT_COLOR_NORMAL);
934 /* now draw it in the new location */
935 ! move (menu->current + menu->offset - menu->top, SidebarWidth);
936 attrset (menu->color (menu->current));
937 ADDCOLOR (MT_COLOR_INDICATOR);
941 attrset (menu->color (menu->current));
942 ADDCOLOR (MT_COLOR_INDICATOR);
943 BKGDSET (MT_COLOR_INDICATOR);
944 ! CLEARLINE (menu->current - menu->top + menu->offset);
945 print_enriched_string (menu->color(menu->current), (unsigned char *) buf, 0);
946 SETCOLOR (MT_COLOR_NORMAL);
947 BKGDSET (MT_COLOR_NORMAL);
949 attrset (menu->color (menu->current));
950 ADDCOLOR (MT_COLOR_INDICATOR);
951 BKGDSET (MT_COLOR_INDICATOR);
952 ! CLEARLINE_WIN (menu->current - menu->top + menu->offset);
953 print_enriched_string (menu->color(menu->current), (unsigned char *) buf, 0);
954 SETCOLOR (MT_COLOR_NORMAL);
955 BKGDSET (MT_COLOR_NORMAL);
959 char buf[LONG_STRING];
961 ! move (menu->current + menu->offset - menu->top, 0);
962 menu_make_entry (buf, sizeof (buf), menu, menu->current);
963 menu_pad_string (buf, sizeof (buf));
967 char buf[LONG_STRING];
969 ! move (menu->current + menu->offset - menu->top, SidebarWidth);
970 menu_make_entry (buf, sizeof (buf), menu, menu->current);
971 menu_pad_string (buf, sizeof (buf));
977 if (option (OPTARROWCURSOR))
978 ! move (menu->current - menu->top + menu->offset, 2);
979 else if (option (OPTBRAILLEFRIENDLY))
980 move (menu->current - menu->top + menu->offset, 0);
985 if (option (OPTARROWCURSOR))
986 ! move (menu->current - menu->top + menu->offset, SidebarWidth + 2);
987 else if (option (OPTBRAILLEFRIENDLY))
988 move (menu->current - menu->top + menu->offset, 0);
990 *** mutt-1.5.19-orig/mutt_curses.h 2008-03-19 15:07:57.000000000 -0500
991 --- mutt-1.5.19-patched/mutt_curses.h 2009-05-21 23:08:38.000000000 -0500
998 + #define CLEARLINE_WIN(x) move(x,SidebarWidth), clrtoeol()
999 #define CLEARLINE(x) move(x,0), clrtoeol()
1000 #define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x)
1001 #define BEEP() do { if (option (OPTBEEP)) beep(); } while (0)
1013 *** mutt-1.5.19-orig/mutt.h 2008-09-25 17:00:03.000000000 -0500
1014 --- mutt-1.5.19-patched/mutt.h 2009-05-21 23:08:38.000000000 -0500
1038 unsigned int quiet : 1; /* inhibit status messages? */
1039 unsigned int collapsed : 1; /* are all threads collapsed? */
1040 unsigned int closing : 1; /* mailbox is being closed */
1041 + unsigned int peekonly : 1; /* just taking a glance, revert atime */
1044 void *data; /* driver specific data */
1045 *** mutt-1.5.19-orig/muttlib.c 2009-01-05 13:20:53.000000000 -0600
1046 --- mutt-1.5.19-patched/muttlib.c 2009-05-21 23:08:38.000000000 -0500
1052 /* see if there's room to add content, else ignore */
1053 + if ( DrawFullLine )
1055 if ((col < COLS && wlen < destlen) || soft)
1067 + if ((col < COLS-SidebarWidth && wlen < destlen) || soft)
1071 + /* get contents after padding */
1072 + mutt_FormatString (buf, sizeof (buf), 0, src + pl, callback, data, flags);
1073 + len = mutt_strlen (buf);
1074 + wid = mutt_strwidth (buf);
1076 + /* try to consume as many columns as we can, if we don't have
1077 + * memory for that, use as much memory as possible */
1078 + pad = (COLS - SidebarWidth - col - wid) / pw;
1079 + if (pad > 0 && wlen + (pad * pl) + len > destlen)
1080 + pad = ((signed)(destlen - wlen - len)) / pl;
1085 + memcpy (wptr, src, pl);
1091 + else if (soft && pad < 0)
1093 + /* \0-terminate dest for length computation in mutt_wstr_trunc() */
1095 + /* make sure right part is at most as wide as display */
1096 + len = mutt_wstr_trunc (buf, destlen, COLS, &wid);
1097 + /* truncate left so that right part fits completely in */
1098 + wlen = mutt_wstr_trunc (dest, destlen - len, col + pad, &col);
1099 + wptr = dest + wlen;
1101 + if (len + wlen > destlen)
1102 + len = mutt_wstr_trunc (buf, destlen - wlen, COLS - SidebarWidth - col, NULL);
1103 + memcpy (wptr, buf, len);
1110 break; /* skip rest of input */
1113 *** mutt-1.5.19-orig/mx.c 2009-01-05 13:20:53.000000000 -0600
1114 --- mutt-1.5.19-patched/mx.c 2009-05-21 23:08:38.000000000 -0500
1118 * M_APPEND open mailbox for appending
1119 * M_READONLY open mailbox in read-only mode
1120 * M_QUIET only print error messages
1121 + * M_PEEK revert atime where applicable
1122 * ctx if non-null, context struct to use
1124 CONTEXT *mx_open_mailbox (const char *path, int flags, CONTEXT *pctx)
1129 if (flags & M_READONLY)
1131 + if (flags & M_PEEK)
1132 + ctx->peekonly = 1;
1134 if (flags & (M_APPEND|M_NEWFOLDER))
1139 void mx_fastclose_mailbox (CONTEXT *ctx)
1142 + #ifndef BUFFY_SIZE
1143 + struct utimbuf ut;
1148 + #ifndef BUFFY_SIZE
1149 + /* fix up the times so buffy won't get confused */
1150 + if (ctx->peekonly && ctx->path && ctx->mtime > ctx->atime)
1152 + ut.actime = ctx->atime;
1153 + ut.modtime = ctx->mtime;
1154 + utime (ctx->path, &ut);
1159 ctx->mx_close (ctx);
1160 *** mutt-1.5.19-orig/OPS 2008-03-19 15:07:57.000000000 -0500
1161 --- mutt-1.5.19-patched/OPS 2009-05-21 23:08:38.000000000 -0500
1165 OP_MAIN_SHOW_LIMIT "show currently active limit pattern"
1166 OP_MAIN_COLLAPSE_THREAD "collapse/uncollapse current thread"
1167 OP_MAIN_COLLAPSE_ALL "collapse/uncollapse all threads"
1168 + OP_SIDEBAR_SCROLL_UP "scroll the mailbox pane up 1 page"
1169 + OP_SIDEBAR_SCROLL_DOWN "scroll the mailbox pane down 1 page"
1170 + OP_SIDEBAR_NEXT "go down to next mailbox"
1171 + OP_SIDEBAR_PREV "go to previous mailbox"
1172 + OP_SIDEBAR_OPEN "open hilighted mailbox"
1173 *** mutt-1.5.19-orig/pager.c 2009-01-05 13:20:53.000000000 -0600
1174 --- mutt-1.5.19-patched/pager.c 2009-05-21 23:08:38.000000000 -0500
1181 + #include "sidebar.h"
1183 #include "mutt_crypt.h"
1190 int wrap_cols = mutt_term_width ((flags & M_PAGER_NOWRAP) ? 0 : Wrap);
1192 + wrap_cols -= SidebarWidth;
1194 /* FIXME: this should come from lineInfo */
1195 memset(&mbstate, 0, sizeof(mbstate));
1198 if ((redraw & REDRAW_BODY) || topline != oldtopline)
1201 ! move (bodyoffset, 0);
1202 curline = oldtopline = topline;
1206 if ((redraw & REDRAW_BODY) || topline != oldtopline)
1209 ! move (bodyoffset, SidebarWidth);
1210 curline = oldtopline = topline;
1216 &QuoteList, &q_level, &force_redraw, &SearchRE) > 0)
1219 + move(lines + bodyoffset, SidebarWidth);
1221 last_offset = lineInfo[curline].offset;
1222 } while (force_redraw);
1229 + move(lines + bodyoffset, SidebarWidth);
1231 /* We are going to update the pager status bar, so it isn't
1232 * necessary to reset to normal color now. */
1235 /* print out the pager status bar */
1236 SETCOLOR (MT_COLOR_STATUS);
1237 BKGDSET (MT_COLOR_STATUS);
1238 ! CLEARLINE (statusoffset);
1239 if (IsHeader (extra))
1241 ! size_t l1 = COLS * MB_LEN_MAX;
1242 size_t l2 = sizeof (buffer);
1243 hfi.hdr = extra->hdr;
1244 mutt_make_string_info (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt), &hfi, M_FORMAT_MAKEPRINT);
1246 else if (IsMsgAttach (extra))
1248 ! size_t l1 = COLS * MB_LEN_MAX;
1249 size_t l2 = sizeof (buffer);
1250 hfi.hdr = extra->bdy->hdr;
1251 mutt_make_string_info (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt), &hfi, M_FORMAT_MAKEPRINT);
1253 ! mutt_paddstr (COLS, IsHeader (extra) || IsMsgAttach (extra) ? buffer : banner);
1254 BKGDSET (MT_COLOR_NORMAL);
1255 SETCOLOR (MT_COLOR_NORMAL);
1258 /* print out the pager status bar */
1259 SETCOLOR (MT_COLOR_STATUS);
1260 BKGDSET (MT_COLOR_STATUS);
1261 ! CLEARLINE_WIN (statusoffset);
1262 if (IsHeader (extra))
1264 ! size_t l1 = (COLS-SidebarWidth) * MB_LEN_MAX;
1265 size_t l2 = sizeof (buffer);
1266 hfi.hdr = extra->hdr;
1267 mutt_make_string_info (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt), &hfi, M_FORMAT_MAKEPRINT);
1269 else if (IsMsgAttach (extra))
1271 ! size_t l1 = (COLS-SidebarWidth) * MB_LEN_MAX;
1272 size_t l2 = sizeof (buffer);
1273 hfi.hdr = extra->bdy->hdr;
1274 mutt_make_string_info (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt), &hfi, M_FORMAT_MAKEPRINT);
1276 ! mutt_paddstr (COLS-SidebarWidth, IsHeader (extra) || IsMsgAttach (extra) ? buffer : banner);
1277 BKGDSET (MT_COLOR_NORMAL);
1278 SETCOLOR (MT_COLOR_NORMAL);
1282 /* redraw the pager_index indicator, because the
1283 * flags for this message might have changed. */
1284 menu_redraw_current (index);
1286 /* print out the index status bar */
1287 menu_status_line (buffer, sizeof (buffer), index, NONULL(Status));
1289 ! move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), 0);
1290 SETCOLOR (MT_COLOR_STATUS);
1291 BKGDSET (MT_COLOR_STATUS);
1292 ! mutt_paddstr (COLS, buffer);
1293 SETCOLOR (MT_COLOR_NORMAL);
1294 BKGDSET (MT_COLOR_NORMAL);
1299 if (option(OPTBRAILLEFRIENDLY)) {
1301 /* redraw the pager_index indicator, because the
1302 * flags for this message might have changed. */
1303 menu_redraw_current (index);
1304 + draw_sidebar(MENU_PAGER);
1306 /* print out the index status bar */
1307 menu_status_line (buffer, sizeof (buffer), index, NONULL(Status));
1309 ! move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), SidebarWidth);
1310 SETCOLOR (MT_COLOR_STATUS);
1311 BKGDSET (MT_COLOR_STATUS);
1312 ! mutt_paddstr (COLS-SidebarWidth, buffer);
1313 SETCOLOR (MT_COLOR_NORMAL);
1314 BKGDSET (MT_COLOR_NORMAL);
1317 + /* if we're not using the index, update every time */
1319 + draw_sidebar(MENU_PAGER);
1323 if (option(OPTBRAILLEFRIENDLY)) {
1330 + case OP_SIDEBAR_SCROLL_UP:
1331 + case OP_SIDEBAR_SCROLL_DOWN:
1332 + case OP_SIDEBAR_NEXT:
1333 + case OP_SIDEBAR_PREV:
1334 + scroll_sidebar(ch, MENU_PAGER);
1340 *** mutt-1.5.19-orig/PATCHES 2008-03-19 15:07:06.000000000 -0500
1341 --- mutt-1.5.19-patched/PATCHES 2009-05-22 08:45:39.000000000 -0500
1345 + patch-1.5.19.sidebar.20090522.txt
1346 *** mutt-1.5.19-orig/sidebar.c 1969-12-31 18:00:00.000000000 -0600
1347 --- mutt-1.5.19-patched/sidebar.c 2009-05-21 23:08:38.000000000 -0500
1352 + * Copyright (C) ????-2004 Justin Hibbits <jrh29@po.cwru.edu>
1353 + * Copyright (C) 2004 Thomer M. Gil <mutt@thomer.com>
1355 + * This program is free software; you can redistribute it and/or modify
1356 + * it under the terms of the GNU General Public License as published by
1357 + * the Free Software Foundation; either version 2 of the License, or
1358 + * (at your option) any later version.
1360 + * This program is distributed in the hope that it will be useful,
1361 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1362 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1363 + * GNU General Public License for more details.
1365 + * You should have received a copy of the GNU General Public License
1366 + * along with this program; if not, write to the Free Software
1367 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
1372 + # include "config.h"
1376 + #include "mutt_menu.h"
1377 + #include "mutt_curses.h"
1378 + #include "sidebar.h"
1379 + #include "buffy.h"
1380 + #include <libgen.h>
1381 + #include "keymap.h"
1382 + #include <stdbool.h>
1384 + /*BUFFY *CurBuffy = 0;*/
1385 + static BUFFY *TopBuffy = 0;
1386 + static BUFFY *BottomBuffy = 0;
1387 + static int known_lines = 0;
1389 + static int quick_log10(int n)
1392 + sprintf(string, "%d", n);
1393 + return strlen(string);
1396 + void calc_boundaries (int menu)
1398 + BUFFY *tmp = Incoming;
1400 + if ( known_lines != LINES ) {
1401 + TopBuffy = BottomBuffy = 0;
1402 + known_lines = LINES;
1404 + for ( ; tmp->next != 0; tmp = tmp->next )
1405 + tmp->next->prev = tmp;
1407 + if ( TopBuffy == 0 && BottomBuffy == 0 )
1408 + TopBuffy = Incoming;
1409 + if ( BottomBuffy == 0 ) {
1410 + int count = LINES - 2 - (menu != MENU_PAGER || option(OPTSTATUSONTOP));
1411 + BottomBuffy = TopBuffy;
1412 + while ( --count && BottomBuffy->next )
1413 + BottomBuffy = BottomBuffy->next;
1415 + else if ( TopBuffy == CurBuffy->next ) {
1416 + int count = LINES - 2 - (menu != MENU_PAGER);
1417 + BottomBuffy = CurBuffy;
1418 + tmp = BottomBuffy;
1419 + while ( --count && tmp->prev)
1423 + else if ( BottomBuffy == CurBuffy->prev ) {
1424 + int count = LINES - 2 - (menu != MENU_PAGER);
1425 + TopBuffy = CurBuffy;
1427 + while ( --count && tmp->next )
1429 + BottomBuffy = tmp;
1433 + char *make_sidebar_entry(char *box, int size, int new, int flagged)
1435 + static char *entry = 0;
1438 + int delim_len = strlen(SidebarDelim);
1440 + c = realloc(entry, SidebarWidth - delim_len + 2);
1441 + if ( c ) entry = c;
1442 + entry[SidebarWidth - delim_len + 1] = 0;
1443 + for (; i < SidebarWidth - delim_len + 1; entry[i++] = ' ' );
1445 + strncpy( entry, box, i < (SidebarWidth - delim_len + 1) ? i : (SidebarWidth - delim_len + 1) );
1448 + sprintf(entry + SidebarWidth - delim_len - 3, "?");
1450 + if (flagged > 0) {
1452 + entry + SidebarWidth - delim_len - 5 - quick_log10(size) - quick_log10(new) - quick_log10(flagged),
1453 + "% d(%d)[%d]", size, new, flagged);
1456 + entry + SidebarWidth - delim_len - 3 - quick_log10(size) - quick_log10(new),
1457 + "% d(%d)", size, new);
1459 + } else if (flagged > 0) {
1460 + sprintf( entry + SidebarWidth - delim_len - 3 - quick_log10(size) - quick_log10(flagged), "% d[%d]", size, flagged);
1462 + sprintf( entry + SidebarWidth - delim_len - 1 - quick_log10(size), "% d", size);
1467 + void set_curbuffy(char buf[LONG_STRING])
1469 + BUFFY* tmp = CurBuffy = Incoming;
1475 + if(!strcmp(tmp->path, buf)) {
1487 + int draw_sidebar(int menu) {
1489 + int lines = option(OPTHELP) ? 1 : 0;
1491 + #ifndef USE_SLANG_CURSES
1494 + short delim_len = strlen(SidebarDelim);
1497 + static bool initialized = false;
1498 + static int prev_show_value;
1499 + static short saveSidebarWidth;
1501 + /* initialize first time */
1502 + if(!initialized) {
1503 + prev_show_value = option(OPTSIDEBAR);
1504 + saveSidebarWidth = SidebarWidth;
1505 + if(!option(OPTSIDEBAR)) SidebarWidth = 0;
1506 + initialized = true;
1509 + /* save or restore the value SidebarWidth */
1510 + if(prev_show_value != option(OPTSIDEBAR)) {
1511 + if(prev_show_value && !option(OPTSIDEBAR)) {
1512 + saveSidebarWidth = SidebarWidth;
1514 + } else if(!prev_show_value && option(OPTSIDEBAR)) {
1515 + SidebarWidth = saveSidebarWidth;
1517 + prev_show_value = option(OPTSIDEBAR);
1521 + // if ( SidebarWidth == 0 ) return 0;
1522 + if (SidebarWidth > 0 && option (OPTSIDEBAR)
1523 + && delim_len >= SidebarWidth) {
1524 + unset_option (OPTSIDEBAR);
1525 + /* saveSidebarWidth = SidebarWidth; */
1526 + if (saveSidebarWidth > delim_len) {
1527 + SidebarWidth = saveSidebarWidth;
1528 + mutt_error (_("Value for sidebar_delim is too long. Disabling sidebar."));
1532 + mutt_error (_("Value for sidebar_delim is too long. Disabling sidebar. Please set your sidebar_width to a sane value."));
1533 + sleep (4); /* the advise to set a sane value should be seen long enough */
1535 + saveSidebarWidth = 0;
1539 + if ( SidebarWidth == 0 || !option(OPTSIDEBAR)) {
1540 + if (SidebarWidth > 0) {
1541 + saveSidebarWidth = SidebarWidth;
1544 + unset_option(OPTSIDEBAR);
1548 + /* get attributes for divider */
1549 + SETCOLOR(MT_COLOR_STATUS);
1550 + #ifndef USE_SLANG_CURSES
1551 + attr_get(&attrs, &color_pair, 0);
1553 + color_pair = attr_get();
1555 + SETCOLOR(MT_COLOR_NORMAL);
1557 + /* draw the divider */
1559 + for ( ; lines < LINES-1-(menu != MENU_PAGER || option(OPTSTATUSONTOP)); lines++ ) {
1560 + move(lines, SidebarWidth - delim_len);
1561 + addstr(NONULL(SidebarDelim));
1562 + #ifndef USE_SLANG_CURSES
1563 + mvchgat(lines, SidebarWidth - delim_len, delim_len, 0, color_pair, NULL);
1567 + if ( Incoming == 0 ) return 0;
1568 + lines = option(OPTHELP) ? 1 : 0; /* go back to the top */
1570 + if ( known_lines != LINES || TopBuffy == 0 || BottomBuffy == 0 )
1571 + calc_boundaries(menu);
1572 + if ( CurBuffy == 0 ) CurBuffy = Incoming;
1576 + SETCOLOR(MT_COLOR_NORMAL);
1578 + for ( ; tmp && lines < LINES-1 - (menu != MENU_PAGER || option(OPTSTATUSONTOP)); tmp = tmp->next ) {
1579 + if ( tmp == CurBuffy )
1580 + SETCOLOR(MT_COLOR_INDICATOR);
1581 + else if ( tmp->msg_unread > 0 )
1582 + SETCOLOR(MT_COLOR_NEW);
1583 + else if ( tmp->msg_flagged > 0 )
1584 + SETCOLOR(MT_COLOR_FLAGGED);
1586 + SETCOLOR(MT_COLOR_NORMAL);
1589 + if ( Context && !strcmp( tmp->path, Context->path ) ) {
1590 + tmp->msg_unread = Context->unread;
1591 + tmp->msgcount = Context->msgcount;
1592 + tmp->msg_flagged = Context->flagged;
1594 + // check whether Maildir is a prefix of the current folder's path
1595 + short maildir_is_prefix = 0;
1596 + if ( (strlen(tmp->path) > strlen(Maildir)) &&
1597 + (strncmp(Maildir, tmp->path, strlen(Maildir)) == 0) )
1598 + maildir_is_prefix = 1;
1599 + // calculate depth of current folder and generate its display name with indented spaces
1600 + int sidebar_folder_depth = 0;
1601 + char *sidebar_folder_name;
1602 + sidebar_folder_name = basename(tmp->path);
1603 + if ( maildir_is_prefix ) {
1604 + char *tmp_folder_name;
1606 + tmp_folder_name = tmp->path + strlen(Maildir);
1607 + for (i = 0; i < strlen(tmp->path) - strlen(Maildir); i++) {
1608 + if (tmp_folder_name[i] == '/') sidebar_folder_depth++;
1610 + if (sidebar_folder_depth > 0) {
1611 + sidebar_folder_name = malloc(strlen(basename(tmp->path)) + sidebar_folder_depth + 1);
1612 + for (i=0; i < sidebar_folder_depth; i++)
1613 + sidebar_folder_name[i]=' ';
1614 + sidebar_folder_name[i]=0;
1615 + strncat(sidebar_folder_name, basename(tmp->path), strlen(basename(tmp->path)) + sidebar_folder_depth);
1618 + printw( "%.*s", SidebarWidth - delim_len + 1,
1619 + make_sidebar_entry(sidebar_folder_name, tmp->msgcount,
1620 + tmp->msg_unread, tmp->msg_flagged));
1621 + if (sidebar_folder_depth > 0)
1622 + free(sidebar_folder_name);
1625 + SETCOLOR(MT_COLOR_NORMAL);
1626 + for ( ; lines < LINES-1 - (menu != MENU_PAGER || option(OPTSTATUSONTOP)); lines++ ) {
1629 + for ( ; i < SidebarWidth - delim_len; i++ )
1636 + void set_buffystats(CONTEXT* Context)
1638 + BUFFY *tmp = Incoming;
1640 + if(Context && !strcmp(tmp->path, Context->path)) {
1641 + tmp->msg_unread = Context->unread;
1642 + tmp->msgcount = Context->msgcount;
1649 + void scroll_sidebar(int op, int menu)
1651 + if(!SidebarWidth) return;
1652 + if(!CurBuffy) return;
1655 + case OP_SIDEBAR_NEXT:
1656 + if ( CurBuffy->next == NULL ) return;
1657 + CurBuffy = CurBuffy->next;
1659 + case OP_SIDEBAR_PREV:
1660 + if ( CurBuffy->prev == NULL ) return;
1661 + CurBuffy = CurBuffy->prev;
1663 + case OP_SIDEBAR_SCROLL_UP:
1664 + CurBuffy = TopBuffy;
1665 + if ( CurBuffy != Incoming ) {
1666 + calc_boundaries(menu);
1667 + CurBuffy = CurBuffy->prev;
1670 + case OP_SIDEBAR_SCROLL_DOWN:
1671 + CurBuffy = BottomBuffy;
1672 + if ( CurBuffy->next ) {
1673 + calc_boundaries(menu);
1674 + CurBuffy = CurBuffy->next;
1680 + calc_boundaries(menu);
1681 + draw_sidebar(menu);
1684 *** mutt-1.5.19-orig/sidebar.h 1969-12-31 18:00:00.000000000 -0600
1685 --- mutt-1.5.19-patched/sidebar.h 2009-05-21 23:08:38.000000000 -0500
1690 + * Copyright (C) ????-2004 Justin Hibbits <jrh29@po.cwru.edu>
1691 + * Copyright (C) 2004 Thomer M. Gil <mutt@thomer.com>
1693 + * This program is free software; you can redistribute it and/or modify
1694 + * it under the terms of the GNU General Public License as published by
1695 + * the Free Software Foundation; either version 2 of the License, or
1696 + * (at your option) any later version.
1698 + * This program is distributed in the hope that it will be useful,
1699 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1700 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1701 + * GNU General Public License for more details.
1703 + * You should have received a copy of the GNU General Public License
1704 + * along with this program; if not, write to the Free Software
1705 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
1711 + struct MBOX_LIST {
1717 + /* parameter is whether or not to go to the status line */
1718 + /* used for omitting the last | that covers up the status bar in the index */
1719 + int draw_sidebar(int);
1720 + void scroll_sidebar(int, int);
1721 + void set_curbuffy(char*);
1722 + void set_buffystats(CONTEXT*);
1724 + #endif /* SIDEBAR_H */
1725 *** mutt-1.5.19-orig/doc/Muttrc 2009-01-05 18:36:17.000000000 -0600
1726 --- mutt-1.5.19-patched/doc/Muttrc 2009-05-21 23:08:38.000000000 -0500
1733 + # set sidebar_visible=no
1735 + # Name: sidebar_visible
1740 + # This specifies whether or not to show sidebar (left-side list of folders).
1743 + # set sidebar_width=0
1745 + # Name: sidebar_width
1750 + # The width of the sidebar.
1753 # set crypt_autosign=no
1755 # Name: crypt_autosign
1756 *** mutt-1.5.19-orig/imap/imap.c 2009-01-05 17:50:39.000000000 -0600
1757 --- mutt-1.5.19-patched/imap/imap.c 2009-05-21 23:08:38.000000000 -0500
1761 imap_munge_mbox_name (munged, sizeof (munged), name);
1762 snprintf (command, sizeof (command),
1763 ! "STATUS %s (UIDNEXT UIDVALIDITY UNSEEN RECENT)", munged);
1765 if (imap_exec (idata, command, IMAP_CMD_QUEUE) < 0)
1769 imap_munge_mbox_name (munged, sizeof (munged), name);
1770 snprintf (command, sizeof (command),
1771 ! "STATUS %s (UIDNEXT UIDVALIDITY UNSEEN RECENT MESSAGES)", munged);
1773 if (imap_exec (idata, command, IMAP_CMD_QUEUE) < 0)
1775 *** mutt-1.5.19-orig/imap/command.c 2009-01-05 17:57:30.000000000 -0600
1776 --- mutt-1.5.19-patched/imap/command.c 2009-05-21 23:08:38.000000000 -0500
1781 status->uidnext = oldun;
1783 + /* Added to make the sidebar show the correct numbers */
1784 + if (status->messages)
1786 + inc->msgcount = status->messages;
1787 + inc->msg_unread = status->unseen;