diff -N -c -r mutt-1.5.6.orig/buffy.c mutt-1.5.6/buffy.c *** mutt-1.5.6.orig/buffy.c 2004-02-01 13:20:59.000000000 -0500 --- mutt-1.5.6/buffy.c 2004-06-02 14:10:25.000000000 -0400 *************** *** 263,269 **** char path[_POSIX_PATH_MAX]; struct stat contex_sb; time_t t; ! #ifdef USE_IMAP /* update postponed count as well, on force */ if (force) --- 263,269 ---- char path[_POSIX_PATH_MAX]; struct stat contex_sb; time_t t; ! CONTEXT *ctx; #ifdef USE_IMAP /* update postponed count as well, on force */ if (force) *************** *** 296,301 **** --- 296,303 ---- for (tmp = Incoming; tmp; tmp = tmp->next) { + if ( tmp->new == 1 ) + tmp->has_new = 1; tmp->new = 0; #ifdef USE_IMAP *************** *** 349,358 **** case M_MBOX: case M_MMDF: ! if (STAT_CHECK) { BuffyCount++; ! tmp->new = 1; } #ifdef BUFFY_SIZE else --- 351,377 ---- case M_MBOX: case M_MMDF: ! { ! if (STAT_CHECK || tmp->msgcount == 0) { + BUFFY b = *tmp; + int msgcount = 0; + int msg_unread = 0; BuffyCount++; ! /* parse the mailbox, to see how much mail there is */ ! ctx = mx_open_mailbox( tmp->path, M_READONLY | M_QUIET | M_NOSORT, ! NULL); ! if(ctx) ! { ! msgcount = ctx->msgcount; ! msg_unread = ctx->unread; ! mx_close_mailbox(ctx, 0); ! } ! *tmp = b; ! tmp->msgcount = msgcount; ! tmp->msg_unread = msg_unread; ! if(STAT_CHECK) ! tmp->has_new = tmp->new = 1; } #ifdef BUFFY_SIZE else *************** *** 364,370 **** if (tmp->newly_created && (sb.st_ctime != sb.st_mtime || sb.st_ctime != sb.st_atime)) tmp->newly_created = 0; ! break; case M_MAILDIR: --- 383,389 ---- if (tmp->newly_created && (sb.st_ctime != sb.st_mtime || sb.st_ctime != sb.st_atime)) tmp->newly_created = 0; ! } break; case M_MAILDIR: *************** *** 375,380 **** --- 394,421 ---- tmp->magic = 0; break; } + tmp->msgcount = 0; + tmp->msg_unread = 0; + while ((de = readdir (dirp)) != NULL) + { + char *p; + if (*de->d_name != '.' && + (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T'))) + { + /* one new and undeleted message is enough */ + BuffyCount++; + tmp->has_new = tmp->new = 1; + tmp->msgcount++; + tmp->msg_unread++; + } + } + closedir (dirp); + snprintf (path, sizeof (path), "%s/cur", tmp->path); + if ((dirp = opendir (path)) == NULL) + { + tmp->magic = 0; + break; + } while ((de = readdir (dirp)) != NULL) { char *p; *************** *** 383,404 **** { /* one new and undeleted message is enough */ BuffyCount++; ! tmp->new = 1; ! break; } } closedir (dirp); break; case M_MH: ! if ((tmp->new = mh_buffy (tmp->path)) > 0) ! BuffyCount++; break; #ifdef USE_IMAP case M_IMAP: ! if ((tmp->new = imap_mailbox_check (tmp->path, 1)) > 0) BuffyCount++; else tmp->new = 0; --- 424,464 ---- { /* one new and undeleted message is enough */ BuffyCount++; ! tmp->has_new = tmp->new = 1; ! tmp->msgcount++; } } closedir (dirp); break; case M_MH: ! { ! DIR *dp; ! struct dirent *de; ! if ((tmp->new = mh_buffy (tmp->path)) > 0) ! BuffyCount++; ! ! if ((dp = opendir (path)) == NULL) ! break; ! tmp->msgcount = 0; ! while ((de = readdir (dp))) ! { ! if (mh_valid_message (de->d_name)) ! { ! tmp->msgcount++; ! tmp->has_new = tmp->new = 1; ! } ! } ! closedir (dp); ! } break; #ifdef USE_IMAP case M_IMAP: ! tmp->msgcount = imap_mailbox_check(tmp->path, 0); ! if ((tmp->new = imap_mailbox_check (tmp->path, 1)) > 0) { BuffyCount++; + } else tmp->new = 0; diff -N -c -r mutt-1.5.6.orig/buffy.h mutt-1.5.6/buffy.h *** mutt-1.5.6.orig/buffy.h 2002-12-11 06:19:39.000000000 -0500 --- mutt-1.5.6/buffy.h 2004-06-02 14:10:25.000000000 -0400 *************** *** 27,33 **** --- 27,37 ---- long size; #endif /* BUFFY_SIZE */ struct buffy_t *next; + struct buffy_t *prev; short new; /* mailbox has new mail */ + short has_new; /* set it new if new and not read */ + int msgcount; /* total number of messages */ + int msg_unread; /* number of unread messages */ short notified; /* user has been notified */ short magic; /* mailbox type */ short newly_created; /* mbox or mmdf just popped into existence */ diff -N -c -r mutt-1.5.6.orig/color.c mutt-1.5.6/color.c *** mutt-1.5.6.orig/color.c 2003-11-05 04:41:31.000000000 -0500 --- mutt-1.5.6/color.c 2004-06-02 14:10:25.000000000 -0400 *************** *** 89,94 **** --- 89,95 ---- { "bold", MT_COLOR_BOLD }, { "underline", MT_COLOR_UNDERLINE }, { "index", MT_COLOR_INDEX }, + { "sidebarnew", MT_COLOR_NEW }, { NULL, 0 } }; diff -N -c -r mutt-1.5.6.orig/compose.c mutt-1.5.6/compose.c *** mutt-1.5.6.orig/compose.c 2003-11-05 04:41:31.000000000 -0500 --- mutt-1.5.6/compose.c 2004-06-04 02:50:25.000000000 -0400 *************** *** 67,73 **** #define HDR_XOFFSET 10 #define TITLE_FMT "%10s" /* Used for Prompts, which are ASCII */ ! #define W (COLS - HDR_XOFFSET) static char *Prompts[] = { --- 67,73 ---- #define HDR_XOFFSET 10 #define TITLE_FMT "%10s" /* Used for Prompts, which are ASCII */ ! #define W (COLS - HDR_XOFFSET - SidebarWidth) static char *Prompts[] = { *************** *** 110,125 **** if ((WithCrypto & APPLICATION_PGP) && (WithCrypto & APPLICATION_SMIME)) { if (!msg->security) ! mvaddstr (HDR_CRYPT, 0, "Security: "); else if (msg->security & APPLICATION_SMIME) ! mvaddstr (HDR_CRYPT, 0, " S/MIME: "); else if (msg->security & APPLICATION_PGP) ! mvaddstr (HDR_CRYPT, 0, " PGP: "); } else if ((WithCrypto & APPLICATION_SMIME)) ! mvaddstr (HDR_CRYPT, 0, " S/MIME: "); else if ((WithCrypto & APPLICATION_PGP)) ! mvaddstr (HDR_CRYPT, 0, " PGP: "); else return; --- 110,125 ---- if ((WithCrypto & APPLICATION_PGP) && (WithCrypto & APPLICATION_SMIME)) { if (!msg->security) ! mvaddstr (HDR_CRYPT, SidebarWidth, "Security: "); else if (msg->security & APPLICATION_SMIME) ! mvaddstr (HDR_CRYPT, SidebarWidth, " S/MIME: "); else if (msg->security & APPLICATION_PGP) ! mvaddstr (HDR_CRYPT, SidebarWidth, " PGP: "); } else if ((WithCrypto & APPLICATION_SMIME)) ! mvaddstr (HDR_CRYPT, SidebarWidth, " S/MIME: "); else if ((WithCrypto & APPLICATION_PGP)) ! mvaddstr (HDR_CRYPT, SidebarWidth, " PGP: "); else return; *************** *** 133,139 **** addstr (_("Clear")); clrtoeol (); ! move (HDR_CRYPTINFO, 0); clrtoeol (); if ((WithCrypto & APPLICATION_PGP) && msg->security & APPLICATION_PGP && msg->security & SIGN) --- 133,139 ---- addstr (_("Clear")); clrtoeol (); ! move (HDR_CRYPTINFO, SidebarWidth); clrtoeol (); if ((WithCrypto & APPLICATION_PGP) && msg->security & APPLICATION_PGP && msg->security & SIGN) *************** *** 146,152 **** if ((WithCrypto & APPLICATION_SMIME) && msg->security & APPLICATION_SMIME && (msg->security & ENCRYPT)) { ! mvprintw (HDR_CRYPTINFO, 40, "%s%s", _("Encrypt with: "), NONULL(SmimeCryptAlg)); off = 20; } --- 146,152 ---- if ((WithCrypto & APPLICATION_SMIME) && msg->security & APPLICATION_SMIME && (msg->security & ENCRYPT)) { ! mvprintw (HDR_CRYPTINFO, SidebarWidth + 40, "%s%s", _("Encrypt with: "), NONULL(SmimeCryptAlg)); off = 20; } *************** *** 308,314 **** int c; char *t; ! mvaddstr (HDR_MIX, 0, " Mix: "); if (!chain) { --- 308,314 ---- int c; char *t; ! mvaddstr (HDR_MIX, SidebarWidth, " Mix: "); if (!chain) { *************** *** 323,329 **** if (t && t[0] == '0' && t[1] == '\0') t = ""; ! if (c + mutt_strlen (t) + 2 >= COLS) break; addstr (NONULL(t)); --- 323,329 ---- if (t && t[0] == '0' && t[1] == '\0') t = ""; ! if (c + mutt_strlen (t) + 2 >= COLS - SidebarWidth) break; addstr (NONULL(t)); *************** *** 375,381 **** buf[0] = 0; rfc822_write_address (buf, sizeof (buf), addr, 1); ! mvprintw (line, 0, TITLE_FMT, Prompts[line - 1]); mutt_paddstr (W, buf); } --- 375,381 ---- buf[0] = 0; rfc822_write_address (buf, sizeof (buf), addr, 1); ! mvprintw (line, SidebarWidth, TITLE_FMT, Prompts[line - 1]); mutt_paddstr (W, buf); } *************** *** 385,394 **** draw_envelope_addr (HDR_TO, msg->env->to); draw_envelope_addr (HDR_CC, msg->env->cc); draw_envelope_addr (HDR_BCC, msg->env->bcc); ! mvprintw (HDR_SUBJECT, 0, TITLE_FMT, Prompts[HDR_SUBJECT - 1]); mutt_paddstr (W, NONULL (msg->env->subject)); draw_envelope_addr (HDR_REPLYTO, msg->env->reply_to); ! mvprintw (HDR_FCC, 0, TITLE_FMT, Prompts[HDR_FCC - 1]); mutt_paddstr (W, fcc); if (WithCrypto) --- 385,394 ---- draw_envelope_addr (HDR_TO, msg->env->to); draw_envelope_addr (HDR_CC, msg->env->cc); draw_envelope_addr (HDR_BCC, msg->env->bcc); ! mvprintw (HDR_SUBJECT, SidebarWidth, TITLE_FMT, Prompts[HDR_SUBJECT - 1]); mutt_paddstr (W, NONULL (msg->env->subject)); draw_envelope_addr (HDR_REPLYTO, msg->env->reply_to); ! mvprintw (HDR_FCC, SidebarWidth, TITLE_FMT, Prompts[HDR_FCC - 1]); mutt_paddstr (W, fcc); if (WithCrypto) *************** *** 399,405 **** #endif SETCOLOR (MT_COLOR_STATUS); ! mvaddstr (HDR_ATTACH - 1, 0, _("-- Attachments")); BKGDSET (MT_COLOR_STATUS); clrtoeol (); --- 399,405 ---- #endif SETCOLOR (MT_COLOR_STATUS); ! mvaddstr (HDR_ATTACH - 1, SidebarWidth, _("-- Attachments")); BKGDSET (MT_COLOR_STATUS); clrtoeol (); *************** *** 437,443 **** /* redraw the expanded list so the user can see the result */ buf[0] = 0; rfc822_write_address (buf, sizeof (buf), *addr, 1); ! move (line, HDR_XOFFSET); mutt_paddstr (W, buf); return 0; --- 437,443 ---- /* redraw the expanded list so the user can see the result */ buf[0] = 0; rfc822_write_address (buf, sizeof (buf), *addr, 1); ! move (line, HDR_XOFFSET+SidebarWidth); mutt_paddstr (W, buf); return 0; *************** *** 679,685 **** if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0) { mutt_str_replace (&msg->env->subject, buf); ! move (HDR_SUBJECT, HDR_XOFFSET); clrtoeol (); if (msg->env->subject) mutt_paddstr (W, msg->env->subject); --- 679,685 ---- if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0) { mutt_str_replace (&msg->env->subject, buf); ! move (HDR_SUBJECT, HDR_XOFFSET + SidebarWidth); clrtoeol (); if (msg->env->subject) mutt_paddstr (W, msg->env->subject); *************** *** 694,700 **** { strfcpy (fcc, buf, _POSIX_PATH_MAX); mutt_pretty_mailbox (fcc); ! move (HDR_FCC, HDR_XOFFSET); mutt_paddstr (W, fcc); fccSet = 1; } --- 694,700 ---- { strfcpy (fcc, buf, _POSIX_PATH_MAX); mutt_pretty_mailbox (fcc); ! move (HDR_FCC, HDR_XOFFSET + SidebarWidth); mutt_paddstr (W, fcc); fccSet = 1; } diff -N -c -r mutt-1.5.6.orig/curs_main.c mutt-1.5.6/curs_main.c *** mutt-1.5.6.orig/curs_main.c 2003-11-05 04:41:31.000000000 -0500 --- mutt-1.5.6/curs_main.c 2004-06-04 03:12:46.000000000 -0400 *************** *** 24,29 **** --- 24,30 ---- #include "sort.h" #include "buffy.h" #include "mx.h" + #include "sidebar.h" #ifdef USE_POP #include "pop.h" *************** *** 534,539 **** --- 535,541 ---- if (menu->redraw & REDRAW_FULL) { menu_redraw_full (menu); + draw_sidebar(menu->menu); mutt_show_error (); } *************** *** 556,562 **** --- 558,566 ---- if (menu->redraw & REDRAW_STATUS) { + DrawFullLine = 1; menu_status_line (buf, sizeof (buf), menu, NONULL (Status)); + DrawFullLine = 0; CLEARLINE (option (OPTSTATUSONTOP) ? 0 : LINES-2); SETCOLOR (MT_COLOR_STATUS); mutt_paddstr (COLS, buf); *************** *** 1033,1038 **** --- 1037,1043 ---- menu->redraw = REDRAW_FULL; break; + case OP_OPEN_MBOX: case OP_MAIN_CHANGE_FOLDER: if (attach_msg) *************** *** 1050,1056 **** buf[0] = '\0'; mutt_buffy (buf, sizeof (buf)); ! if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1) break; if (!buf[0]) { --- 1055,1063 ---- buf[0] = '\0'; mutt_buffy (buf, sizeof (buf)); ! if ( op == OP_OPEN_MBOX ) ! strncpy( buf, CurBuffy->path, sizeof(buf) ); ! else if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1) break; if (!buf[0]) { *************** *** 1059,1064 **** --- 1066,1072 ---- } mutt_expand_path (buf, sizeof (buf)); + set_curbuffy(buf); if (mx_get_magic (buf) <= 0) { mutt_error (_("%s is not a mailbox."), buf); *************** *** 2071,2076 **** --- 2079,2090 ---- mutt_what_key(); break; + case OP_SCROLL_MBOX_UP: + case OP_SCROLL_MBOX_DOWN: + case OP_NEXT_MBOX: + case OP_PREV_MBOX: + scroll_sidebar(op, menu->menu); + break; default: if (menu->menu == MENU_MAIN) km_error_key (MENU_MAIN); diff -N -c -r mutt-1.5.6.orig/doc/instdoc mutt-1.5.6/doc/instdoc *** mutt-1.5.6.orig/doc/instdoc 1969-12-31 19:00:00.000000000 -0500 --- mutt-1.5.6/doc/instdoc 2004-06-04 02:55:13.000000000 -0400 *************** *** 0 **** --- 1,24 ---- + #!/bin/sh -- + + prefix=/home/thomer/install + exec_prefix=${prefix} + bindir=${exec_prefix}/bin + libdir=${exec_prefix}/lib + mandir=${prefix}/man + srcdir=. + docdir=/home/thomer/install/doc/mutt + includedir=${prefix}/include + top_srcdir=.. + top_builddir=.. + + SOURCE="$1" + TARGET="$2" + + + rm -f "$TARGET" + + sed -e "s;/usr/local/bin/;$bindir/;g" \ + -e "s;/usr/local/doc/mutt/;$docdir/;g" \ + "$SOURCE" > $TARGET + + chmod 644 "$TARGET" diff -N -c -r mutt-1.5.6.orig/doc/manual.sgml mutt-1.5.6/doc/manual.sgml *** mutt-1.5.6.orig/doc/manual.sgml 2004-02-01 13:22:19.000000000 -0500 --- mutt-1.5.6/doc/manual.sgml 2004-06-04 03:01:41.000000000 -0400 *************** *** 3551,3557 **** dotlock_program