1 diff -N -c -r mutt-1.5.9i-orig/buffy.c mutt-1.5.9i-patched/buffy.c
2 *** mutt-1.5.9i-orig/buffy.c 2005-02-03 13:47:52.000000000 -0500
3 --- mutt-1.5.9i-patched/buffy.c 2005-05-25 14:53:34.000000000 -0400
6 char path[_POSIX_PATH_MAX];
11 /* update postponed count as well, on force */
14 char path[_POSIX_PATH_MAX];
15 struct stat contex_sb;
19 /* update postponed count as well, on force */
25 for (tmp = Incoming; tmp; tmp = tmp->next)
27 + if ( tmp->new == 1 )
49 ! if (STAT_CHECK || tmp->msgcount == 0)
55 ! /* parse the mailbox, to see how much mail there is */
56 ! ctx = mx_open_mailbox( tmp->path, M_READONLY | M_QUIET | M_NOSORT | M_PEEK, NULL);
59 ! msgcount = ctx->msgcount;
60 ! msg_unread = ctx->unread;
61 ! mx_close_mailbox(ctx, 0);
64 ! tmp->msgcount = msgcount;
65 ! tmp->msg_unread = msg_unread;
67 ! tmp->has_new = tmp->new = 1;
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->new = imap_mailbox_check (tmp->path, 1)) > 0)
115 if (tmp->newly_created &&
116 (sb.st_ctime != sb.st_mtime || sb.st_ctime != sb.st_atime))
117 tmp->newly_created = 0;
123 + /* count new message */
124 snprintf (path, sizeof (path), "%s/new", tmp->path);
125 if ((dirp = opendir (path)) == NULL)
131 + tmp->msg_unread = 0;
132 while ((de = readdir (dirp)) != NULL)
135 if (*de->d_name != '.' &&
136 (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')))
138 ! tmp->has_new = tmp->new = 1;
143 ! if(tmp->msg_unread)
149 ! * count read messages (for folderlist (sidebar) we also need to count
150 ! * messages in cur so that we the total number of messages
152 ! snprintf (path, sizeof (path), "%s/cur", tmp->path);
153 ! if ((dirp = opendir (path)) == NULL)
158 ! while ((de = readdir (dirp)) != NULL)
161 ! if (*de->d_name != '.' &&
162 ! (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')))
174 ! if ((tmp->new = mh_buffy (tmp->path)) > 0)
177 ! if ((dp = opendir (path)) == NULL)
180 ! while ((de = readdir (dp)))
182 ! if (mh_valid_message (de->d_name))
185 ! tmp->has_new = tmp->new = 1;
194 ! tmp->msgcount = imap_mailbox_check(tmp->path, 0);
195 ! if ((tmp->new = imap_mailbox_check (tmp->path, 1)) > 0) {
201 diff -N -c -r mutt-1.5.9i-orig/buffy.h mutt-1.5.9i-patched/buffy.h
202 *** mutt-1.5.9i-orig/buffy.h 2002-12-11 06:19:39.000000000 -0500
203 --- mutt-1.5.9i-patched/buffy.h 2005-05-25 14:53:34.000000000 -0400
208 #endif /* BUFFY_SIZE */
209 struct buffy_t *next;
210 + struct buffy_t *prev;
211 short new; /* mailbox has new mail */
212 + short has_new; /* set it new if new and not read */
213 + int msgcount; /* total number of messages */
214 + int msg_unread; /* number of unread messages */
215 short notified; /* user has been notified */
216 short magic; /* mailbox type */
217 short newly_created; /* mbox or mmdf just popped into existence */
218 diff -N -c -r mutt-1.5.9i-orig/color.c mutt-1.5.9i-patched/color.c
219 *** mutt-1.5.9i-orig/color.c 2005-02-03 13:47:52.000000000 -0500
220 --- mutt-1.5.9i-patched/color.c 2005-05-25 14:53:34.000000000 -0400
224 { "bold", MT_COLOR_BOLD },
225 { "underline", MT_COLOR_UNDERLINE },
226 { "index", MT_COLOR_INDEX },
227 + { "sidebar_new", MT_COLOR_NEW },
231 diff -N -c -r mutt-1.5.9i-orig/compose.c mutt-1.5.9i-patched/compose.c
232 *** mutt-1.5.9i-orig/compose.c 2005-02-03 13:47:52.000000000 -0500
233 --- mutt-1.5.9i-patched/compose.c 2005-05-25 14:53:34.000000000 -0400
237 #define HDR_XOFFSET 10
238 #define TITLE_FMT "%14s" /* Used for Prompts, which are ASCII */
239 ! #define W (COLS - HDR_XOFFSET)
241 static char *Prompts[] =
245 #define HDR_XOFFSET 10
246 #define TITLE_FMT "%10s" /* Used for Prompts, which are ASCII */
247 ! #define W (COLS - HDR_XOFFSET - SidebarWidth)
249 static char *Prompts[] =
256 ! move (HDR_CRYPTINFO, 0);
258 if ((WithCrypto & APPLICATION_PGP)
259 && msg->security & APPLICATION_PGP && msg->security & SIGN)
264 ! move (HDR_CRYPTINFO, SidebarWidth);
266 if ((WithCrypto & APPLICATION_PGP)
267 && msg->security & APPLICATION_PGP && msg->security & SIGN)
270 && (msg->security & ENCRYPT)
273 ! mvprintw (HDR_CRYPTINFO, 40, "%s%s", _("Encrypt with: "),
274 NONULL(SmimeCryptAlg));
278 && (msg->security & ENCRYPT)
281 ! mvprintw (HDR_CRYPTINFO, SidebarWidth + 40, "%s%s", _("Encrypt with: "),
282 NONULL(SmimeCryptAlg));
290 ! mvaddstr (HDR_MIX, 0, " Mix: ");
298 ! mvaddstr (HDR_MIX, SidebarWidth, " Mix: ");
304 if (t && t[0] == '0' && t[1] == '\0')
307 ! if (c + mutt_strlen (t) + 2 >= COLS)
312 if (t && t[0] == '0' && t[1] == '\0')
315 ! if (c + mutt_strlen (t) + 2 >= COLS - SidebarWidth)
323 rfc822_write_address (buf, sizeof (buf), addr, 1);
324 ! mvprintw (line, 0, TITLE_FMT, Prompts[line - 1]);
325 mutt_paddstr (W, buf);
331 rfc822_write_address (buf, sizeof (buf), addr, 1);
332 ! mvprintw (line, SidebarWidth, TITLE_FMT, Prompts[line - 1]);
333 mutt_paddstr (W, buf);
340 SETCOLOR (MT_COLOR_STATUS);
341 ! mvaddstr (HDR_ATTACH - 1, 0, _("-- Attachments"));
342 BKGDSET (MT_COLOR_STATUS);
348 SETCOLOR (MT_COLOR_STATUS);
349 ! mvaddstr (HDR_ATTACH - 1, SidebarWidth, _("-- Attachments"));
350 BKGDSET (MT_COLOR_STATUS);
355 /* redraw the expanded list so the user can see the result */
357 rfc822_write_address (buf, sizeof (buf), *addr, 1);
358 ! move (line, HDR_XOFFSET);
359 mutt_paddstr (W, buf);
363 /* redraw the expanded list so the user can see the result */
365 rfc822_write_address (buf, sizeof (buf), *addr, 1);
366 ! move (line, HDR_XOFFSET+SidebarWidth);
367 mutt_paddstr (W, buf);
372 if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0)
374 mutt_str_replace (&msg->env->subject, buf);
375 ! move (HDR_SUBJECT, HDR_XOFFSET);
377 if (msg->env->subject)
378 mutt_paddstr (W, msg->env->subject);
380 if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0)
382 mutt_str_replace (&msg->env->subject, buf);
383 ! move (HDR_SUBJECT, HDR_XOFFSET + SidebarWidth);
385 if (msg->env->subject)
386 mutt_paddstr (W, msg->env->subject);
390 strfcpy (fcc, buf, _POSIX_PATH_MAX);
391 mutt_pretty_mailbox (fcc);
392 ! move (HDR_FCC, HDR_XOFFSET);
393 mutt_paddstr (W, fcc);
398 strfcpy (fcc, buf, _POSIX_PATH_MAX);
399 mutt_pretty_mailbox (fcc);
400 ! move (HDR_FCC, HDR_XOFFSET + SidebarWidth);
401 mutt_paddstr (W, fcc);
404 diff -N -c -r mutt-1.5.9i-orig/curs_main.c mutt-1.5.9i-patched/curs_main.c
405 *** mutt-1.5.9i-orig/curs_main.c 2005-02-28 13:36:35.000000000 -0500
406 --- mutt-1.5.9i-patched/curs_main.c 2005-05-25 14:53:34.000000000 -0400
413 + #include "sidebar.h"
420 if (menu->redraw & REDRAW_FULL)
422 menu_redraw_full (menu);
423 + draw_sidebar(menu->menu);
431 if (menu->redraw & REDRAW_STATUS)
434 menu_status_line (buf, sizeof (buf), menu, NONULL (Status));
436 CLEARLINE (option (OPTSTATUSONTOP) ? 0 : LINES-2);
437 SETCOLOR (MT_COLOR_STATUS);
438 mutt_paddstr (COLS, buf);
439 SETCOLOR (MT_COLOR_NORMAL);
440 + set_buffystats(Context);
441 menu->redraw &= ~REDRAW_STATUS;
447 menu->redraw = REDRAW_FULL;
450 + case OP_SIDEBAR_OPEN:
451 case OP_MAIN_CHANGE_FOLDER:
457 mutt_buffy (buf, sizeof (buf));
459 ! if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1)
465 mutt_buffy (buf, sizeof (buf));
467 ! if ( op == OP_SIDEBAR_OPEN ) {
470 ! strncpy( buf, CurBuffy->path, sizeof(buf) );
471 ! } else if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1)
480 mutt_expand_path (buf, sizeof (buf));
482 if (mx_get_magic (buf) <= 0)
484 mutt_error (_("%s is not a mailbox."), buf);
491 + case OP_SIDEBAR_SCROLL_UP:
492 + case OP_SIDEBAR_SCROLL_DOWN:
493 + case OP_SIDEBAR_NEXT:
494 + case OP_SIDEBAR_PREV:
495 + scroll_sidebar(op, menu->menu);
498 if (menu->menu == MENU_MAIN)
499 km_error_key (MENU_MAIN);
500 diff -N -c -r mutt-1.5.9i-orig/flags.c mutt-1.5.9i-patched/flags.c
501 *** mutt-1.5.9i-orig/flags.c 2005-02-03 13:47:52.000000000 -0500
502 --- mutt-1.5.9i-patched/flags.c 2005-05-25 14:53:34.000000000 -0400
508 #include "mutt_curses.h"
509 + #include "mutt_menu.h"
512 + #include "sidebar.h"
515 #include "imap_private.h"
520 if (h->searched && (changed != h->changed || deleted != ctx->deleted || tagged != ctx->tagged))
525 void mutt_tag_set_flag (int flag, int bf)
526 diff -N -c -r mutt-1.5.9i-orig/functions.h mutt-1.5.9i-patched/functions.h
527 *** mutt-1.5.9i-orig/functions.h 2005-02-19 08:49:39.000000000 -0500
528 --- mutt-1.5.9i-patched/functions.h 2005-05-25 14:53:34.000000000 -0400
532 { "decrypt-save", OP_DECRYPT_SAVE, NULL },
535 + { "sidebar-scroll-up", OP_SIDEBAR_SCROLL_UP, NULL },
536 + { "sidebar-scroll-down", OP_SIDEBAR_SCROLL_DOWN, NULL },
537 + { "sidebar-next", OP_SIDEBAR_NEXT, NULL },
538 + { "sidebar-prev", OP_SIDEBAR_PREV, NULL },
539 + { "sidebar-open", OP_SIDEBAR_OPEN, NULL },
546 { "decrypt-save", OP_DECRYPT_SAVE, NULL },
549 + { "sidebar-scroll-up", OP_SIDEBAR_SCROLL_UP, NULL },
550 + { "sidebar-scroll-down", OP_SIDEBAR_SCROLL_DOWN, NULL },
551 + { "sidebar-next", OP_SIDEBAR_NEXT, NULL },
552 + { "sidebar-prev", OP_SIDEBAR_PREV, NULL },
553 + { "sidebar-open", OP_SIDEBAR_OPEN, NULL },
557 diff -N -c -r mutt-1.5.9i-orig/globals.h mutt-1.5.9i-patched/globals.h
558 *** mutt-1.5.9i-orig/globals.h 2005-02-12 15:01:02.000000000 -0500
559 --- mutt-1.5.9i-patched/globals.h 2005-05-25 14:53:34.000000000 -0400
563 WHERE short ScoreThresholdRead;
564 WHERE short ScoreThresholdFlag;
566 + WHERE struct buffy_t *CurBuffy INITVAL(0);
567 + WHERE short DrawFullLine INITVAL(0);
568 + WHERE short SidebarWidth;
570 WHERE short ImapKeepalive;
572 diff -N -c -r mutt-1.5.9i-orig/init.h mutt-1.5.9i-patched/init.h
573 *** mutt-1.5.9i-orig/init.h 2005-03-01 10:56:02.000000000 -0500
574 --- mutt-1.5.9i-patched/init.h 2005-05-25 14:53:34.000000000 -0400
578 ** This specifies the folder into which read mail in your ``$$spoolfile''
579 ** folder will be appended.
581 + { "sidebar_visible", DT_BOOL, R_BOTH, OPTSIDEBAR, 0 },
584 + ** This specifies whether or not to show sidebar (left-side list of folders).
586 + { "sidebar_width", DT_NUM, R_BOTH, UL &SidebarWidth, 0 },
589 + ** The width of the sidebar.
591 { "mbox_type", DT_MAGIC,R_NONE, UL &DefaultMagic, M_MBOX },
594 diff -N -c -r mutt-1.5.9i-orig/mailbox.h mutt-1.5.9i-patched/mailbox.h
595 *** mutt-1.5.9i-orig/mailbox.h 2002-11-12 02:53:09.000000000 -0500
596 --- mutt-1.5.9i-patched/mailbox.h 2005-05-25 14:53:34.000000000 -0400
600 #define M_NEWFOLDER (1<<4) /* create a new folder - same as M_APPEND, but uses
601 * safe_fopen() for mbox-style folders.
603 + #define M_PEEK (1<<5) /* revert atime back after taking a look (if applicable) */
605 /* mx_open_new_message() */
606 #define M_ADD_FROM 1 /* add a From_ line */
607 diff -N -c -r mutt-1.5.9i-orig/Makefile.in mutt-1.5.9i-patched/Makefile.in
608 *** mutt-1.5.9i-orig/Makefile.in 2005-03-13 11:37:46.000000000 -0500
609 --- mutt-1.5.9i-patched/Makefile.in 2005-05-25 14:53:34.000000000 -0400
612 history.$(OBJEXT) lib.$(OBJEXT) muttlib.$(OBJEXT) \
613 editmsg.$(OBJEXT) utf8.$(OBJEXT) mbyte.$(OBJEXT) \
614 wcwidth.$(OBJEXT) url.$(OBJEXT) ascii.$(OBJEXT) \
615 ! mutt_idna.$(OBJEXT) crypt-mod.$(OBJEXT)
616 mutt_OBJECTS = $(am_mutt_OBJECTS)
618 am_mutt_dotlock_OBJECTS = mutt_dotlock.$(OBJEXT)
620 history.$(OBJEXT) lib.$(OBJEXT) muttlib.$(OBJEXT) \
621 editmsg.$(OBJEXT) utf8.$(OBJEXT) mbyte.$(OBJEXT) \
622 wcwidth.$(OBJEXT) url.$(OBJEXT) ascii.$(OBJEXT) \
623 ! mutt_idna.$(OBJEXT) crypt-mod.$(OBJEXT) \
625 mutt_OBJECTS = $(am_mutt_OBJECTS)
627 am_mutt_dotlock_OBJECTS = mutt_dotlock.$(OBJEXT)
630 score.c send.c sendlib.c signal.c sort.c \
631 status.c system.c thread.c charset.c history.c lib.c \
632 muttlib.c editmsg.c utf8.c mbyte.c wcwidth.c \
633 ! url.c ascii.c mutt_idna.c crypt-mod.c crypt-mod.h
635 mutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(MUTTLIBS) \
636 $(INTLLIBS) $(LIBICONV) $(LIBGPGME_LIBS)
638 score.c send.c sendlib.c signal.c sort.c \
639 status.c system.c thread.c charset.c history.c lib.c \
640 muttlib.c editmsg.c utf8.c mbyte.c wcwidth.c \
641 ! url.c ascii.c mutt_idna.c crypt-mod.c crypt-mod.h \
644 mutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(MUTTLIBS) \
645 $(INTLLIBS) $(LIBICONV) $(LIBGPGME_LIBS)
648 makedoc.c stamp-doc-rc README.SSL smime.h\
649 muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \
650 ChangeLog.old mkchangelog.sh cvslog2changelog.pl mutt_idna.h \
651 ! snprintf.c regex.c crypt-gpgme.h
653 EXTRA_SCRIPTS = smime_keys
654 mutt_dotlock_SOURCES = mutt_dotlock.c
656 makedoc.c stamp-doc-rc README.SSL smime.h\
657 muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \
658 ChangeLog.old mkchangelog.sh cvslog2changelog.pl mutt_idna.h \
659 ! snprintf.c regex.c crypt-gpgme.h sidebar.h
661 EXTRA_SCRIPTS = smime_keys
662 mutt_dotlock_SOURCES = mutt_dotlock.c
663 diff -N -c -r mutt-1.5.9i-orig/mbox.c mutt-1.5.9i-patched/mbox.c
664 *** mutt-1.5.9i-orig/mbox.c 2005-02-03 13:47:53.000000000 -0500
665 --- mutt-1.5.9i-patched/mbox.c 2005-05-25 14:53:34.000000000 -0400
669 mutt_perror (ctx->path);
672 + ctx->atime = sb.st_atime;
673 ctx->mtime = sb.st_mtime;
674 ctx->size = sb.st_size;
680 ctx->size = sb.st_size;
681 ctx->mtime = sb.st_mtime;
682 + ctx->atime = sb.st_atime;
684 #ifdef NFS_ATTRIBUTE_HACK
685 if (sb.st_mtime > sb.st_atime)
686 diff -N -c -r mutt-1.5.9i-orig/menu.c mutt-1.5.9i-patched/menu.c
687 *** mutt-1.5.9i-orig/menu.c 2005-02-28 10:13:57.000000000 -0500
688 --- mutt-1.5.9i-patched/menu.c 2005-05-25 14:53:34.000000000 -0400
692 #include "mutt_curses.h"
693 #include "mutt_menu.h"
695 + #include "sidebar.h"
701 void menu_pad_string (char *s, size_t n)
703 int shift = option (OPTARROWCURSOR) ? 3 : 0;
704 ! int cols = COLS - shift;
706 mutt_format_string (s, n, cols, cols, 0, ' ', s, strlen (s), 1);
709 void menu_pad_string (char *s, size_t n)
711 int shift = option (OPTARROWCURSOR) ? 3 : 0;
712 ! int cols = COLS - shift - SidebarWidth;
714 mutt_format_string (s, n, cols, cols, 0, ' ', s, strlen (s), 1);
723 for (i = menu->top; i < menu->top + menu->pagelen; i++)
728 if (option (OPTARROWCURSOR))
730 attrset (menu->color (i));
731 ! CLEARLINE (i - menu->top + menu->offset);
733 if (i == menu->current)
736 if (option (OPTARROWCURSOR))
738 attrset (menu->color (i));
739 ! CLEARLINE_WIN (i - menu->top + menu->offset);
741 if (i == menu->current)
748 ! move (i - menu->top + menu->offset, 3);
750 print_enriched_string (menu->color(i), (unsigned char *) buf, 1);
751 SETCOLOR (MT_COLOR_NORMAL);
756 ! move (i - menu->top + menu->offset, SidebarWidth + 3);
758 print_enriched_string (menu->color(i), (unsigned char *) buf, 1);
759 SETCOLOR (MT_COLOR_NORMAL);
762 BKGDSET (MT_COLOR_INDICATOR);
765 ! CLEARLINE (i - menu->top + menu->offset);
766 print_enriched_string (menu->color(i), (unsigned char *) buf, i != menu->current);
767 SETCOLOR (MT_COLOR_NORMAL);
768 BKGDSET (MT_COLOR_NORMAL);
772 ! CLEARLINE (i - menu->top + menu->offset);
777 BKGDSET (MT_COLOR_INDICATOR);
780 ! CLEARLINE_WIN (i - menu->top + menu->offset);
781 print_enriched_string (menu->color(i), (unsigned char *) buf, i != menu->current);
782 SETCOLOR (MT_COLOR_NORMAL);
783 BKGDSET (MT_COLOR_NORMAL);
787 ! CLEARLINE_WIN (i - menu->top + menu->offset);
796 ! move (menu->oldcurrent + menu->offset - menu->top, 0);
797 SETCOLOR (MT_COLOR_NORMAL);
798 BKGDSET (MT_COLOR_NORMAL);
804 ! move (menu->oldcurrent + menu->offset - menu->top, SidebarWidth);
805 SETCOLOR (MT_COLOR_NORMAL);
806 BKGDSET (MT_COLOR_NORMAL);
811 menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent);
812 menu_pad_string (buf, sizeof (buf));
813 ! move (menu->oldcurrent + menu->offset - menu->top, 3);
814 print_enriched_string (menu->color(menu->oldcurrent), (unsigned char *) buf, 1);
815 SETCOLOR (MT_COLOR_NORMAL);
818 /* now draw it in the new location */
819 ! move (menu->current + menu->offset - menu->top, 0);
820 attrset (menu->color (menu->current));
821 ADDCOLOR (MT_COLOR_INDICATOR);
825 menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent);
826 menu_pad_string (buf, sizeof (buf));
827 ! move (menu->oldcurrent + menu->offset - menu->top, SidebarWidth + 3);
828 print_enriched_string (menu->color(menu->oldcurrent), (unsigned char *) buf, 1);
829 SETCOLOR (MT_COLOR_NORMAL);
832 /* now draw it in the new location */
833 ! move (menu->current + menu->offset - menu->top, SidebarWidth);
834 attrset (menu->color (menu->current));
835 ADDCOLOR (MT_COLOR_INDICATOR);
839 attrset (menu->color (menu->current));
840 ADDCOLOR (MT_COLOR_INDICATOR);
841 BKGDSET (MT_COLOR_INDICATOR);
842 ! CLEARLINE (menu->current - menu->top + menu->offset);
843 print_enriched_string (menu->color(menu->current), (unsigned char *) buf, 0);
844 SETCOLOR (MT_COLOR_NORMAL);
845 BKGDSET (MT_COLOR_NORMAL);
847 attrset (menu->color (menu->current));
848 ADDCOLOR (MT_COLOR_INDICATOR);
849 BKGDSET (MT_COLOR_INDICATOR);
850 ! CLEARLINE_WIN (menu->current - menu->top + menu->offset);
851 print_enriched_string (menu->color(menu->current), (unsigned char *) buf, 0);
852 SETCOLOR (MT_COLOR_NORMAL);
853 BKGDSET (MT_COLOR_NORMAL);
859 ! move (menu->current + menu->offset - menu->top, 0);
860 menu_make_entry (buf, sizeof (buf), menu, menu->current);
861 menu_pad_string (buf, sizeof (buf));
867 ! move (menu->current + menu->offset - menu->top, SidebarWidth);
868 menu_make_entry (buf, sizeof (buf), menu, menu->current);
869 menu_pad_string (buf, sizeof (buf));
871 diff -N -c -r mutt-1.5.9i-orig/mutt_curses.h mutt-1.5.9i-patched/mutt_curses.h
872 *** mutt-1.5.9i-orig/mutt_curses.h 2004-06-17 16:33:04.000000000 -0400
873 --- mutt-1.5.9i-patched/mutt_curses.h 2005-05-25 14:53:34.000000000 -0400
880 + #define CLEARLINE_WIN(x) move(x,SidebarWidth), clrtoeol()
881 #define CLEARLINE(x) move(x,0), clrtoeol()
882 #define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x)
883 #define BEEP() do { if (option (OPTBEEP)) beep(); } while (0)
894 diff -N -c -r mutt-1.5.9i-orig/mutt.h mutt-1.5.9i-patched/mutt.h
895 *** mutt-1.5.9i-orig/mutt.h 2005-02-28 10:13:57.000000000 -0500
896 --- mutt-1.5.9i-patched/mutt.h 2005-05-25 14:53:34.000000000 -0400
915 time_t mtime_cur; /* used with maildir folders */
920 unsigned int quiet : 1; /* inhibit status messages? */
921 unsigned int collapsed : 1; /* are all threads collapsed? */
922 unsigned int closing : 1; /* mailbox is being closed */
923 + unsigned int peekonly : 1; /* just taking a glance, revert atime */
926 typedef struct attachptr
927 diff -N -c -r mutt-1.5.9i-orig/muttlib.c mutt-1.5.9i-patched/muttlib.c
928 *** mutt-1.5.9i-orig/muttlib.c 2005-02-12 14:30:16.000000000 -0500
929 --- mutt-1.5.9i-patched/muttlib.c 2005-05-25 14:53:34.000000000 -0400
932 ch = *src++; /* pad char */
933 /* calculate space left on line. if we've already written more data
934 than will fit on the line, ignore the rest of the line */
935 ! count = (COLS < destlen ? COLS : destlen);
938 count -= col; /* how many columns left on this line */
940 ch = *src++; /* pad char */
941 /* calculate space left on line. if we've already written more data
942 than will fit on the line, ignore the rest of the line */
943 ! if ( DrawFullLine )
944 ! count = (COLS < destlen ? COLS : destlen);
946 ! count = ((COLS-SidebarWidth) < destlen ? COLS - SidebarWidth : destlen);
949 count -= col; /* how many columns left on this line */
950 diff -N -c -r mutt-1.5.9i-orig/Muttrc mutt-1.5.9i-patched/Muttrc
951 *** mutt-1.5.9i-orig/Muttrc 2005-03-13 11:37:11.000000000 -0500
952 --- mutt-1.5.9i-patched/Muttrc 2005-05-25 14:53:34.000000000 -0400
959 + # set sidebar_visible=no
961 + # Name: sidebar_visible
966 + # This specifies whether or not to show sidebar (left-side list of folders).
969 + # set sidebar_width=0
971 + # Name: sidebar_width
976 + # The width of the sidebar.
979 # set crypt_autosign=no
981 # Name: crypt_autosign
982 diff -N -c -r mutt-1.5.9i-orig/mx.c mutt-1.5.9i-patched/mx.c
983 *** mutt-1.5.9i-orig/mx.c 2005-02-03 13:47:53.000000000 -0500
984 --- mutt-1.5.9i-patched/mx.c 2005-05-25 14:53:34.000000000 -0400
988 * M_APPEND open mailbox for appending
989 * M_READONLY open mailbox in read-only mode
990 * M_QUIET only print error messages
991 + * M_PEEK revert atime where applicable
992 * ctx if non-null, context struct to use
994 CONTEXT *mx_open_mailbox (const char *path, int flags, CONTEXT *pctx)
999 if (flags & M_READONLY)
1001 + if (flags & M_PEEK)
1002 + ctx->peekonly = 1;
1004 if (flags & (M_APPEND|M_NEWFOLDER))
1009 void mx_fastclose_mailbox (CONTEXT *ctx)
1012 + #ifndef BUFFY_SIZE
1013 + struct utimbuf ut;
1018 + #ifndef BUFFY_SIZE
1019 + /* fix up the times so buffy won't get confused */
1020 + if (ctx->peekonly && ctx->path && ctx->mtime > ctx->atime)
1022 + ut.actime = ctx->atime;
1023 + ut.modtime = ctx->mtime;
1024 + utime (ctx->path, &ut);
1029 if (ctx->magic == M_IMAP)
1030 diff -N -c -r mutt-1.5.9i-orig/OPS mutt-1.5.9i-patched/OPS
1031 *** mutt-1.5.9i-orig/OPS 2005-02-19 08:49:37.000000000 -0500
1032 --- mutt-1.5.9i-patched/OPS 2005-05-25 14:53:34.000000000 -0400
1036 OP_MAIN_SHOW_LIMIT "show currently active limit pattern"
1037 OP_MAIN_COLLAPSE_THREAD "collapse/uncollapse current thread"
1038 OP_MAIN_COLLAPSE_ALL "collapse/uncollapse all threads"
1039 + OP_SIDEBAR_SCROLL_UP "scroll the mailbox pane up 1 page"
1040 + OP_SIDEBAR_SCROLL_DOWN "scroll the mailbox pane down 1 page"
1041 + OP_SIDEBAR_NEXT "go down to next mailbox"
1042 + OP_SIDEBAR_PREV "go to previous mailbox"
1043 + OP_SIDEBAR_OPEN "open hilighted mailbox"
1044 diff -N -c -r mutt-1.5.9i-orig/pager.c mutt-1.5.9i-patched/pager.c
1045 *** mutt-1.5.9i-orig/pager.c 2005-02-12 14:30:16.000000000 -0500
1046 --- mutt-1.5.9i-patched/pager.c 2005-05-25 14:53:34.000000000 -0400
1053 + #include "sidebar.h"
1062 ! int wrap_cols = COLS - WrapMargin;
1070 ! int wrap_cols = COLS - WrapMargin - SidebarWidth;
1076 if ((redraw & REDRAW_BODY) || topline != oldtopline)
1079 ! move (bodyoffset, 0);
1080 curline = oldtopline = topline;
1084 if ((redraw & REDRAW_BODY) || topline != oldtopline)
1087 ! move (bodyoffset, SidebarWidth);
1088 curline = oldtopline = topline;
1094 &QuoteList, &q_level, &force_redraw, &SearchRE) > 0)
1097 + move(lines + bodyoffset, SidebarWidth);
1099 last_offset = lineInfo[curline].offset;
1100 } while (force_redraw);
1107 + move(lines + bodyoffset, SidebarWidth);
1109 /* We are going to update the pager status bar, so it isn't
1110 * necessary to reset to normal color now. */
1113 /* print out the pager status bar */
1114 SETCOLOR (MT_COLOR_STATUS);
1115 BKGDSET (MT_COLOR_STATUS);
1116 ! CLEARLINE (statusoffset);
1117 if (IsHeader (extra))
1119 ! size_t l1 = (COLS - 9) * MB_LEN_MAX;
1120 size_t l2 = sizeof (buffer);
1121 _mutt_make_string (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt),
1122 Context, extra->hdr, M_FORMAT_MAKEPRINT);
1124 else if (IsMsgAttach (extra))
1126 ! size_t l1 = (COLS - 9) * MB_LEN_MAX;
1127 size_t l2 = sizeof (buffer);
1128 _mutt_make_string (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt),
1129 Context, extra->bdy->hdr, M_FORMAT_MAKEPRINT);
1131 ! mutt_paddstr (COLS-10, IsHeader (extra) || IsMsgAttach (extra) ?
1134 if (last_pos < sb.st_size - 1)
1136 /* print out the pager status bar */
1137 SETCOLOR (MT_COLOR_STATUS);
1138 BKGDSET (MT_COLOR_STATUS);
1139 ! CLEARLINE_WIN(statusoffset);
1140 if (IsHeader (extra))
1142 ! size_t l1 = ((COLS - 9) * MB_LEN_MAX) - (SidebarWidth * MB_LEN_MAX);
1143 size_t l2 = sizeof (buffer);
1144 _mutt_make_string (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt),
1145 Context, extra->hdr, M_FORMAT_MAKEPRINT);
1147 else if (IsMsgAttach (extra))
1149 ! size_t l1 = (COLS - 9) * MB_LEN_MAX - (SidebarWidth * MB_LEN_MAX);
1150 size_t l2 = sizeof (buffer);
1151 _mutt_make_string (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt),
1152 Context, extra->bdy->hdr, M_FORMAT_MAKEPRINT);
1154 ! mutt_paddstr (COLS-10-SidebarWidth, IsHeader (extra) || IsMsgAttach (extra) ?
1157 if (last_pos < sb.st_size - 1)
1160 /* redraw the pager_index indicator, because the
1161 * flags for this message might have changed. */
1162 menu_redraw_current (index);
1164 /* print out the index status bar */
1165 menu_status_line (buffer, sizeof (buffer), index, NONULL(Status));
1167 ! move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), 0);
1168 SETCOLOR (MT_COLOR_STATUS);
1169 ! mutt_paddstr (COLS, buffer);
1170 SETCOLOR (MT_COLOR_NORMAL);
1176 /* redraw the pager_index indicator, because the
1177 * flags for this message might have changed. */
1178 menu_redraw_current (index);
1179 ! draw_sidebar(MENU_PAGER);
1180 /* print out the index status bar */
1181 menu_status_line (buffer, sizeof (buffer), index, NONULL(Status));
1182 ! move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)),
1184 SETCOLOR (MT_COLOR_STATUS);
1185 ! mutt_paddstr (COLS-SidebarWidth, buffer);
1186 SETCOLOR (MT_COLOR_NORMAL);
1188 + /* if we're not using the index, update every time */
1190 + draw_sidebar(MENU_PAGER);
1197 redraw = REDRAW_FULL;
1200 + case OP_SIDEBAR_SCROLL_UP:
1201 + case OP_SIDEBAR_SCROLL_DOWN:
1202 + case OP_SIDEBAR_NEXT:
1203 + case OP_SIDEBAR_PREV:
1204 + scroll_sidebar(ch, MENU_PAGER);
1209 diff -N -c -r mutt-1.5.9i-orig/PATCHES mutt-1.5.9i-patched/PATCHES
1210 *** mutt-1.5.9i-orig/PATCHES 2005-03-13 11:33:06.000000000 -0500
1211 --- mutt-1.5.9i-patched/PATCHES 2005-06-28 15:36:06.000000000 -0400
1215 + patch-1.5.9i.sidebar.20050628
1216 diff -N -c -r mutt-1.5.9i-orig/sidebar.c mutt-1.5.9i-patched/sidebar.c
1217 *** mutt-1.5.9i-orig/sidebar.c 1969-12-31 19:00:00.000000000 -0500
1218 --- mutt-1.5.9i-patched/sidebar.c 2005-06-28 15:32:07.000000000 -0400
1223 + * Copyright (C) ????-2004 Justin Hibbits <jrh29@po.cwru.edu>
1224 + * Copyright (C) 2004 Thomer M. Gil <mutt@thomer.com>
1226 + * This program is free software; you can redistribute it and/or modify
1227 + * it under the terms of the GNU General Public License as published by
1228 + * the Free Software Foundation; either version 2 of the License, or
1229 + * (at your option) any later version.
1231 + * This program is distributed in the hope that it will be useful,
1232 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1233 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1234 + * GNU General Public License for more details.
1236 + * You should have received a copy of the GNU General Public License
1237 + * along with this program; if not, write to the Free Software
1238 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
1243 + # include "config.h"
1247 + #include "mutt_menu.h"
1248 + #include "mutt_curses.h"
1249 + #include "sidebar.h"
1250 + #include "buffy.h"
1251 + #include <libgen.h>
1252 + #include "keymap.h"
1253 + #include <stdbool.h>
1255 + /*BUFFY *CurBuffy = 0;*/
1256 + static BUFFY *TopBuffy = 0;
1257 + static BUFFY *BottomBuffy = 0;
1258 + static int known_lines = 0;
1260 + static int quick_log10(int n)
1263 + sprintf(string, "%d", n);
1264 + return strlen(string);
1267 + void calc_boundaries (int menu)
1269 + BUFFY *tmp = Incoming;
1271 + if ( known_lines != LINES ) {
1272 + TopBuffy = BottomBuffy = 0;
1273 + known_lines = LINES;
1275 + for ( ; tmp->next != 0; tmp = tmp->next )
1276 + tmp->next->prev = tmp;
1278 + if ( TopBuffy == 0 && BottomBuffy == 0 )
1279 + TopBuffy = Incoming;
1280 + if ( BottomBuffy == 0 ) {
1281 + int count = LINES - 2 - (menu != MENU_PAGER || option(OPTSTATUSONTOP));
1282 + BottomBuffy = TopBuffy;
1283 + while ( --count && BottomBuffy->next )
1284 + BottomBuffy = BottomBuffy->next;
1286 + else if ( TopBuffy == CurBuffy->next ) {
1287 + int count = LINES - 2 - (menu != MENU_PAGER);
1288 + BottomBuffy = CurBuffy;
1289 + tmp = BottomBuffy;
1290 + while ( --count && tmp->prev)
1294 + else if ( BottomBuffy == CurBuffy->prev ) {
1295 + int count = LINES - 2 - (menu != MENU_PAGER);
1296 + TopBuffy = CurBuffy;
1298 + while ( --count && tmp->next )
1300 + BottomBuffy = tmp;
1304 + char *make_sidebar_entry(char *box, int size, int new)
1306 + static char *entry = 0;
1310 + c = realloc(entry, SidebarWidth + 1);
1311 + if ( c ) entry = c;
1312 + entry[SidebarWidth] = 0;
1313 + for (; i < SidebarWidth; entry[i++] = ' ' );
1315 + strncpy( entry, box, i < SidebarWidth ? i :SidebarWidth );
1319 + entry + SidebarWidth - 5 - quick_log10(size) - quick_log10(new),
1320 + "% d(%d)", size, new);
1322 + sprintf( entry + SidebarWidth - 3 - quick_log10(size), "% d", size);
1326 + void set_curbuffy(char buf[LONG_STRING])
1328 + BUFFY* tmp = CurBuffy = Incoming;
1334 + if(!strcmp(tmp->path, buf)) {
1346 + int draw_sidebar(int menu) {
1348 + int lines = option(OPTHELP) ? 1 : 0;
1350 + #ifndef USE_SLANG_CURSES
1355 + static bool initialized = false;
1356 + static int prev_show_value;
1357 + static short saveSidebarWidth;
1359 + /* initialize first time */
1360 + if(!initialized) {
1361 + prev_show_value = option(OPTSIDEBAR);
1362 + saveSidebarWidth = SidebarWidth;
1363 + if(!option(OPTSIDEBAR)) SidebarWidth = 0;
1364 + initialized = true;
1367 + /* save or restore the value SidebarWidth */
1368 + if(prev_show_value != option(OPTSIDEBAR)) {
1369 + if(prev_show_value && !option(OPTSIDEBAR)) {
1370 + saveSidebarWidth = SidebarWidth;
1372 + } else if(!prev_show_value && option(OPTSIDEBAR)) {
1373 + SidebarWidth = saveSidebarWidth;
1375 + prev_show_value = option(OPTSIDEBAR);
1379 + if ( SidebarWidth == 0 ) return 0;
1381 + /* get attributes for divider */
1382 + SETCOLOR(MT_COLOR_STATUS);
1383 + #ifndef USE_SLANG_CURSES
1384 + attr_get(&attrs, &color_pair, 0);
1386 + color_pair = attr_get();
1388 + SETCOLOR(MT_COLOR_NORMAL);
1390 + /* draw the divider */
1392 + for ( ; lines < LINES-1-(menu != MENU_PAGER || option(OPTSTATUSONTOP)); lines++ ) {
1393 + move(lines, SidebarWidth - 1);
1395 + #ifndef USE_SLANG_CURSES
1396 + mvchgat(lines, SidebarWidth - 1, 1, 0, color_pair, NULL);
1399 + if ( Incoming == 0 ) return 0;
1400 + lines = option(OPTHELP) ? 1 : 0; /* go back to the top */
1402 + if ( known_lines != LINES || TopBuffy == 0 || BottomBuffy == 0 )
1403 + calc_boundaries(menu);
1404 + if ( CurBuffy == 0 ) CurBuffy = Incoming;
1408 + SETCOLOR(MT_COLOR_NORMAL);
1410 + for ( ; tmp && lines < LINES-1 - (menu != MENU_PAGER || option(OPTSTATUSONTOP)); tmp = tmp->next ) {
1411 + if ( tmp == CurBuffy )
1412 + SETCOLOR(MT_COLOR_INDICATOR);
1413 + else if ( tmp->msg_unread > 0 )
1414 + SETCOLOR(MT_COLOR_NEW);
1416 + SETCOLOR(MT_COLOR_NORMAL);
1419 + if ( Context && !strcmp( tmp->path, Context->path ) ) {
1420 + tmp->msg_unread = Context->unread;
1421 + tmp->msgcount = Context->msgcount;
1423 + printw( "%.*s", SidebarWidth,
1424 + make_sidebar_entry(basename(tmp->path), tmp->msgcount,
1425 + tmp->msg_unread));
1428 + SETCOLOR(MT_COLOR_NORMAL);
1429 + for ( ; lines < LINES-1 - (menu != MENU_PAGER || option(OPTSTATUSONTOP)); lines++ ) {
1432 + for ( ; i < SidebarWidth - 1; i++ )
1439 + void set_buffystats(CONTEXT* Context)
1441 + BUFFY *tmp = Incoming;
1443 + if(Context && !strcmp(tmp->path, Context->path)) {
1444 + tmp->msg_unread = Context->unread;
1445 + tmp->msgcount = Context->msgcount;
1452 + void scroll_sidebar(int op, int menu)
1454 + if(!SidebarWidth) return;
1455 + if(!CurBuffy) return;
1458 + case OP_SIDEBAR_NEXT:
1459 + if ( CurBuffy->next == NULL ) return;
1460 + CurBuffy = CurBuffy->next;
1462 + case OP_SIDEBAR_PREV:
1463 + if ( CurBuffy->prev == NULL ) return;
1464 + CurBuffy = CurBuffy->prev;
1466 + case OP_SIDEBAR_SCROLL_UP:
1467 + CurBuffy = TopBuffy;
1468 + if ( CurBuffy != Incoming ) {
1469 + calc_boundaries(menu);
1470 + CurBuffy = CurBuffy->prev;
1473 + case OP_SIDEBAR_SCROLL_DOWN:
1474 + CurBuffy = BottomBuffy;
1475 + if ( CurBuffy->next ) {
1476 + calc_boundaries(menu);
1477 + CurBuffy = CurBuffy->next;
1483 + calc_boundaries(menu);
1484 + draw_sidebar(menu);
1486 diff -N -c -r mutt-1.5.9i-orig/sidebar.h mutt-1.5.9i-patched/sidebar.h
1487 *** mutt-1.5.9i-orig/sidebar.h 1969-12-31 19:00:00.000000000 -0500
1488 --- mutt-1.5.9i-patched/sidebar.h 2005-05-25 14:53:34.000000000 -0400
1493 + * Copyright (C) ????-2004 Justin Hibbits <jrh29@po.cwru.edu>
1494 + * Copyright (C) 2004 Thomer M. Gil <mutt@thomer.com>
1496 + * This program is free software; you can redistribute it and/or modify
1497 + * it under the terms of the GNU General Public License as published by
1498 + * the Free Software Foundation; either version 2 of the License, or
1499 + * (at your option) any later version.
1501 + * This program is distributed in the hope that it will be useful,
1502 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1503 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1504 + * GNU General Public License for more details.
1506 + * You should have received a copy of the GNU General Public License
1507 + * along with this program; if not, write to the Free Software
1508 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
1514 + struct MBOX_LIST {
1520 + /* parameter is whether or not to go to the status line */
1521 + /* used for omitting the last | that covers up the status bar in the index */
1522 + int draw_sidebar(int);
1523 + void scroll_sidebar(int, int);
1524 + void set_curbuffy(char*);
1525 + void set_buffystats(CONTEXT*);
1527 + #endif /* SIDEBAR_H */