Sun, 05 Aug 2012 21:46:09 +0200
Import package vendor original specs for necessary manipulations.
mutt/mailcap | file | annotate | diff | comparison | revisions | |
mutt/mutt.patch | file | annotate | diff | comparison | revisions | |
mutt/mutt.patch.sidebar | file | annotate | diff | comparison | revisions | |
mutt/mutt.spec | file | annotate | diff | comparison | revisions | |
mutt/muttrc | file | annotate | diff | comparison | revisions |
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/mutt/mailcap Sun Aug 05 21:46:09 2012 +0200 1.3 @@ -0,0 +1,18 @@ 1.4 +## 1.5 +## @l_prefix@/etc/mutt/mailcap -- Global Mutt Mail Capability Database 1.6 +## Copyright (c) 1998-2003 Ralf S. Engelschall <rse@engelschall.com> 1.7 +## 1.8 + 1.9 +text/html; (w3m %s) 2>/dev/null || (lynx %s) 2>/dev/null || mozilla -remote openURL\(%s\); nametemplate=%s.html 1.10 +text/html; (w3m -dump %s) 2>/dev/null || (lynx -dump %s) 2>/dev/null || cat; nametemplate=%s.html; copiousoutput 1.11 +image/*; (display %s) 2>/dev/null || xv %s 1.12 +image/*; (anytopnm %s | pnmscale -xysize 80 46 | ppmtopgm | pgmtopbm | pbmtoascii -1x2) 2>&1; copiousoutput 1.13 +video/*; mplayer %s 1.14 +application/pdf; (acroread %s) 2>/dev/null || (mgv %s) 2>/dev/null || (gv %s) 2>/dev/null || (ghostview %s) 2>/dev/null || gs %s 1.15 +application/postscript; (mgv %s) 2>/dev/null || (gv %s) 2>/dev/null || (ghostview %s) 2>/dev/null || gs %s 1.16 +application/x-dvi; xdvi %s 1.17 +application/vnd.ms-powerpoint; (msov --format=ppt %s) 2>/dev/null || openoffice %s 1.18 +application/vnd.ms-excel; (msov --format=xls %s) 2>/dev/null || openoffice %s 1.19 +application/vnd.ms-word; (msov --format=doc %s) 2>/dev/null || openoffice %s 1.20 +application/msword; (msov --format=doc %s) 2>/dev/null || openoffice %s 1.21 +
2.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 2.2 +++ b/mutt/mutt.patch Sun Aug 05 21:46:09 2012 +0200 2.3 @@ -0,0 +1,33 @@ 2.4 +--- ./crypt-gpgme.c.orig 2009-07-01 21:28:51.000000000 -0400 2.5 ++++ ./crypt-gpgme.c 2009-07-01 21:31:52.000000000 -0400 2.6 +@@ -342,6 +342,7 @@ 2.7 + gpgme_error_t err; 2.8 + gpgme_ctx_t ctx; 2.9 + 2.10 ++ gpgme_check_version (NULL); 2.11 + if (!GpgmeLocaleSet) 2.12 + { 2.13 + gpgme_set_locale (NULL, LC_CTYPE, setlocale (LC_CTYPE, NULL)); 2.14 +--- imap/message.c 2.15 ++++ imap/message.c 2.16 +@@ -288,7 +288,7 @@ 2.17 + continue; 2.18 + } 2.19 + /* May receive FLAGS updates in a separate untagged response (#2935) */ 2.20 +- if (idx < ctx->msgcount) 2.21 ++ if (ctx->hdrs[idx] != NULL) 2.22 + { 2.23 + dprint (2, (debugfile, "imap_read_headers: message %d is not new\n", 2.24 + h.sid)); 2.25 +Index: configure 2.26 +--- configure.orig 2010-08-25 18:31:47.000000000 +0200 2.27 ++++ configure 2011-01-23 12:26:36.000000000 +0100 2.28 +@@ -9723,7 +9723,7 @@ 2.29 + fi 2.30 + 2.31 + saved_LIBS="$LIBS" 2.32 +- LIBS= 2.33 ++ #LIBS= 2.34 + 2.35 + # OpenSolaris provides a SASL2 interface in libsasl 2.36 + sasl_libs="sasl2 sasl"
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 3.2 +++ b/mutt/mutt.patch.sidebar Sun Aug 05 21:46:09 2012 +0200 3.3 @@ -0,0 +1,1391 @@ 3.4 +The Mutt "sidebar" patch as taken over by Debian for Mutt 1.5.21 3.5 +but with the patches for Makefile.in applied again. 3.6 + 3.7 +Index: Makefile.am 3.8 +--- Makefile.am.orig 2010-08-24 18:34:21.000000000 +0200 3.9 ++++ Makefile.am 2011-01-17 19:33:57.000000000 +0100 3.10 +@@ -33,7 +33,7 @@ 3.11 + score.c send.c sendlib.c signal.c sort.c \ 3.12 + status.c system.c thread.c charset.c history.c lib.c \ 3.13 + muttlib.c editmsg.c mbyte.c \ 3.14 +- url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c 3.15 ++ url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c sidebar.c 3.16 + 3.17 + nodist_mutt_SOURCES = $(BUILT_SOURCES) 3.18 + 3.19 +Index: Makefile.in 3.20 +--- Makefile.in.orig 2010-08-25 18:31:48.000000000 +0200 3.21 ++++ Makefile.in 2011-01-17 19:33:57.000000000 +0100 3.22 +@@ -85,7 +85,7 @@ 3.23 + system.$(OBJEXT) thread.$(OBJEXT) charset.$(OBJEXT) \ 3.24 + history.$(OBJEXT) lib.$(OBJEXT) muttlib.$(OBJEXT) \ 3.25 + editmsg.$(OBJEXT) mbyte.$(OBJEXT) url.$(OBJEXT) \ 3.26 +- ascii.$(OBJEXT) crypt-mod.$(OBJEXT) safe_asprintf.$(OBJEXT) 3.27 ++ ascii.$(OBJEXT) crypt-mod.$(OBJEXT) safe_asprintf.$(OBJEXT) sidebar.$(OBJEXT) 3.28 + am__objects_1 = 3.29 + am__objects_2 = patchlist.$(OBJEXT) $(am__objects_1) 3.30 + nodist_mutt_OBJECTS = $(am__objects_2) 3.31 +@@ -359,7 +359,7 @@ 3.32 + score.c send.c sendlib.c signal.c sort.c \ 3.33 + status.c system.c thread.c charset.c history.c lib.c \ 3.34 + muttlib.c editmsg.c mbyte.c \ 3.35 +- url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c 3.36 ++ url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c sidebar.c 3.37 + 3.38 + nodist_mutt_SOURCES = $(BUILT_SOURCES) 3.39 + mutt_LDADD = @MUTT_LIB_OBJECTS@ @LIBOBJS@ $(LIBIMAP) $(MUTTLIBS) \ 3.40 +@@ -391,7 +391,7 @@ 3.41 + README.SSL smime.h group.h \ 3.42 + muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \ 3.43 + ChangeLog mkchangelog.sh mutt_idna.h \ 3.44 +- snprintf.c regex.c crypt-gpgme.h hcachever.sh.in 3.45 ++ snprintf.c regex.c crypt-gpgme.h sidebar.h hcachever.sh.in 3.46 + 3.47 + EXTRA_SCRIPTS = smime_keys 3.48 + mutt_dotlock_SOURCES = mutt_dotlock.c 3.49 +Index: OPS 3.50 +--- OPS.orig 2010-03-01 18:56:19.000000000 +0100 3.51 ++++ OPS 2011-01-17 19:33:15.000000000 +0100 3.52 +@@ -179,3 +179,8 @@ 3.53 + OP_MAIN_SHOW_LIMIT "show currently active limit pattern" 3.54 + OP_MAIN_COLLAPSE_THREAD "collapse/uncollapse current thread" 3.55 + OP_MAIN_COLLAPSE_ALL "collapse/uncollapse all threads" 3.56 ++OP_SIDEBAR_SCROLL_UP "scroll the mailbox pane up 1 page" 3.57 ++OP_SIDEBAR_SCROLL_DOWN "scroll the mailbox pane down 1 page" 3.58 ++OP_SIDEBAR_NEXT "go down to next mailbox" 3.59 ++OP_SIDEBAR_PREV "go to previous mailbox" 3.60 ++OP_SIDEBAR_OPEN "open hilighted mailbox" 3.61 +Index: buffy.c 3.62 +--- buffy.c.orig 2010-09-13 19:19:55.000000000 +0200 3.63 ++++ buffy.c 2011-01-17 19:33:15.000000000 +0100 3.64 +@@ -312,6 +312,10 @@ 3.65 + return 0; 3.66 + } 3.67 + 3.68 ++ mailbox->msgcount = 0; 3.69 ++ mailbox->msg_unread = 0; 3.70 ++ mailbox->msg_flagged = 0; 3.71 ++ 3.72 + while ((de = readdir (dirp)) != NULL) 3.73 + { 3.74 + if (*de->d_name == '.') 3.75 +@@ -329,7 +333,9 @@ 3.76 + continue; 3.77 + } 3.78 + /* one new and undeleted message is enough */ 3.79 +- mailbox->new = 1; 3.80 ++ mailbox->has_new = mailbox->new = 1; 3.81 ++ mailbox->msgcount++; 3.82 ++ mailbox->msg_unread++; 3.83 + rc = 1; 3.84 + break; 3.85 + } 3.86 +@@ -337,6 +343,32 @@ 3.87 + 3.88 + closedir (dirp); 3.89 + 3.90 ++ /* 3.91 ++ * count read messages (for folderlist (sidebar) we also need to count 3.92 ++ * messages in cur so that we the total number of messages 3.93 ++ */ 3.94 ++ snprintf (path, sizeof (path), "%s/cur", mailbox->path); 3.95 ++ if ((dirp = opendir (path)) == NULL) 3.96 ++ { 3.97 ++ mailbox->magic = 0; 3.98 ++ } 3.99 ++ while ((de = readdir (dirp)) != NULL) 3.100 ++ { 3.101 ++ char *p; 3.102 ++ if (*de->d_name != '.') { 3.103 ++ if ((p = strstr (de->d_name, ":2,"))) { 3.104 ++ if (!strchr (p + 3, 'T')) { 3.105 ++ mailbox->msgcount++; 3.106 ++ if ( !strchr (p + 3, 'S')) 3.107 ++ mailbox->msg_unread++; 3.108 ++ if (strchr(p + 3, 'F')) 3.109 ++ mailbox->msg_flagged++; 3.110 ++ } 3.111 ++ } else 3.112 ++ mailbox->msgcount++; 3.113 ++ } 3.114 ++ } 3.115 ++ 3.116 + return rc; 3.117 + } 3.118 + 3.119 +@@ -345,14 +377,33 @@ 3.120 + { 3.121 + int rc = 0; 3.122 + int statcheck; 3.123 ++ CONTEXT *ctx; 3.124 + 3.125 + if (option (OPTCHECKMBOXSIZE)) 3.126 + statcheck = sb->st_size > mailbox->size; 3.127 + else 3.128 + statcheck = sb->st_mtime > sb->st_atime 3.129 + || (mailbox->newly_created && sb->st_ctime == sb->st_mtime && sb->st_ctime == sb->st_atime); 3.130 +- if (statcheck) 3.131 ++ if (statcheck || mailbox->msgcount == 0) 3.132 + { 3.133 ++ BUFFY b = *mailbox; 3.134 ++ int msgcount = 0; 3.135 ++ int msg_unread = 0; 3.136 ++ /* parse the mailbox, to see how much mail there is */ 3.137 ++ ctx = mx_open_mailbox( mailbox->path, M_READONLY | M_QUIET | M_NOSORT | M_PEEK, NULL); 3.138 ++ if(ctx) 3.139 ++ { 3.140 ++ msgcount = ctx->msgcount; 3.141 ++ msg_unread = ctx->unread; 3.142 ++ mx_close_mailbox(ctx, 0); 3.143 ++ } 3.144 ++ *mailbox = b; 3.145 ++ mailbox->msgcount = msgcount; 3.146 ++ mailbox->msg_unread = msg_unread; 3.147 ++ if(statcheck) 3.148 ++ { 3.149 ++ mailbox->has_new = mailbox->new = 1; 3.150 ++ } 3.151 + if (!option(OPTMAILCHECKRECENT) || sb->st_mtime > mailbox->last_visited) 3.152 + { 3.153 + rc = 1; 3.154 +@@ -374,9 +425,11 @@ 3.155 + int mutt_buffy_check (int force) 3.156 + { 3.157 + BUFFY *tmp; 3.158 ++ struct dirent *de, *dp; 3.159 + struct stat sb; 3.160 + struct stat contex_sb; 3.161 + time_t t; 3.162 ++ CONTEXT *ctx; 3.163 + 3.164 + sb.st_size=0; 3.165 + contex_sb.st_dev=0; 3.166 +@@ -456,6 +509,20 @@ 3.167 + case M_MH: 3.168 + if ((tmp->new = mh_buffy (tmp->path)) > 0) 3.169 + BuffyCount++; 3.170 ++ 3.171 ++ if ((dp = opendir (tmp->path)) == NULL) 3.172 ++ break; 3.173 ++ tmp->msgcount = 0; 3.174 ++ while ((de = readdir (dp))) 3.175 ++ { 3.176 ++ if (mh_valid_message (de->d_name)) 3.177 ++ { 3.178 ++ tmp->msgcount++; 3.179 ++ tmp->has_new = tmp->new = 1; 3.180 ++ } 3.181 ++ } 3.182 ++ closedir (dp); 3.183 ++ 3.184 + break; 3.185 + } 3.186 + } 3.187 +Index: buffy.h 3.188 +--- buffy.h.orig 2010-09-13 19:19:55.000000000 +0200 3.189 ++++ buffy.h 2011-01-17 19:33:15.000000000 +0100 3.190 +@@ -25,7 +25,12 @@ 3.191 + char path[_POSIX_PATH_MAX]; 3.192 + off_t size; 3.193 + struct buffy_t *next; 3.194 ++ struct buffy_t *prev; 3.195 + short new; /* mailbox has new mail */ 3.196 ++ short has_new; /* set it new if new and not read */ 3.197 ++ int msgcount; /* total number of messages */ 3.198 ++ int msg_unread; /* number of unread messages */ 3.199 ++ int msg_flagged; /* number of flagged messages */ 3.200 + short notified; /* user has been notified */ 3.201 + short magic; /* mailbox type */ 3.202 + short newly_created; /* mbox or mmdf just popped into existence */ 3.203 +Index: color.c 3.204 +--- color.c.orig 2009-05-15 19:18:23.000000000 +0200 3.205 ++++ color.c 2011-01-17 19:33:15.000000000 +0100 3.206 +@@ -93,6 +93,8 @@ 3.207 + { "bold", MT_COLOR_BOLD }, 3.208 + { "underline", MT_COLOR_UNDERLINE }, 3.209 + { "index", MT_COLOR_INDEX }, 3.210 ++ { "sidebar_new", MT_COLOR_NEW }, 3.211 ++ { "sidebar_flagged", MT_COLOR_FLAGGED }, 3.212 + { NULL, 0 } 3.213 + }; 3.214 + 3.215 +Index: compose.c 3.216 +--- compose.c.orig 2010-04-14 20:50:19.000000000 +0200 3.217 ++++ compose.c 2011-01-17 19:33:15.000000000 +0100 3.218 +@@ -72,7 +72,7 @@ 3.219 + 3.220 + #define HDR_XOFFSET 10 3.221 + #define TITLE_FMT "%10s" /* Used for Prompts, which are ASCII */ 3.222 +-#define W (COLS - HDR_XOFFSET) 3.223 ++#define W (COLS - HDR_XOFFSET - SidebarWidth) 3.224 + 3.225 + static char *Prompts[] = 3.226 + { 3.227 +@@ -112,7 +112,7 @@ 3.228 + { 3.229 + int off = 0; 3.230 + 3.231 +- mvaddstr (HDR_CRYPT, 0, "Security: "); 3.232 ++ mvaddstr (HDR_CRYPT, SidebarWidth, "Security: "); 3.233 + 3.234 + if ((WithCrypto & (APPLICATION_PGP | APPLICATION_SMIME)) == 0) 3.235 + { 3.236 +@@ -144,7 +144,7 @@ 3.237 + } 3.238 + 3.239 + clrtoeol (); 3.240 +- move (HDR_CRYPTINFO, 0); 3.241 ++ move (HDR_CRYPTINFO, SidebarWidth); 3.242 + clrtoeol (); 3.243 + 3.244 + if ((WithCrypto & APPLICATION_PGP) 3.245 +@@ -161,7 +161,7 @@ 3.246 + && (msg->security & ENCRYPT) 3.247 + && SmimeCryptAlg 3.248 + && *SmimeCryptAlg) { 3.249 +- mvprintw (HDR_CRYPTINFO, 40, "%s%s", _("Encrypt with: "), 3.250 ++ mvprintw (HDR_CRYPTINFO, SidebarWidth + 40, "%s%s", _("Encrypt with: "), 3.251 + NONULL(SmimeCryptAlg)); 3.252 + off = 20; 3.253 + } 3.254 +@@ -175,7 +175,7 @@ 3.255 + int c; 3.256 + char *t; 3.257 + 3.258 +- mvaddstr (HDR_MIX, 0, " Mix: "); 3.259 ++ mvaddstr (HDR_MIX, SidebarWidth, " Mix: "); 3.260 + 3.261 + if (!chain) 3.262 + { 3.263 +@@ -190,7 +190,7 @@ 3.264 + if (t && t[0] == '0' && t[1] == '\0') 3.265 + t = "<random>"; 3.266 + 3.267 +- if (c + mutt_strlen (t) + 2 >= COLS) 3.268 ++ if (c + mutt_strlen (t) + 2 >= COLS - SidebarWidth) 3.269 + break; 3.270 + 3.271 + addstr (NONULL(t)); 3.272 +@@ -242,7 +242,7 @@ 3.273 + 3.274 + buf[0] = 0; 3.275 + rfc822_write_address (buf, sizeof (buf), addr, 1); 3.276 +- mvprintw (line, 0, TITLE_FMT, Prompts[line - 1]); 3.277 ++ mvprintw (line, SidebarWidth, TITLE_FMT, Prompts[line - 1]); 3.278 + mutt_paddstr (W, buf); 3.279 + } 3.280 + 3.281 +@@ -252,10 +252,10 @@ 3.282 + draw_envelope_addr (HDR_TO, msg->env->to); 3.283 + draw_envelope_addr (HDR_CC, msg->env->cc); 3.284 + draw_envelope_addr (HDR_BCC, msg->env->bcc); 3.285 +- mvprintw (HDR_SUBJECT, 0, TITLE_FMT, Prompts[HDR_SUBJECT - 1]); 3.286 ++ mvprintw (HDR_SUBJECT, SidebarWidth, TITLE_FMT, Prompts[HDR_SUBJECT - 1]); 3.287 + mutt_paddstr (W, NONULL (msg->env->subject)); 3.288 + draw_envelope_addr (HDR_REPLYTO, msg->env->reply_to); 3.289 +- mvprintw (HDR_FCC, 0, TITLE_FMT, Prompts[HDR_FCC - 1]); 3.290 ++ mvprintw (HDR_FCC, SidebarWidth, TITLE_FMT, Prompts[HDR_FCC - 1]); 3.291 + mutt_paddstr (W, fcc); 3.292 + 3.293 + if (WithCrypto) 3.294 +@@ -266,7 +266,7 @@ 3.295 + #endif 3.296 + 3.297 + SETCOLOR (MT_COLOR_STATUS); 3.298 +- mvaddstr (HDR_ATTACH - 1, 0, _("-- Attachments")); 3.299 ++ mvaddstr (HDR_ATTACH - 1, SidebarWidth, _("-- Attachments")); 3.300 + BKGDSET (MT_COLOR_STATUS); 3.301 + clrtoeol (); 3.302 + 3.303 +@@ -304,7 +304,7 @@ 3.304 + /* redraw the expanded list so the user can see the result */ 3.305 + buf[0] = 0; 3.306 + rfc822_write_address (buf, sizeof (buf), *addr, 1); 3.307 +- move (line, HDR_XOFFSET); 3.308 ++ move (line, HDR_XOFFSET+SidebarWidth); 3.309 + mutt_paddstr (W, buf); 3.310 + 3.311 + return 0; 3.312 +@@ -549,7 +549,7 @@ 3.313 + if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0) 3.314 + { 3.315 + mutt_str_replace (&msg->env->subject, buf); 3.316 +- move (HDR_SUBJECT, HDR_XOFFSET); 3.317 ++ move (HDR_SUBJECT, HDR_XOFFSET + SidebarWidth); 3.318 + clrtoeol (); 3.319 + if (msg->env->subject) 3.320 + mutt_paddstr (W, msg->env->subject); 3.321 +@@ -566,7 +566,7 @@ 3.322 + { 3.323 + strfcpy (fcc, buf, fcclen); 3.324 + mutt_pretty_mailbox (fcc, fcclen); 3.325 +- move (HDR_FCC, HDR_XOFFSET); 3.326 ++ move (HDR_FCC, HDR_XOFFSET + SidebarWidth); 3.327 + mutt_paddstr (W, fcc); 3.328 + fccSet = 1; 3.329 + } 3.330 +Index: curs_main.c 3.331 +--- curs_main.c.orig 2010-09-13 19:19:55.000000000 +0200 3.332 ++++ curs_main.c 2011-01-17 19:33:15.000000000 +0100 3.333 +@@ -26,7 +26,9 @@ 3.334 + #include "mailbox.h" 3.335 + #include "mapping.h" 3.336 + #include "sort.h" 3.337 ++#include "buffy.h" 3.338 + #include "mx.h" 3.339 ++#include "sidebar.h" 3.340 + 3.341 + #ifdef USE_POP 3.342 + #include "pop.h" 3.343 +@@ -519,8 +521,12 @@ 3.344 + menu->redraw |= REDRAW_STATUS; 3.345 + if (do_buffy_notify) 3.346 + { 3.347 +- if (mutt_buffy_notify () && option (OPTBEEPNEW)) 3.348 +- beep (); 3.349 ++ if (mutt_buffy_notify ()) 3.350 ++ { 3.351 ++ menu->redraw |= REDRAW_FULL; 3.352 ++ if (option (OPTBEEPNEW)) 3.353 ++ beep (); 3.354 ++ } 3.355 + } 3.356 + else 3.357 + do_buffy_notify = 1; 3.358 +@@ -532,6 +538,7 @@ 3.359 + if (menu->redraw & REDRAW_FULL) 3.360 + { 3.361 + menu_redraw_full (menu); 3.362 ++ draw_sidebar(menu->menu); 3.363 + mutt_show_error (); 3.364 + } 3.365 + 3.366 +@@ -554,10 +561,13 @@ 3.367 + 3.368 + if (menu->redraw & REDRAW_STATUS) 3.369 + { 3.370 ++ DrawFullLine = 1; 3.371 + menu_status_line (buf, sizeof (buf), menu, NONULL (Status)); 3.372 ++ DrawFullLine = 0; 3.373 + CLEARLINE (option (OPTSTATUSONTOP) ? 0 : LINES-2); 3.374 + SETCOLOR (MT_COLOR_STATUS); 3.375 + BKGDSET (MT_COLOR_STATUS); 3.376 ++ set_buffystats(Context); 3.377 + mutt_paddstr (COLS, buf); 3.378 + SETCOLOR (MT_COLOR_NORMAL); 3.379 + BKGDSET (MT_COLOR_NORMAL); 3.380 +@@ -571,7 +581,7 @@ 3.381 + menu->oldcurrent = -1; 3.382 + 3.383 + if (option (OPTARROWCURSOR)) 3.384 +- move (menu->current - menu->top + menu->offset, 2); 3.385 ++ move (menu->current - menu->top + menu->offset, SidebarWidth + 2); 3.386 + else if (option (OPTBRAILLEFRIENDLY)) 3.387 + move (menu->current - menu->top + menu->offset, 0); 3.388 + else 3.389 +@@ -1069,6 +1079,7 @@ 3.390 + menu->redraw = REDRAW_FULL; 3.391 + break; 3.392 + 3.393 ++ case OP_SIDEBAR_OPEN: 3.394 + case OP_MAIN_CHANGE_FOLDER: 3.395 + case OP_MAIN_NEXT_UNREAD_MAILBOX: 3.396 + 3.397 +@@ -1100,7 +1111,11 @@ 3.398 + { 3.399 + mutt_buffy (buf, sizeof (buf)); 3.400 + 3.401 +- if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1) 3.402 ++ if ( op == OP_SIDEBAR_OPEN ) { 3.403 ++ if(!CurBuffy) 3.404 ++ break; 3.405 ++ strncpy( buf, CurBuffy->path, sizeof(buf) ); 3.406 ++ } else if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1) 3.407 + { 3.408 + if (menu->menu == MENU_PAGER) 3.409 + { 3.410 +@@ -1118,6 +1133,7 @@ 3.411 + } 3.412 + 3.413 + mutt_expand_path (buf, sizeof (buf)); 3.414 ++ set_curbuffy(buf); 3.415 + if (mx_get_magic (buf) <= 0) 3.416 + { 3.417 + mutt_error (_("%s is not a mailbox."), buf); 3.418 +@@ -2208,6 +2224,12 @@ 3.419 + mutt_what_key(); 3.420 + break; 3.421 + 3.422 ++ case OP_SIDEBAR_SCROLL_UP: 3.423 ++ case OP_SIDEBAR_SCROLL_DOWN: 3.424 ++ case OP_SIDEBAR_NEXT: 3.425 ++ case OP_SIDEBAR_PREV: 3.426 ++ scroll_sidebar(op, menu->menu); 3.427 ++ break; 3.428 + default: 3.429 + if (menu->menu == MENU_MAIN) 3.430 + km_error_key (MENU_MAIN); 3.431 +Index: doc/Muttrc 3.432 +--- doc/Muttrc.orig 2010-09-15 19:07:19.000000000 +0200 3.433 ++++ doc/Muttrc 2011-01-17 19:33:15.000000000 +0100 3.434 +@@ -657,6 +657,26 @@ 3.435 + # $crypt_autosign, $crypt_replysign and $smime_is_default. 3.436 + # 3.437 + # 3.438 ++# set sidebar_visible=no 3.439 ++# 3.440 ++# Name: sidebar_visible 3.441 ++# Type: boolean 3.442 ++# Default: no 3.443 ++# 3.444 ++# 3.445 ++# This specifies whether or not to show sidebar (left-side list of folders). 3.446 ++# 3.447 ++# 3.448 ++# set sidebar_width=0 3.449 ++# 3.450 ++# Name: sidebar_width 3.451 ++# Type: number 3.452 ++# Default: 0 3.453 ++# 3.454 ++# 3.455 ++# The width of the sidebar. 3.456 ++# 3.457 ++# 3.458 + # set crypt_autosign=no 3.459 + # 3.460 + # Name: crypt_autosign 3.461 +Index: flags.c 3.462 +--- flags.c.orig 2009-01-04 00:27:10.000000000 +0100 3.463 ++++ flags.c 2011-01-17 19:33:15.000000000 +0100 3.464 +@@ -22,8 +22,10 @@ 3.465 + 3.466 + #include "mutt.h" 3.467 + #include "mutt_curses.h" 3.468 ++#include "mutt_menu.h" 3.469 + #include "sort.h" 3.470 + #include "mx.h" 3.471 ++#include "sidebar.h" 3.472 + 3.473 + void _mutt_set_flag (CONTEXT *ctx, HEADER *h, int flag, int bf, int upd_ctx) 3.474 + { 3.475 +@@ -263,6 +265,7 @@ 3.476 + */ 3.477 + if (h->searched && (changed != h->changed || deleted != ctx->deleted || tagged != ctx->tagged || flagged != ctx->flagged)) 3.478 + h->searched = 0; 3.479 ++ draw_sidebar(0); 3.480 + } 3.481 + 3.482 + void mutt_tag_set_flag (int flag, int bf) 3.483 +Index: functions.h 3.484 +--- functions.h.orig 2010-08-24 18:34:21.000000000 +0200 3.485 ++++ functions.h 2011-01-17 19:33:15.000000000 +0100 3.486 +@@ -169,6 +169,11 @@ 3.487 + { "decrypt-save", OP_DECRYPT_SAVE, NULL }, 3.488 + 3.489 + 3.490 ++ { "sidebar-scroll-up", OP_SIDEBAR_SCROLL_UP, NULL }, 3.491 ++ { "sidebar-scroll-down", OP_SIDEBAR_SCROLL_DOWN, NULL }, 3.492 ++ { "sidebar-next", OP_SIDEBAR_NEXT, NULL }, 3.493 ++ { "sidebar-prev", OP_SIDEBAR_PREV, NULL }, 3.494 ++ { "sidebar-open", OP_SIDEBAR_OPEN, NULL }, 3.495 + { NULL, 0, NULL } 3.496 + }; 3.497 + 3.498 +@@ -272,6 +277,11 @@ 3.499 + 3.500 + { "what-key", OP_WHAT_KEY, NULL }, 3.501 + 3.502 ++ { "sidebar-scroll-up", OP_SIDEBAR_SCROLL_UP, NULL }, 3.503 ++ { "sidebar-scroll-down", OP_SIDEBAR_SCROLL_DOWN, NULL }, 3.504 ++ { "sidebar-next", OP_SIDEBAR_NEXT, NULL }, 3.505 ++ { "sidebar-prev", OP_SIDEBAR_PREV, NULL }, 3.506 ++ { "sidebar-open", OP_SIDEBAR_OPEN, NULL }, 3.507 + { NULL, 0, NULL } 3.508 + }; 3.509 + 3.510 +Index: globals.h 3.511 +--- globals.h.orig 2009-08-25 21:08:52.000000000 +0200 3.512 ++++ globals.h 2011-01-17 19:33:15.000000000 +0100 3.513 +@@ -117,6 +117,7 @@ 3.514 + WHERE char *SendCharset; 3.515 + WHERE char *Sendmail; 3.516 + WHERE char *Shell; 3.517 ++WHERE char *SidebarDelim; 3.518 + WHERE char *Signature; 3.519 + WHERE char *SimpleSearch; 3.520 + #if USE_SMTP 3.521 +@@ -207,6 +208,9 @@ 3.522 + WHERE short ScoreThresholdRead; 3.523 + WHERE short ScoreThresholdFlag; 3.524 + 3.525 ++WHERE struct buffy_t *CurBuffy INITVAL(0); 3.526 ++WHERE short DrawFullLine INITVAL(0); 3.527 ++WHERE short SidebarWidth; 3.528 + #ifdef USE_IMAP 3.529 + WHERE short ImapKeepalive; 3.530 + WHERE short ImapPipelineDepth; 3.531 +Index: imap/command.c 3.532 +--- imap/command.c.orig 2010-09-15 17:39:31.000000000 +0200 3.533 ++++ imap/command.c 2011-01-17 19:33:15.000000000 +0100 3.534 +@@ -1011,6 +1011,13 @@ 3.535 + opened */ 3.536 + status->uidnext = oldun; 3.537 + 3.538 ++ /* Added to make the sidebar show the correct numbers */ 3.539 ++ if (status->messages) 3.540 ++ { 3.541 ++ inc->msgcount = status->messages; 3.542 ++ inc->msg_unread = status->unseen; 3.543 ++ } 3.544 ++ 3.545 + FREE (&value); 3.546 + return; 3.547 + } 3.548 +Index: imap/imap.c 3.549 +--- imap/imap.c.orig 2009-08-25 21:08:52.000000000 +0200 3.550 ++++ imap/imap.c 2011-01-17 19:33:15.000000000 +0100 3.551 +@@ -1521,7 +1521,7 @@ 3.552 + 3.553 + imap_munge_mbox_name (munged, sizeof (munged), name); 3.554 + snprintf (command, sizeof (command), 3.555 +- "STATUS %s (UIDNEXT UIDVALIDITY UNSEEN RECENT)", munged); 3.556 ++ "STATUS %s (UIDNEXT UIDVALIDITY UNSEEN RECENT MESSAGES)", munged); 3.557 + 3.558 + if (imap_exec (idata, command, IMAP_CMD_QUEUE) < 0) 3.559 + { 3.560 +Index: init.h 3.561 +--- init.h.orig 2010-09-15 17:39:31.000000000 +0200 3.562 ++++ init.h 2011-01-17 19:33:15.000000000 +0100 3.563 +@@ -1953,6 +1953,22 @@ 3.564 + ** not used. 3.565 + ** (PGP only) 3.566 + */ 3.567 ++ {"sidebar_delim", DT_STR, R_BOTH, UL &SidebarDelim, "|"}, 3.568 ++ /* 3.569 ++ ** .pp 3.570 ++ ** This specifies the delimiter between the sidebar (if visible) and 3.571 ++ ** other screens. 3.572 ++ */ 3.573 ++ { "sidebar_visible", DT_BOOL, R_BOTH, OPTSIDEBAR, 0 }, 3.574 ++ /* 3.575 ++ ** .pp 3.576 ++ ** This specifies whether or not to show sidebar (left-side list of folders). 3.577 ++ */ 3.578 ++ { "sidebar_width", DT_NUM, R_BOTH, UL &SidebarWidth, 0 }, 3.579 ++ /* 3.580 ++ ** .pp 3.581 ++ ** The width of the sidebar. 3.582 ++ */ 3.583 + { "pgp_use_gpg_agent", DT_BOOL, R_NONE, OPTUSEGPGAGENT, 0}, 3.584 + /* 3.585 + ** .pp 3.586 +Index: mailbox.h 3.587 +--- mailbox.h.orig 2009-04-30 19:33:48.000000000 +0200 3.588 ++++ mailbox.h 2011-01-17 19:33:15.000000000 +0100 3.589 +@@ -27,6 +27,7 @@ 3.590 + #define M_NEWFOLDER (1<<4) /* create a new folder - same as M_APPEND, but uses 3.591 + * safe_fopen() for mbox-style folders. 3.592 + */ 3.593 ++#define M_PEEK (1<<5) /* revert atime back after taking a look (if applicable) */ 3.594 + 3.595 + /* mx_open_new_message() */ 3.596 + #define M_ADD_FROM 1 /* add a From_ line */ 3.597 +Index: mbox.c 3.598 +--- mbox.c.orig 2010-09-13 19:19:55.000000000 +0200 3.599 ++++ mbox.c 2011-01-17 19:33:15.000000000 +0100 3.600 +@@ -100,6 +100,7 @@ 3.601 + mutt_perror (ctx->path); 3.602 + return (-1); 3.603 + } 3.604 ++ ctx->atime = sb.st_atime; 3.605 + ctx->mtime = sb.st_mtime; 3.606 + ctx->size = sb.st_size; 3.607 + 3.608 +@@ -251,6 +252,7 @@ 3.609 + 3.610 + ctx->size = sb.st_size; 3.611 + ctx->mtime = sb.st_mtime; 3.612 ++ ctx->atime = sb.st_atime; 3.613 + 3.614 + #ifdef NFS_ATTRIBUTE_HACK 3.615 + if (sb.st_mtime > sb.st_atime) 3.616 +Index: menu.c 3.617 +--- menu.c.orig 2010-08-25 18:31:40.000000000 +0200 3.618 ++++ menu.c 2011-01-17 19:33:15.000000000 +0100 3.619 +@@ -24,6 +24,7 @@ 3.620 + #include "mutt_curses.h" 3.621 + #include "mutt_menu.h" 3.622 + #include "mbyte.h" 3.623 ++#include "sidebar.h" 3.624 + 3.625 + #include <string.h> 3.626 + #include <stdlib.h> 3.627 +@@ -156,7 +157,7 @@ 3.628 + { 3.629 + char *scratch = safe_strdup (s); 3.630 + int shift = option (OPTARROWCURSOR) ? 3 : 0; 3.631 +- int cols = COLS - shift; 3.632 ++ int cols = COLS - shift - SidebarWidth; 3.633 + 3.634 + mutt_format_string (s, n, cols, cols, FMT_LEFT, ' ', scratch, mutt_strlen (scratch), 1); 3.635 + s[n - 1] = 0; 3.636 +@@ -207,6 +208,7 @@ 3.637 + char buf[LONG_STRING]; 3.638 + int i; 3.639 + 3.640 ++ draw_sidebar(1); 3.641 + for (i = menu->top; i < menu->top + menu->pagelen; i++) 3.642 + { 3.643 + if (i < menu->max) 3.644 +@@ -217,7 +219,7 @@ 3.645 + if (option (OPTARROWCURSOR)) 3.646 + { 3.647 + attrset (menu->color (i)); 3.648 +- CLEARLINE (i - menu->top + menu->offset); 3.649 ++ CLEARLINE_WIN (i - menu->top + menu->offset); 3.650 + 3.651 + if (i == menu->current) 3.652 + { 3.653 +@@ -246,14 +248,14 @@ 3.654 + BKGDSET (MT_COLOR_INDICATOR); 3.655 + } 3.656 + 3.657 +- CLEARLINE (i - menu->top + menu->offset); 3.658 ++ CLEARLINE_WIN (i - menu->top + menu->offset); 3.659 + print_enriched_string (menu->color(i), (unsigned char *) buf, i != menu->current); 3.660 + SETCOLOR (MT_COLOR_NORMAL); 3.661 + BKGDSET (MT_COLOR_NORMAL); 3.662 + } 3.663 + } 3.664 + else 3.665 +- CLEARLINE (i - menu->top + menu->offset); 3.666 ++ CLEARLINE_WIN (i - menu->top + menu->offset); 3.667 + } 3.668 + menu->redraw = 0; 3.669 + } 3.670 +@@ -268,7 +270,7 @@ 3.671 + return; 3.672 + } 3.673 + 3.674 +- move (menu->oldcurrent + menu->offset - menu->top, 0); 3.675 ++ move (menu->oldcurrent + menu->offset - menu->top, SidebarWidth); 3.676 + SETCOLOR (MT_COLOR_NORMAL); 3.677 + BKGDSET (MT_COLOR_NORMAL); 3.678 + 3.679 +@@ -283,13 +285,13 @@ 3.680 + clrtoeol (); 3.681 + menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent); 3.682 + menu_pad_string (buf, sizeof (buf)); 3.683 +- move (menu->oldcurrent + menu->offset - menu->top, 3); 3.684 ++ move (menu->oldcurrent + menu->offset - menu->top, SidebarWidth + 3); 3.685 + print_enriched_string (menu->color(menu->oldcurrent), (unsigned char *) buf, 1); 3.686 + SETCOLOR (MT_COLOR_NORMAL); 3.687 + } 3.688 + 3.689 + /* now draw it in the new location */ 3.690 +- move (menu->current + menu->offset - menu->top, 0); 3.691 ++ move (menu->current + menu->offset - menu->top, SidebarWidth); 3.692 + attrset (menu->color (menu->current)); 3.693 + ADDCOLOR (MT_COLOR_INDICATOR); 3.694 + addstr ("->"); 3.695 +@@ -310,7 +312,7 @@ 3.696 + attrset (menu->color (menu->current)); 3.697 + ADDCOLOR (MT_COLOR_INDICATOR); 3.698 + BKGDSET (MT_COLOR_INDICATOR); 3.699 +- CLEARLINE (menu->current - menu->top + menu->offset); 3.700 ++ CLEARLINE_WIN (menu->current - menu->top + menu->offset); 3.701 + print_enriched_string (menu->color(menu->current), (unsigned char *) buf, 0); 3.702 + SETCOLOR (MT_COLOR_NORMAL); 3.703 + BKGDSET (MT_COLOR_NORMAL); 3.704 +@@ -322,7 +324,7 @@ 3.705 + { 3.706 + char buf[LONG_STRING]; 3.707 + 3.708 +- move (menu->current + menu->offset - menu->top, 0); 3.709 ++ move (menu->current + menu->offset - menu->top, SidebarWidth); 3.710 + menu_make_entry (buf, sizeof (buf), menu, menu->current); 3.711 + menu_pad_string (buf, sizeof (buf)); 3.712 + 3.713 +@@ -875,7 +877,7 @@ 3.714 + 3.715 + 3.716 + if (option (OPTARROWCURSOR)) 3.717 +- move (menu->current - menu->top + menu->offset, 2); 3.718 ++ move (menu->current - menu->top + menu->offset, SidebarWidth + 2); 3.719 + else if (option (OPTBRAILLEFRIENDLY)) 3.720 + move (menu->current - menu->top + menu->offset, 0); 3.721 + else 3.722 +Index: mutt.h 3.723 +--- mutt.h.orig 2010-09-13 19:19:55.000000000 +0200 3.724 ++++ mutt.h 2011-01-17 19:33:15.000000000 +0100 3.725 +@@ -419,6 +419,7 @@ 3.726 + OPTSAVEEMPTY, 3.727 + OPTSAVENAME, 3.728 + OPTSCORE, 3.729 ++ OPTSIDEBAR, 3.730 + OPTSIGDASHES, 3.731 + OPTSIGONTOP, 3.732 + OPTSORTRE, 3.733 +@@ -859,6 +860,7 @@ 3.734 + { 3.735 + char *path; 3.736 + FILE *fp; 3.737 ++ time_t atime; 3.738 + time_t mtime; 3.739 + off_t size; 3.740 + off_t vsize; 3.741 +@@ -893,6 +895,7 @@ 3.742 + unsigned int quiet : 1; /* inhibit status messages? */ 3.743 + unsigned int collapsed : 1; /* are all threads collapsed? */ 3.744 + unsigned int closing : 1; /* mailbox is being closed */ 3.745 ++ unsigned int peekonly : 1; /* just taking a glance, revert atime */ 3.746 + 3.747 + /* driver hooks */ 3.748 + void *data; /* driver specific data */ 3.749 +Index: mutt_curses.h 3.750 +--- mutt_curses.h.orig 2008-03-19 21:07:57.000000000 +0100 3.751 ++++ mutt_curses.h 2011-01-17 19:33:15.000000000 +0100 3.752 +@@ -64,6 +64,7 @@ 3.753 + #undef lines 3.754 + #endif /* lines */ 3.755 + 3.756 ++#define CLEARLINE_WIN(x) move(x,SidebarWidth), clrtoeol() 3.757 + #define CLEARLINE(x) move(x,0), clrtoeol() 3.758 + #define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x) 3.759 + #define BEEP() do { if (option (OPTBEEP)) beep(); } while (0) 3.760 +@@ -126,6 +127,8 @@ 3.761 + MT_COLOR_BOLD, 3.762 + MT_COLOR_UNDERLINE, 3.763 + MT_COLOR_INDEX, 3.764 ++ MT_COLOR_NEW, 3.765 ++ MT_COLOR_FLAGGED, 3.766 + MT_COLOR_MAX 3.767 + }; 3.768 + 3.769 +Index: muttlib.c 3.770 +--- muttlib.c.orig 2010-08-25 18:31:40.000000000 +0200 3.771 ++++ muttlib.c 2011-01-17 19:33:15.000000000 +0100 3.772 +@@ -1286,6 +1286,8 @@ 3.773 + pl = pw = 1; 3.774 + 3.775 + /* see if there's room to add content, else ignore */ 3.776 ++ if ( DrawFullLine ) 3.777 ++ { 3.778 + if ((col < COLS && wlen < destlen) || soft) 3.779 + { 3.780 + int pad; 3.781 +@@ -1329,6 +1331,52 @@ 3.782 + col += wid; 3.783 + src += pl; 3.784 + } 3.785 ++ } 3.786 ++ else 3.787 ++ { 3.788 ++ if ((col < COLS-SidebarWidth && wlen < destlen) || soft) 3.789 ++ { 3.790 ++ int pad; 3.791 ++ 3.792 ++ /* get contents after padding */ 3.793 ++ mutt_FormatString (buf, sizeof (buf), 0, src + pl, callback, data, flags); 3.794 ++ len = mutt_strlen (buf); 3.795 ++ wid = mutt_strwidth (buf); 3.796 ++ 3.797 ++ /* try to consume as many columns as we can, if we don't have 3.798 ++ * memory for that, use as much memory as possible */ 3.799 ++ pad = (COLS - SidebarWidth - col - wid) / pw; 3.800 ++ if (pad > 0 && wlen + (pad * pl) + len > destlen) 3.801 ++ pad = ((signed)(destlen - wlen - len)) / pl; 3.802 ++ if (pad > 0) 3.803 ++ { 3.804 ++ while (pad--) 3.805 ++ { 3.806 ++ memcpy (wptr, src, pl); 3.807 ++ wptr += pl; 3.808 ++ wlen += pl; 3.809 ++ col += pw; 3.810 ++ } 3.811 ++ } 3.812 ++ else if (soft && pad < 0) 3.813 ++ { 3.814 ++ /* \0-terminate dest for length computation in mutt_wstr_trunc() */ 3.815 ++ *wptr = 0; 3.816 ++ /* make sure right part is at most as wide as display */ 3.817 ++ len = mutt_wstr_trunc (buf, destlen, COLS, &wid); 3.818 ++ /* truncate left so that right part fits completely in */ 3.819 ++ wlen = mutt_wstr_trunc (dest, destlen - len, col + pad, &col); 3.820 ++ wptr = dest + wlen; 3.821 ++ } 3.822 ++ if (len + wlen > destlen) 3.823 ++ len = mutt_wstr_trunc (buf, destlen - wlen, COLS - SidebarWidth - col, NULL); 3.824 ++ memcpy (wptr, buf, len); 3.825 ++ wptr += len; 3.826 ++ wlen += len; 3.827 ++ col += wid; 3.828 ++ src += pl; 3.829 ++ } 3.830 ++ } 3.831 + break; /* skip rest of input */ 3.832 + } 3.833 + else if (ch == '|') 3.834 +Index: mx.c 3.835 +--- mx.c.orig 2010-09-13 19:19:55.000000000 +0200 3.836 ++++ mx.c 2011-01-17 19:33:15.000000000 +0100 3.837 +@@ -580,6 +580,7 @@ 3.838 + * M_APPEND open mailbox for appending 3.839 + * M_READONLY open mailbox in read-only mode 3.840 + * M_QUIET only print error messages 3.841 ++ * M_PEEK revert atime where applicable 3.842 + * ctx if non-null, context struct to use 3.843 + */ 3.844 + CONTEXT *mx_open_mailbox (const char *path, int flags, CONTEXT *pctx) 3.845 +@@ -602,6 +603,8 @@ 3.846 + ctx->quiet = 1; 3.847 + if (flags & M_READONLY) 3.848 + ctx->readonly = 1; 3.849 ++ if (flags & M_PEEK) 3.850 ++ ctx->peekonly = 1; 3.851 + 3.852 + if (flags & (M_APPEND|M_NEWFOLDER)) 3.853 + { 3.854 +@@ -701,9 +704,21 @@ 3.855 + void mx_fastclose_mailbox (CONTEXT *ctx) 3.856 + { 3.857 + int i; 3.858 ++#ifndef BUFFY_SIZE 3.859 ++ struct utimbuf ut; 3.860 ++#endif 3.861 + 3.862 + if(!ctx) 3.863 + return; 3.864 ++#ifndef BUFFY_SIZE 3.865 ++ /* fix up the times so buffy won't get confused */ 3.866 ++ if (ctx->peekonly && ctx->path && ctx->mtime > ctx->atime) 3.867 ++ { 3.868 ++ ut.actime = ctx->atime; 3.869 ++ ut.modtime = ctx->mtime; 3.870 ++ utime (ctx->path, &ut); 3.871 ++ } 3.872 ++#endif 3.873 + 3.874 + /* never announce that a mailbox we've just left has new mail. #3290 3.875 + * XXX: really belongs in mx_close_mailbox, but this is a nice hook point */ 3.876 +Index: pager.c 3.877 +--- pager.c.orig 2010-08-25 18:31:40.000000000 +0200 3.878 ++++ pager.c 2011-01-17 19:33:15.000000000 +0100 3.879 +@@ -29,6 +29,7 @@ 3.880 + #include "pager.h" 3.881 + #include "attach.h" 3.882 + #include "mbyte.h" 3.883 ++#include "sidebar.h" 3.884 + 3.885 + #include "mutt_crypt.h" 3.886 + 3.887 +@@ -1099,6 +1100,7 @@ 3.888 + if (check_attachment_marker ((char *)buf) == 0) 3.889 + wrap_cols = COLS; 3.890 + 3.891 ++ wrap_cols -= SidebarWidth; 3.892 + /* FIXME: this should come from lineInfo */ 3.893 + memset(&mbstate, 0, sizeof(mbstate)); 3.894 + 3.895 +@@ -1745,7 +1747,7 @@ 3.896 + if ((redraw & REDRAW_BODY) || topline != oldtopline) 3.897 + { 3.898 + do { 3.899 +- move (bodyoffset, 0); 3.900 ++ move (bodyoffset, SidebarWidth); 3.901 + curline = oldtopline = topline; 3.902 + lines = 0; 3.903 + force_redraw = 0; 3.904 +@@ -1758,6 +1760,7 @@ 3.905 + &QuoteList, &q_level, &force_redraw, &SearchRE) > 0) 3.906 + lines++; 3.907 + curline++; 3.908 ++ move(lines + bodyoffset, SidebarWidth); 3.909 + } 3.910 + last_offset = lineInfo[curline].offset; 3.911 + } while (force_redraw); 3.912 +@@ -1771,6 +1774,7 @@ 3.913 + addch ('~'); 3.914 + addch ('\n'); 3.915 + lines++; 3.916 ++ move(lines + bodyoffset, SidebarWidth); 3.917 + } 3.918 + /* We are going to update the pager status bar, so it isn't 3.919 + * necessary to reset to normal color now. */ 3.920 +@@ -1794,11 +1798,11 @@ 3.921 + /* print out the pager status bar */ 3.922 + SETCOLOR (MT_COLOR_STATUS); 3.923 + BKGDSET (MT_COLOR_STATUS); 3.924 +- CLEARLINE (statusoffset); 3.925 ++ CLEARLINE_WIN (statusoffset); 3.926 + 3.927 + if (IsHeader (extra) || IsMsgAttach (extra)) 3.928 + { 3.929 +- size_t l1 = COLS * MB_LEN_MAX; 3.930 ++ size_t l1 = (COLS-SidebarWidth) * MB_LEN_MAX; 3.931 + size_t l2 = sizeof (buffer); 3.932 + hfi.hdr = (IsHeader (extra)) ? extra->hdr : extra->bdy->hdr; 3.933 + mutt_make_string_info (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt), &hfi, M_FORMAT_MAKEPRINT); 3.934 +@@ -1808,7 +1812,7 @@ 3.935 + { 3.936 + char bn[STRING]; 3.937 + snprintf (bn, sizeof (bn), "%s (%s)", banner, pager_progress_str); 3.938 +- mutt_paddstr (COLS, bn); 3.939 ++ mutt_paddstr (COLS, IsHeader (extra) || IsMsgAttach (extra) ? buffer : banner); 3.940 + } 3.941 + BKGDSET (MT_COLOR_NORMAL); 3.942 + SETCOLOR (MT_COLOR_NORMAL); 3.943 +@@ -1819,18 +1823,23 @@ 3.944 + /* redraw the pager_index indicator, because the 3.945 + * flags for this message might have changed. */ 3.946 + menu_redraw_current (index); 3.947 ++ draw_sidebar(MENU_PAGER); 3.948 + 3.949 + /* print out the index status bar */ 3.950 + menu_status_line (buffer, sizeof (buffer), index, NONULL(Status)); 3.951 + 3.952 +- move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), 0); 3.953 ++ move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), SidebarWidth); 3.954 + SETCOLOR (MT_COLOR_STATUS); 3.955 + BKGDSET (MT_COLOR_STATUS); 3.956 +- mutt_paddstr (COLS, buffer); 3.957 ++ mutt_paddstr (COLS-SidebarWidth, buffer); 3.958 + SETCOLOR (MT_COLOR_NORMAL); 3.959 + BKGDSET (MT_COLOR_NORMAL); 3.960 + } 3.961 + 3.962 ++ /* if we're not using the index, update every time */ 3.963 ++ if ( index == 0 ) 3.964 ++ draw_sidebar(MENU_PAGER); 3.965 ++ 3.966 + redraw = 0; 3.967 + 3.968 + if (option(OPTBRAILLEFRIENDLY)) { 3.969 +@@ -2756,6 +2765,13 @@ 3.970 + mutt_what_key (); 3.971 + break; 3.972 + 3.973 ++ case OP_SIDEBAR_SCROLL_UP: 3.974 ++ case OP_SIDEBAR_SCROLL_DOWN: 3.975 ++ case OP_SIDEBAR_NEXT: 3.976 ++ case OP_SIDEBAR_PREV: 3.977 ++ scroll_sidebar(ch, MENU_PAGER); 3.978 ++ break; 3.979 ++ 3.980 + default: 3.981 + ch = -1; 3.982 + break; 3.983 +Index: sidebar.c 3.984 +--- sidebar.c.orig 2011-01-17 19:33:15.000000000 +0100 3.985 ++++ sidebar.c 2011-01-17 19:33:15.000000000 +0100 3.986 +@@ -0,0 +1,333 @@ 3.987 ++/* 3.988 ++ * Copyright (C) ????-2004 Justin Hibbits <jrh29@po.cwru.edu> 3.989 ++ * Copyright (C) 2004 Thomer M. Gil <mutt@thomer.com> 3.990 ++ * 3.991 ++ * This program is free software; you can redistribute it and/or modify 3.992 ++ * it under the terms of the GNU General Public License as published by 3.993 ++ * the Free Software Foundation; either version 2 of the License, or 3.994 ++ * (at your option) any later version. 3.995 ++ * 3.996 ++ * This program is distributed in the hope that it will be useful, 3.997 ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of 3.998 ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 3.999 ++ * GNU General Public License for more details. 3.1000 ++ * 3.1001 ++ * You should have received a copy of the GNU General Public License 3.1002 ++ * along with this program; if not, write to the Free Software 3.1003 ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. 3.1004 ++ */ 3.1005 ++ 3.1006 ++ 3.1007 ++#if HAVE_CONFIG_H 3.1008 ++# include "config.h" 3.1009 ++#endif 3.1010 ++ 3.1011 ++#include "mutt.h" 3.1012 ++#include "mutt_menu.h" 3.1013 ++#include "mutt_curses.h" 3.1014 ++#include "sidebar.h" 3.1015 ++#include "buffy.h" 3.1016 ++#include <libgen.h> 3.1017 ++#include "keymap.h" 3.1018 ++#include <stdbool.h> 3.1019 ++ 3.1020 ++/*BUFFY *CurBuffy = 0;*/ 3.1021 ++static BUFFY *TopBuffy = 0; 3.1022 ++static BUFFY *BottomBuffy = 0; 3.1023 ++static int known_lines = 0; 3.1024 ++ 3.1025 ++static int quick_log10(int n) 3.1026 ++{ 3.1027 ++ char string[32]; 3.1028 ++ sprintf(string, "%d", n); 3.1029 ++ return strlen(string); 3.1030 ++} 3.1031 ++ 3.1032 ++void calc_boundaries (int menu) 3.1033 ++{ 3.1034 ++ BUFFY *tmp = Incoming; 3.1035 ++ 3.1036 ++ if ( known_lines != LINES ) { 3.1037 ++ TopBuffy = BottomBuffy = 0; 3.1038 ++ known_lines = LINES; 3.1039 ++ } 3.1040 ++ for ( ; tmp->next != 0; tmp = tmp->next ) 3.1041 ++ tmp->next->prev = tmp; 3.1042 ++ 3.1043 ++ if ( TopBuffy == 0 && BottomBuffy == 0 ) 3.1044 ++ TopBuffy = Incoming; 3.1045 ++ if ( BottomBuffy == 0 ) { 3.1046 ++ int count = LINES - 2 - (menu != MENU_PAGER || option(OPTSTATUSONTOP)); 3.1047 ++ BottomBuffy = TopBuffy; 3.1048 ++ while ( --count && BottomBuffy->next ) 3.1049 ++ BottomBuffy = BottomBuffy->next; 3.1050 ++ } 3.1051 ++ else if ( TopBuffy == CurBuffy->next ) { 3.1052 ++ int count = LINES - 2 - (menu != MENU_PAGER); 3.1053 ++ BottomBuffy = CurBuffy; 3.1054 ++ tmp = BottomBuffy; 3.1055 ++ while ( --count && tmp->prev) 3.1056 ++ tmp = tmp->prev; 3.1057 ++ TopBuffy = tmp; 3.1058 ++ } 3.1059 ++ else if ( BottomBuffy == CurBuffy->prev ) { 3.1060 ++ int count = LINES - 2 - (menu != MENU_PAGER); 3.1061 ++ TopBuffy = CurBuffy; 3.1062 ++ tmp = TopBuffy; 3.1063 ++ while ( --count && tmp->next ) 3.1064 ++ tmp = tmp->next; 3.1065 ++ BottomBuffy = tmp; 3.1066 ++ } 3.1067 ++} 3.1068 ++ 3.1069 ++char *make_sidebar_entry(char *box, int size, int new, int flagged) 3.1070 ++{ 3.1071 ++ static char *entry = 0; 3.1072 ++ char *c; 3.1073 ++ int i = 0; 3.1074 ++ int delim_len = strlen(SidebarDelim); 3.1075 ++ 3.1076 ++ c = realloc(entry, SidebarWidth - delim_len + 2); 3.1077 ++ if ( c ) entry = c; 3.1078 ++ entry[SidebarWidth - delim_len + 1] = 0; 3.1079 ++ for (; i < SidebarWidth - delim_len + 1; entry[i++] = ' ' ); 3.1080 ++ i = strlen(box); 3.1081 ++ strncpy( entry, box, i < (SidebarWidth - delim_len + 1) ? i : (SidebarWidth - delim_len + 1) ); 3.1082 ++ 3.1083 ++ if (size == -1) 3.1084 ++ sprintf(entry + SidebarWidth - delim_len - 3, "?"); 3.1085 ++ else if ( new ) { 3.1086 ++ if (flagged > 0) { 3.1087 ++ sprintf( 3.1088 ++ entry + SidebarWidth - delim_len - 5 - quick_log10(size) - quick_log10(new) - quick_log10(flagged), 3.1089 ++ "% d(%d)[%d]", size, new, flagged); 3.1090 ++ } else { 3.1091 ++ sprintf( 3.1092 ++ entry + SidebarWidth - delim_len - 3 - quick_log10(size) - quick_log10(new), 3.1093 ++ "% d(%d)", size, new); 3.1094 ++ } 3.1095 ++ } else if (flagged > 0) { 3.1096 ++ sprintf( entry + SidebarWidth - delim_len - 3 - quick_log10(size) - quick_log10(flagged), "% d[%d]", size, flagged); 3.1097 ++ } else { 3.1098 ++ sprintf( entry + SidebarWidth - delim_len - 1 - quick_log10(size), "% d", size); 3.1099 ++ } 3.1100 ++ return entry; 3.1101 ++} 3.1102 ++ 3.1103 ++void set_curbuffy(char buf[LONG_STRING]) 3.1104 ++{ 3.1105 ++ BUFFY* tmp = CurBuffy = Incoming; 3.1106 ++ 3.1107 ++ if (!Incoming) 3.1108 ++ return; 3.1109 ++ 3.1110 ++ while(1) { 3.1111 ++ if(!strcmp(tmp->path, buf)) { 3.1112 ++ CurBuffy = tmp; 3.1113 ++ break; 3.1114 ++ } 3.1115 ++ 3.1116 ++ if(tmp->next) 3.1117 ++ tmp = tmp->next; 3.1118 ++ else 3.1119 ++ break; 3.1120 ++ } 3.1121 ++} 3.1122 ++ 3.1123 ++int draw_sidebar(int menu) { 3.1124 ++ 3.1125 ++ int lines = option(OPTHELP) ? 1 : 0; 3.1126 ++ BUFFY *tmp; 3.1127 ++#ifndef USE_SLANG_CURSES 3.1128 ++ attr_t attrs; 3.1129 ++#endif 3.1130 ++ short delim_len = strlen(SidebarDelim); 3.1131 ++ short color_pair; 3.1132 ++ 3.1133 ++ static bool initialized = false; 3.1134 ++ static int prev_show_value; 3.1135 ++ static short saveSidebarWidth; 3.1136 ++ 3.1137 ++ /* initialize first time */ 3.1138 ++ if(!initialized) { 3.1139 ++ prev_show_value = option(OPTSIDEBAR); 3.1140 ++ saveSidebarWidth = SidebarWidth; 3.1141 ++ if(!option(OPTSIDEBAR)) SidebarWidth = 0; 3.1142 ++ initialized = true; 3.1143 ++ } 3.1144 ++ 3.1145 ++ /* save or restore the value SidebarWidth */ 3.1146 ++ if(prev_show_value != option(OPTSIDEBAR)) { 3.1147 ++ if(prev_show_value && !option(OPTSIDEBAR)) { 3.1148 ++ saveSidebarWidth = SidebarWidth; 3.1149 ++ SidebarWidth = 0; 3.1150 ++ } else if(!prev_show_value && option(OPTSIDEBAR)) { 3.1151 ++ SidebarWidth = saveSidebarWidth; 3.1152 ++ } 3.1153 ++ prev_show_value = option(OPTSIDEBAR); 3.1154 ++ } 3.1155 ++ 3.1156 ++ 3.1157 ++// if ( SidebarWidth == 0 ) return 0; 3.1158 ++ if (SidebarWidth > 0 && option (OPTSIDEBAR) 3.1159 ++ && delim_len >= SidebarWidth) { 3.1160 ++ unset_option (OPTSIDEBAR); 3.1161 ++ /* saveSidebarWidth = SidebarWidth; */ 3.1162 ++ if (saveSidebarWidth > delim_len) { 3.1163 ++ SidebarWidth = saveSidebarWidth; 3.1164 ++ mutt_error (_("Value for sidebar_delim is too long. Disabling sidebar.")); 3.1165 ++ sleep (2); 3.1166 ++ } else { 3.1167 ++ SidebarWidth = 0; 3.1168 ++ mutt_error (_("Value for sidebar_delim is too long. Disabling sidebar. Please set your sidebar_width to a sane value.")); 3.1169 ++ sleep (4); /* the advise to set a sane value should be seen long enough */ 3.1170 ++ } 3.1171 ++ saveSidebarWidth = 0; 3.1172 ++ return (0); 3.1173 ++ } 3.1174 ++ 3.1175 ++ if ( SidebarWidth == 0 || !option(OPTSIDEBAR)) { 3.1176 ++ if (SidebarWidth > 0) { 3.1177 ++ saveSidebarWidth = SidebarWidth; 3.1178 ++ SidebarWidth = 0; 3.1179 ++ } 3.1180 ++ unset_option(OPTSIDEBAR); 3.1181 ++ return 0; 3.1182 ++ } 3.1183 ++ 3.1184 ++ /* get attributes for divider */ 3.1185 ++ SETCOLOR(MT_COLOR_STATUS); 3.1186 ++#ifndef USE_SLANG_CURSES 3.1187 ++ attr_get(&attrs, &color_pair, 0); 3.1188 ++#else 3.1189 ++ color_pair = attr_get(); 3.1190 ++#endif 3.1191 ++ SETCOLOR(MT_COLOR_NORMAL); 3.1192 ++ 3.1193 ++ /* draw the divider */ 3.1194 ++ 3.1195 ++ for ( ; lines < LINES-1-(menu != MENU_PAGER || option(OPTSTATUSONTOP)); lines++ ) { 3.1196 ++ move(lines, SidebarWidth - delim_len); 3.1197 ++ addstr(NONULL(SidebarDelim)); 3.1198 ++#ifndef USE_SLANG_CURSES 3.1199 ++ mvchgat(lines, SidebarWidth - delim_len, delim_len, 0, color_pair, NULL); 3.1200 ++#endif 3.1201 ++ } 3.1202 ++ 3.1203 ++ if ( Incoming == 0 ) return 0; 3.1204 ++ lines = option(OPTHELP) ? 1 : 0; /* go back to the top */ 3.1205 ++ 3.1206 ++ if ( known_lines != LINES || TopBuffy == 0 || BottomBuffy == 0 ) 3.1207 ++ calc_boundaries(menu); 3.1208 ++ if ( CurBuffy == 0 ) CurBuffy = Incoming; 3.1209 ++ 3.1210 ++ tmp = TopBuffy; 3.1211 ++ 3.1212 ++ SETCOLOR(MT_COLOR_NORMAL); 3.1213 ++ 3.1214 ++ for ( ; tmp && lines < LINES-1 - (menu != MENU_PAGER || option(OPTSTATUSONTOP)); tmp = tmp->next ) { 3.1215 ++ if ( tmp == CurBuffy ) 3.1216 ++ SETCOLOR(MT_COLOR_INDICATOR); 3.1217 ++ else if ( tmp->msg_unread > 0 ) 3.1218 ++ SETCOLOR(MT_COLOR_NEW); 3.1219 ++ else if ( tmp->msg_flagged > 0 ) 3.1220 ++ SETCOLOR(MT_COLOR_FLAGGED); 3.1221 ++ else 3.1222 ++ SETCOLOR(MT_COLOR_NORMAL); 3.1223 ++ 3.1224 ++ move( lines, 0 ); 3.1225 ++ if ( Context && !strcmp( tmp->path, Context->path ) ) { 3.1226 ++ tmp->msg_unread = Context->unread; 3.1227 ++ tmp->msgcount = Context->msgcount; 3.1228 ++ tmp->msg_flagged = Context->flagged; 3.1229 ++ } 3.1230 ++ // check whether Maildir is a prefix of the current folder's path 3.1231 ++ short maildir_is_prefix = 0; 3.1232 ++ if ( (strlen(tmp->path) > strlen(Maildir)) && 3.1233 ++ (strncmp(Maildir, tmp->path, strlen(Maildir)) == 0) ) 3.1234 ++ maildir_is_prefix = 1; 3.1235 ++ // calculate depth of current folder and generate its display name with indented spaces 3.1236 ++ int sidebar_folder_depth = 0; 3.1237 ++ char *sidebar_folder_name; 3.1238 ++ sidebar_folder_name = basename(tmp->path); 3.1239 ++ if ( maildir_is_prefix ) { 3.1240 ++ char *tmp_folder_name; 3.1241 ++ int i; 3.1242 ++ tmp_folder_name = tmp->path + strlen(Maildir); 3.1243 ++ for (i = 0; i < strlen(tmp->path) - strlen(Maildir); i++) { 3.1244 ++ if (tmp_folder_name[i] == '/') sidebar_folder_depth++; 3.1245 ++ } 3.1246 ++ if (sidebar_folder_depth > 0) { 3.1247 ++ sidebar_folder_name = malloc(strlen(basename(tmp->path)) + sidebar_folder_depth + 1); 3.1248 ++ for (i=0; i < sidebar_folder_depth; i++) 3.1249 ++ sidebar_folder_name[i]=' '; 3.1250 ++ sidebar_folder_name[i]=0; 3.1251 ++ strncat(sidebar_folder_name, basename(tmp->path), strlen(basename(tmp->path)) + sidebar_folder_depth); 3.1252 ++ } 3.1253 ++ } 3.1254 ++ printw( "%.*s", SidebarWidth - delim_len + 1, 3.1255 ++ make_sidebar_entry(sidebar_folder_name, tmp->msgcount, 3.1256 ++ tmp->msg_unread, tmp->msg_flagged)); 3.1257 ++ if (sidebar_folder_depth > 0) 3.1258 ++ free(sidebar_folder_name); 3.1259 ++ lines++; 3.1260 ++ } 3.1261 ++ SETCOLOR(MT_COLOR_NORMAL); 3.1262 ++ for ( ; lines < LINES-1 - (menu != MENU_PAGER || option(OPTSTATUSONTOP)); lines++ ) { 3.1263 ++ int i = 0; 3.1264 ++ move( lines, 0 ); 3.1265 ++ for ( ; i < SidebarWidth - delim_len; i++ ) 3.1266 ++ addch(' '); 3.1267 ++ } 3.1268 ++ return 0; 3.1269 ++} 3.1270 ++ 3.1271 ++ 3.1272 ++void set_buffystats(CONTEXT* Context) 3.1273 ++{ 3.1274 ++ BUFFY *tmp = Incoming; 3.1275 ++ while(tmp) { 3.1276 ++ if(Context && !strcmp(tmp->path, Context->path)) { 3.1277 ++ tmp->msg_unread = Context->unread; 3.1278 ++ tmp->msgcount = Context->msgcount; 3.1279 ++ break; 3.1280 ++ } 3.1281 ++ tmp = tmp->next; 3.1282 ++ } 3.1283 ++} 3.1284 ++ 3.1285 ++void scroll_sidebar(int op, int menu) 3.1286 ++{ 3.1287 ++ if(!SidebarWidth) return; 3.1288 ++ if(!CurBuffy) return; 3.1289 ++ 3.1290 ++ switch (op) { 3.1291 ++ case OP_SIDEBAR_NEXT: 3.1292 ++ if ( CurBuffy->next == NULL ) return; 3.1293 ++ CurBuffy = CurBuffy->next; 3.1294 ++ break; 3.1295 ++ case OP_SIDEBAR_PREV: 3.1296 ++ if ( CurBuffy->prev == NULL ) return; 3.1297 ++ CurBuffy = CurBuffy->prev; 3.1298 ++ break; 3.1299 ++ case OP_SIDEBAR_SCROLL_UP: 3.1300 ++ CurBuffy = TopBuffy; 3.1301 ++ if ( CurBuffy != Incoming ) { 3.1302 ++ calc_boundaries(menu); 3.1303 ++ CurBuffy = CurBuffy->prev; 3.1304 ++ } 3.1305 ++ break; 3.1306 ++ case OP_SIDEBAR_SCROLL_DOWN: 3.1307 ++ CurBuffy = BottomBuffy; 3.1308 ++ if ( CurBuffy->next ) { 3.1309 ++ calc_boundaries(menu); 3.1310 ++ CurBuffy = CurBuffy->next; 3.1311 ++ } 3.1312 ++ break; 3.1313 ++ default: 3.1314 ++ return; 3.1315 ++ } 3.1316 ++ calc_boundaries(menu); 3.1317 ++ draw_sidebar(menu); 3.1318 ++} 3.1319 ++ 3.1320 +Index: sidebar.h 3.1321 +--- sidebar.h.orig 2011-01-17 19:33:15.000000000 +0100 3.1322 ++++ sidebar.h 2011-01-17 19:33:15.000000000 +0100 3.1323 +@@ -0,0 +1,36 @@ 3.1324 ++/* 3.1325 ++ * Copyright (C) ????-2004 Justin Hibbits <jrh29@po.cwru.edu> 3.1326 ++ * Copyright (C) 2004 Thomer M. Gil <mutt@thomer.com> 3.1327 ++ * 3.1328 ++ * This program is free software; you can redistribute it and/or modify 3.1329 ++ * it under the terms of the GNU General Public License as published by 3.1330 ++ * the Free Software Foundation; either version 2 of the License, or 3.1331 ++ * (at your option) any later version. 3.1332 ++ * 3.1333 ++ * This program is distributed in the hope that it will be useful, 3.1334 ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of 3.1335 ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 3.1336 ++ * GNU General Public License for more details. 3.1337 ++ * 3.1338 ++ * You should have received a copy of the GNU General Public License 3.1339 ++ * along with this program; if not, write to the Free Software 3.1340 ++ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA. 3.1341 ++ */ 3.1342 ++ 3.1343 ++#ifndef SIDEBAR_H 3.1344 ++#define SIDEBAR_H 3.1345 ++ 3.1346 ++struct MBOX_LIST { 3.1347 ++ char *path; 3.1348 ++ int msgcount; 3.1349 ++ int new; 3.1350 ++} MBLIST; 3.1351 ++ 3.1352 ++/* parameter is whether or not to go to the status line */ 3.1353 ++/* used for omitting the last | that covers up the status bar in the index */ 3.1354 ++int draw_sidebar(int); 3.1355 ++void scroll_sidebar(int, int); 3.1356 ++void set_curbuffy(char*); 3.1357 ++void set_buffystats(CONTEXT*); 3.1358 ++ 3.1359 ++#endif /* SIDEBAR_H */ 3.1360 + 3.1361 +============================================================================== 3.1362 + 3.1363 +Fix drawing of sidebar delimiter with the intended 3.1364 +attributes of the "status" bar --rse 20070906 3.1365 + 3.1366 +Index: sidebar.c 3.1367 +--- sidebar.c.orig 2007-11-04 15:05:17 +0100 3.1368 ++++ sidebar.c 2007-11-04 15:05:17 +0100 3.1369 +@@ -186,23 +186,14 @@ 3.1370 + return 0; 3.1371 + } 3.1372 + 3.1373 +- /* get attributes for divider */ 3.1374 +- SETCOLOR(MT_COLOR_STATUS); 3.1375 +-#ifndef USE_SLANG_CURSES 3.1376 +- attr_get(&attrs, &color_pair, 0); 3.1377 +-#else 3.1378 +- color_pair = attr_get(); 3.1379 +-#endif 3.1380 +- SETCOLOR(MT_COLOR_NORMAL); 3.1381 + 3.1382 + /* draw the divider */ 3.1383 + 3.1384 + for ( ; lines < LINES-1-(menu != MENU_PAGER || option(OPTSTATUSONTOP)); lines++ ) { 3.1385 ++ SETCOLOR(MT_COLOR_STATUS); 3.1386 + move(lines, SidebarWidth - delim_len); 3.1387 + addstr(NONULL(SidebarDelim)); 3.1388 +-#ifndef USE_SLANG_CURSES 3.1389 +- mvchgat(lines, SidebarWidth - delim_len, delim_len, 0, color_pair, NULL); 3.1390 +-#endif 3.1391 ++ SETCOLOR(MT_COLOR_NORMAL); 3.1392 + } 3.1393 + 3.1394 + if ( Incoming == 0 ) return 0;
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 4.2 +++ b/mutt/mutt.spec Sun Aug 05 21:46:09 2012 +0200 4.3 @@ -0,0 +1,270 @@ 4.4 +## 4.5 +## mutt.spec -- OpenPKG RPM Package Specification 4.6 +## Copyright (c) 2000-2011 OpenPKG Foundation e.V. <http://openpkg.net/> 4.7 +## 4.8 +## Permission to use, copy, modify, and distribute this software for 4.9 +## any purpose with or without fee is hereby granted, provided that 4.10 +## the above copyright notice and this permission notice appear in all 4.11 +## copies. 4.12 +## 4.13 +## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED 4.14 +## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 4.15 +## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 4.16 +## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR 4.17 +## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 4.18 +## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 4.19 +## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 4.20 +## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 4.21 +## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 4.22 +## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 4.23 +## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 4.24 +## SUCH DAMAGE. 4.25 +## 4.26 + 4.27 +# package version 4.28 +%define V_mutt 1.5.21 4.29 +%define V_mutt_patches 1.5.21 4.30 + 4.31 +# package information 4.32 +Name: mutt 4.33 +Summary: Mail User Agent 4.34 +URL: http://www.mutt.org/ 4.35 +Vendor: Michael Elkins 4.36 +Packager: OpenPKG Foundation e.V. 4.37 +Distribution: OpenPKG Community 4.38 +Class: BASE 4.39 +Group: Mail 4.40 +License: BSD 4.41 +Version: %{V_mutt} 4.42 +Release: 20110123 4.43 + 4.44 +# build options 4.45 +%option with_pop yes 4.46 +%option with_imap yes 4.47 +%option with_smtp yes 4.48 +%option with_sasl yes 4.49 +%option with_ssl yes 4.50 +%option with_ncurses yes 4.51 +%option with_hcache no 4.52 +%option with_comp no 4.53 +%option with_nntp no 4.54 +%option with_initials no 4.55 +%option with_quote no 4.56 +%option with_sidebar no 4.57 + 4.58 +# list of sources 4.59 +Source0: ftp://ftp.mutt.org/mutt/devel/mutt-%{V_mutt}.tar.gz 4.60 +Source1: mailcap 4.61 +Source2: muttrc 4.62 +Patch0: ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt_patches}/patch-%{V_mutt_patches}.rr.compressed.gz 4.63 +Patch1: ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt_patches}/patch-%{V_mutt_patches}.vvv.nntp.gz 4.64 +Patch2: ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt_patches}/patch-%{V_mutt_patches}.vvv.initials.gz 4.65 +Patch3: ftp://ftp.mutt.org.ua/pub/mutt/mutt-%{V_mutt_patches}/patch-%{V_mutt_patches}.vvv.quote.gz 4.66 +Patch4: mutt.patch.sidebar 4.67 +Patch5: mutt.patch 4.68 + 4.69 +# build information 4.70 +BuildPreReq: OpenPKG, openpkg >= 20100101, make, perl 4.71 +PreReq: OpenPKG, openpkg >= 20100101 4.72 +BuildPreReq: libidn, libiconv 4.73 +PreReq: libidn, libiconv 4.74 +%if "%{with_ssl}" == "yes" 4.75 +BuildPreReq: openssl 4.76 +PreReq: openssl 4.77 +%endif 4.78 +%if "%{with_sasl}" == "yes" 4.79 +BuildPreReq: sasl 4.80 +PreReq: sasl 4.81 +%endif 4.82 +%if "%{with_hcache}" == "yes" 4.83 +BuildPreReq: qdbm 4.84 +PreReq: qdbm 4.85 +%endif 4.86 +%if "%{with_ncurses}" == "yes" 4.87 +BuildPreReq: ncurses 4.88 +PreReq: ncurses 4.89 +%else 4.90 +BuildPreReq: slang 4.91 +PreReq: slang 4.92 +%endif 4.93 + 4.94 +%description 4.95 + Mutt is a small but very powerful text based program for reading 4.96 + electronic mail under Unix operating systems, including support for 4.97 + color terminals, MIME, and a threaded sorting mode. 4.98 + 4.99 +%track 4.100 + prog mutt = { 4.101 + version = %{V_mutt} 4.102 + url = ftp://ftp.mutt.org/mutt/devel/ 4.103 + regex = mutt-(__VER__)\.tar\.gz 4.104 + } 4.105 + prog mutt:patch_rr_compressed = { 4.106 + version = %{V_mutt_patches} 4.107 + url = ftp://ftp.mutt.org.ua/pub/mutt/ 4.108 + regex = mutt-(1\.5(\.\d+)+) 4.109 + url = ftp://ftp.mutt.org.ua/pub/mutt/mutt-__NEWVER__/ 4.110 + regex = patch-(__VER__)\.rr\.compressed\.gz 4.111 + } 4.112 + prog mutt:patch_vvv_initials = { 4.113 + version = %{V_mutt_patches} 4.114 + url = ftp://ftp.mutt.org.ua/pub/mutt/ 4.115 + regex = mutt-(1\.5(\.\d+)+) 4.116 + url = ftp://ftp.mutt.org.ua/pub/mutt/mutt-__NEWVER__/ 4.117 + regex = patch-(__VER__)\.vvv\.initials\.gz 4.118 + } 4.119 + prog mutt:patch_vvv_nntp = { 4.120 + version = %{V_mutt_patches} 4.121 + url = ftp://ftp.mutt.org.ua/pub/mutt/ 4.122 + regex = mutt-(1\.5(\.\d+)+) 4.123 + url = ftp://ftp.mutt.org.ua/pub/mutt/mutt-__NEWVER__/ 4.124 + regex = patch-(__VER__)\.vvv\.nntp\.gz 4.125 + } 4.126 + prog mutt:patch_vvv_quote = { 4.127 + version = %{V_mutt_patches} 4.128 + url = ftp://ftp.mutt.org.ua/pub/mutt/ 4.129 + regex = mutt-(1\.5(\.\d+)+) 4.130 + url = ftp://ftp.mutt.org.ua/pub/mutt/mutt-__NEWVER__/ 4.131 + regex = patch-(__VER__)\.vvv\.quote\.gz 4.132 + } 4.133 + 4.134 +%prep 4.135 + %setup -q -n mutt-%{V_mutt} 4.136 +%if "%{with_comp}" == "yes" 4.137 + %{l_gzip} -d -c <%{PATCH0} |\ 4.138 + sed -e '/^diff.*Makefile\.am/,/^diff/d' \ 4.139 + -e '/^diff.*configure\.in /,/^diff/d' \ 4.140 + -e '/^diff.*acconfig\.h /,/^diff/d' |\ 4.141 + %{l_patch} -p1 4.142 + # add target without requiring autoconf(1) to rebuild Makefile.in 4.143 + # from Makefile.am since definitions of the patch are wrongly 4.144 + # placed at the very beginning of Makefile.in and get overwritten 4.145 + # latter. 4.146 + %{l_shtool} subst -s \ 4.147 + -e 's;^\( \| \{8,\}\)\(crypt.c cryptglue.c .*\)$; compress.c \2;' \ 4.148 + -e 's;^\( attach.h buffy.h charset.h \)\(copy.h .*\)$;\1compress.h \2;' \ 4.149 + -e 's;^\( buffy.$(OBJEXT) color.$(OBJEXT) \)\(.*\)$;\1compress.$(OBJEXT) \2;' \ 4.150 + Makefile.in 4.151 +%endif 4.152 +%if "%{with_nntp}" == "yes" 4.153 + %{l_gzip} -d -c <%{PATCH1} |\ 4.154 + sed -e '/^diff.*configure\.in /,/^diff/d' \ 4.155 + -e '/^diff.*acconfig\.h /,/^diff/d' |\ 4.156 + %{l_patch} -p1 4.157 +%endif 4.158 +%if "%{with_initials}" == "yes" 4.159 + %patch -p1 -P 2 4.160 +%endif 4.161 +%if "%{with_quote}" == "yes" 4.162 + %patch -p1 -P 3 4.163 +%endif 4.164 +%if "%{with_sidebar}" == "yes" 4.165 + %patch -p0 -P 4 4.166 +%endif 4.167 + %patch -p0 -P 5 4.168 + %{l_shtool} subst \ 4.169 + -e 's;\(Mutt/%%s\);\1 %{l_openpkg_release -F "OpenPKG/%%t"};' \ 4.170 + sendlib.c 4.171 + 4.172 +%build 4.173 + # configure for particular platform 4.174 + options='' 4.175 + export CC="%{l_cc}" 4.176 + export CFLAGS="%{l_cflags -O}" 4.177 +%if "%{with_ncurses}" == "yes" 4.178 + export CPPFLAGS="%{l_cppflags ncurses libidn .}" 4.179 +%else 4.180 + export CPPFLAGS="%{l_cppflags libidn .}" 4.181 +%endif 4.182 + export LDFLAGS="-Limap %{l_ldflags}" 4.183 + export LIBS="" 4.184 + export INSTALL="%{l_shtool} install%{l_nil} -c" 4.185 + case "%{l_platform -t}" in 4.186 + *-freebsd* ) options="--enable-flock --disable-fcntl" ;; 4.187 + *-linux* ) LIBS="$LIBS -ldl" ;; 4.188 + esac 4.189 +%if "%{with_sasl}" == "yes" 4.190 + CFLAGS="$CFLAGS `pkg-config sasl --cflags`" 4.191 + LDFLAGS="$LDFLAGS `pkg-config sasl --libs-only-L`" 4.192 + LIBS="$LIBS `pkg-config sasl --libs-only-l`" 4.193 +%endif 4.194 + ./configure \ 4.195 + --prefix=%{l_prefix} \ 4.196 + --mandir=%{l_prefix}/man \ 4.197 + --sysconfdir=%{l_prefix}/etc/mutt \ 4.198 + --with-docdir=%{l_prefix}/share/mutt \ 4.199 +%if "%{with_ncurses}" == "yes" 4.200 + --with-curses=%{l_prefix} \ 4.201 +%else 4.202 + --with-slang=%{l_prefix} \ 4.203 +%endif 4.204 +%if "%{with_pop}" == "yes" 4.205 + --enable-pop \ 4.206 +%endif 4.207 +%if "%{with_imap}" == "yes" 4.208 + --enable-imap \ 4.209 +%endif 4.210 +%if "%{with_smtp}" == "yes" 4.211 + --enable-smtp \ 4.212 +%endif 4.213 +%if "%{with_sasl}" == "yes" 4.214 + --with-sasl=%{l_prefix} \ 4.215 +%endif 4.216 +%if "%{with_ssl}" == "yes" 4.217 + --with-ssl=%{l_prefix} \ 4.218 +%endif 4.219 +%if "%{with_hcache}" == "yes" 4.220 + --enable-hcache \ 4.221 + --with-qdbm=%{l_prefix} \ 4.222 +%endif 4.223 +%if "%{with_comp}" == "yes" 4.224 + --enable-compressed \ 4.225 +%endif 4.226 +%if "%{with_nntp}" == "yes" 4.227 + --enable-nntp \ 4.228 +%endif 4.229 + --enable-pgp \ 4.230 + --enable-smime \ 4.231 + --enable-iconv \ 4.232 + --disable-warnings \ 4.233 + --disable-nls \ 4.234 + $options 4.235 + 4.236 + # perform standard build procedure 4.237 + %{l_make} %{l_mflags} 4.238 + 4.239 +%install 4.240 + 4.241 + # perform standard installation procedure 4.242 + %{l_shtool} subst \ 4.243 + -e "s;chmod 2755;true;" \ 4.244 + -e "s;chgrp mail;true;" \ 4.245 + Makefile 4.246 + %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT 4.247 + 4.248 + # strip down installation tree 4.249 + rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mutt/[A-Za-d]* 4.250 + rm -f $RPM_BUILD_ROOT%{l_prefix}/share/mutt/patch-notes.txt 4.251 + rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/mutt/html 4.252 + rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/mutt/samples 4.253 + rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/flea 4.254 + rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/flea.1 4.255 + rm -f $RPM_BUILD_ROOT%{l_prefix}/bin/muttbug 4.256 + rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man1/muttbug.1 4.257 + strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true 4.258 + 4.259 + # install additional files 4.260 + %{l_shtool} install -c -m 644 %{l_value -s -a} \ 4.261 + %{SOURCE muttrc} $RPM_BUILD_ROOT%{l_prefix}/etc/mutt/Muttrc 4.262 + %{l_shtool} install -c -m 644 %{l_value -s -a} \ 4.263 + %{SOURCE mailcap} $RPM_BUILD_ROOT%{l_prefix}/etc/mutt/mailcap 4.264 + 4.265 + # determine installation files 4.266 + %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ 4.267 + %{l_files_std} \ 4.268 + '%config %{l_prefix}/etc/mutt/*' 4.269 + 4.270 +%files -f files 4.271 + 4.272 +%clean 4.273 +
5.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 5.2 +++ b/mutt/muttrc Sun Aug 05 21:46:09 2012 +0200 5.3 @@ -0,0 +1,93 @@ 5.4 +## 5.5 +## @l_prefix@/etc/mutt/Muttrc -- OpenPKG Mutt Global Configuration 5.6 +## Copyright (c) 1998-2003 Ralf S. Engelschall <rse@engelschall.com> 5.7 +## 5.8 + 5.9 +# ignore CTRL-Z 5.10 +unset suspend 5.11 + 5.12 +# use OpenPKG MTA 5.13 +set sendmail = @l_prefix@/sbin/sendmail 5.14 + 5.15 +# use OpenPKG folder paths 5.16 +set folder = ~/.mail 5.17 +set record = ~/.mail/sent 5.18 +set postponed = ~/.mail/postponed 5.19 +set spoolfile = ~/.mail/inbox 5.20 +set mbox = ~/.mail/inbox 5.21 +mailboxes ~/.mail/inbox 5.22 + 5.23 +# aliases 5.24 +#source ~/.muttrc.aliases 5.25 +set alias_file = ~/.muttrc.aliases 5.26 +set sort_alias = unsorted 5.27 + 5.28 +# signature 5.29 +unset sig_dashes 5.30 +set signature = ~/.signature 5.31 + 5.32 +# editor 5.33 +set editor = `echo ${EDITOR-vi}` 5.34 +set tmpdir = `echo ${TMPDIR-/tmp}` 5.35 + 5.36 +# addresses 5.37 +set use_domain 5.38 + 5.39 +# pager 5.40 +set pager = builtin 5.41 +set pager_context = 1 5.42 +set pager_stop 5.43 +set pager_index_lines = 0 5.44 +ignore received content- mime-version status x-status message-id sender 5.45 +ignore references return-path lines 5.46 +ignore x- 5.47 +ignore "from " 5.48 + 5.49 +# display customization 5.50 +set to_chars = "L CC " 5.51 +set charset = iso-8859-1 5.52 +set quote_regexp="^[ \t]*([A-Za-z ]+>|[]>:}][]>:}]*)" 5.53 +set smileys="(>From )|(>?[;:][-^]?[][)(><}{|/DP][)}]*)" 5.54 +mono quoted bold 5.55 +mono markers bold 5.56 +set menu_scroll 5.57 +unset mark_old 5.58 +set help 5.59 +set delete = yes 5.60 +set wait_key = no 5.61 +set confirmappend = no 5.62 +set confirmcreate = no 5.63 +folder-hook . set sort=date-sent 5.64 + 5.65 +# reply/forward customization 5.66 +unset edit_hdrs 5.67 +set autoedit 5.68 +set fast_reply 5.69 +set date_format = "!%a, %b %d, %Y" 5.70 +set attribution = "On %d, %n wrote:\n" 5.71 +set indent_str = "> " 5.72 +set include = yes 5.73 +set forw_format = "[FWD] %s" 5.74 +unset mime_fwd 5.75 +unset forw_quote 5.76 +unset metoo 5.77 + 5.78 +# new mail generation 5.79 +set hdrs 5.80 +set use_8bitmime 5.81 + 5.82 +# autoviewing via .mailcap handlers 5.83 +auto_view text/html image/* 5.84 + 5.85 +# no printing by default 5.86 +set print = no 5.87 + 5.88 +# toggle sort mode 5.89 +macro index \cxd set sort=date-sent 5.90 +macro index \cxt set sort=threads 5.91 + 5.92 +# show documentation 5.93 +macro generic <f1> "!`echo ${PAGER-more}` @l_prefix@/share/mutt/manual.txt\n" "Show Mutt Manual" 5.94 +macro index <f1> "!`echo ${PAGER-more}` @l_prefix@/share/mutt/manual.txt\n" "Show Mutt Manual" 5.95 +macro pager <f1> "!`echo ${PAGER-more}` @l_prefix@/share/mutt/manual.txt\n" "Show Mutt Manual" 5.96 +