]> git.llucax.com Git - software/mutt-debian.git/commitdiff
mutt-patched/sidebar-newonly: integrating Steve Kemp's patch to optionally select... debian/1.5.20-3
authorAntonio Radici <antonio@dyne.org>
Sun, 13 Sep 2009 19:14:48 +0000 (20:14 +0100)
committerAntonio Radici <antonio@dyne.org>
Sun, 13 Sep 2009 19:43:14 +0000 (20:43 +0100)
debian/changelog
debian/patches/mutt-patched/sidebar-newonly [new file with mode: 0644]
debian/patches/series

index 0d19fc6b9f4c4b6303fbaa81f73f53265b9d41c7..6079b02640b0434ad6c7dbdb7fcbcb4ca41b26f4 100644 (file)
@@ -32,6 +32,8 @@ mutt (1.5.20-3) unstable; urgency=low
       if it contains '=' (Closes: 542817)
     + upstream/544794-smtp-batch.patch: mutt won't ask for a password if
       smtp_user and smtp_pass are set in .muttrc (Closes: 544794)
+    + mutt-patched/sidebar-newonly: integrating Steve Kemp's patch to optionally
+      select folders with new mails only (Closes: 532510)
   * debian/control:
     + Standards-Version bumped to 3.8.3
   * debian/extra/lib/mailto-mutt: patch from madduck@ to correctly handle the
diff --git a/debian/patches/mutt-patched/sidebar-newonly b/debian/patches/mutt-patched/sidebar-newonly
new file mode 100644 (file)
index 0000000..b9c199a
--- /dev/null
@@ -0,0 +1,161 @@
+patches written by Steve Kemp, it adds two new functionalities to the sidebar,
+so only the mailbox with new messages will be shown (and/or) selected
+See Debian bug http://bugs.debian.org/532510
+
+--- a/OPS
++++ b/OPS
+@@ -184,3 +184,5 @@
+ OP_SIDEBAR_NEXT "go down to next mailbox"
+ OP_SIDEBAR_PREV "go to previous mailbox"
+ OP_SIDEBAR_OPEN "open hilighted mailbox"
++OP_SIDEBAR_NEXT_NEW "go down to next mailbox with new mail"
++OP_SIDEBAR_PREV_NEW "go to previous mailbox with new mail"
+--- a/curs_main.c
++++ b/curs_main.c
+@@ -2236,6 +2236,8 @@
+       case OP_SIDEBAR_SCROLL_DOWN:
+       case OP_SIDEBAR_NEXT:
+       case OP_SIDEBAR_PREV:
++      case OP_SIDEBAR_NEXT_NEW:
++      case OP_SIDEBAR_PREV_NEW:
+         scroll_sidebar(op, menu->menu);
+         break;
+       default:
+--- a/functions.h
++++ b/functions.h
+@@ -173,6 +173,10 @@
+  { "sidebar-scroll-down",     OP_SIDEBAR_SCROLL_DOWN, NULL },
+  { "sidebar-next",            OP_SIDEBAR_NEXT, NULL },
+  { "sidebar-prev",            OP_SIDEBAR_PREV, NULL },
++ { "sidebar-next-new", OP_SIDEBAR_NEXT_NEW, NULL},
++ { "sidebar-prev-new", OP_SIDEBAR_PREV_NEW, NULL},
++ { "sidebar-next-new", OP_SIDEBAR_NEXT_NEW, NULL},
++ { "sidebar-prev-new", OP_SIDEBAR_PREV_NEW, NULL},
+  { "sidebar-open",            OP_SIDEBAR_OPEN, NULL },
+   { NULL,                     0,                              NULL }
+ };
+--- a/init.h
++++ b/init.h
+@@ -1956,6 +1956,11 @@
+   {"sidebar_delim", DT_STR, R_BOTH, UL &SidebarDelim, "|"},
+   /*
+   ** .pp
++  ** Show only new mail in the sidebar.
++  */
++  {"sidebar_newmail_only", DT_BOOL, R_BOTH, OPTSIDEBARNEWMAILONLY, "no" },
++  /*
++  ** .pp
+   ** This specifies the delimiter between the sidebar (if visible) and
+   ** other screens.
+   */
+--- a/mutt.h
++++ b/mutt.h
+@@ -518,6 +518,8 @@
+   OPTDONTHANDLEPGPKEYS,       /* (pseudo) used to extract PGP keys */
+   OPTUNBUFFEREDINPUT,   /* (pseudo) don't use key buffer */
++  OPTSIDEBARNEWMAILONLY,
++
+   OPTMAX
+ };
+--- a/pager.c
++++ b/pager.c
+@@ -2756,6 +2756,8 @@
+       case OP_SIDEBAR_SCROLL_DOWN:
+       case OP_SIDEBAR_NEXT:
+       case OP_SIDEBAR_PREV:
++      case OP_SIDEBAR_NEXT_NEW:
++      case OP_SIDEBAR_PREV_NEW:
+       scroll_sidebar(ch, MENU_PAGER);
+       break;
+--- a/sidebar.c
++++ b/sidebar.c
+@@ -261,8 +261,20 @@
+                       SETCOLOR(MT_COLOR_NEW);
+               else if ( tmp->msg_flagged > 0 )
+                       SETCOLOR(MT_COLOR_FLAGGED);
+-              else
+-                      SETCOLOR(MT_COLOR_NORMAL);
++              else {
++                  /* make sure the path is either:
++                     1.  Containing new mail.
++                     2.  The inbox.
++                     3.  The current box.
++                   */
++                  if ((option (OPTSIDEBARNEWMAILONLY)) &&
++                      ( (tmp->msg_unread <= 0)  &&
++                        ( tmp != Incoming ) &&
++                        ( strcmp( tmp->path, Context->path ) != 0 ) ) )
++                    continue;
++                  else
++                    SETCOLOR(MT_COLOR_NORMAL);
++                }
+               move( lines, 0 );
+               if ( Context && !strcmp( tmp->path, Context->path ) ) {
+@@ -320,6 +332,29 @@
+       return 0;
+ }
++BUFFY * exist_next_new()
++{
++       BUFFY *tmp = CurBuffy;
++       if(tmp == NULL) return NULL;
++       while (tmp->next != NULL)
++       {
++              tmp = tmp->next;
++               if(tmp->msg_unread) return tmp;
++       }
++       return NULL;
++}
++
++BUFFY * exist_prev_new()
++{
++       BUFFY *tmp = CurBuffy;
++       if(tmp == NULL) return NULL;
++       while (tmp->prev != NULL)
++       {
++               tmp = tmp->prev;
++               if(tmp->msg_unread) return tmp;
++       }
++       return NULL;
++}
+ void set_buffystats(CONTEXT* Context)
+ {
+@@ -336,18 +371,33 @@
+ void scroll_sidebar(int op, int menu)
+ {
++        BUFFY *tmp;
+         if(!SidebarWidth) return;
+         if(!CurBuffy) return;
+       switch (op) {
+               case OP_SIDEBAR_NEXT:
++                if (!option (OPTSIDEBARNEWMAILONLY)) {
+                       if ( CurBuffy->next == NULL ) return;
+                       CurBuffy = CurBuffy->next;
+                       break;
++                }
++                case OP_SIDEBAR_NEXT_NEW:
++                        if ( (tmp = exist_next_new()) == NULL)
++                                return;
++                        else CurBuffy = tmp;
++                        break;
+               case OP_SIDEBAR_PREV:
++                 if (!option (OPTSIDEBARNEWMAILONLY)) {
+                       if ( CurBuffy->prev == NULL ) return;
+                       CurBuffy = CurBuffy->prev;
+                       break;
++                }
++                case OP_SIDEBAR_PREV_NEW:
++                       if ( (tmp = exist_prev_new()) == NULL)
++                               return;
++                       else CurBuffy = tmp;
++                       break;
+               case OP_SIDEBAR_SCROLL_UP:
+                       CurBuffy = TopBuffy;
+                       if ( CurBuffy != Incoming ) {
index 55397bc7c5aacf8c08aa03a08c4a106ac1dd5b46..16be46baeaebdeb119b0a0084a10f999485ded2d 100644 (file)
@@ -46,6 +46,7 @@ upstream/393926-internal-viewer.patch
 upstream/543467-thread-segfault.patch
 upstream/544180-italian-yesorno.patch
 upstream/542817-smimekeys-tmpdir.patch
+upstream/544794-smtp-batch.patch
 misc/hyphen-as-minus.patch
 #misc/manpage-typos.patch
 misc/smime_keys-manpage.patch
@@ -63,3 +64,4 @@ mutt-patched/sidebar-sorted
 # not-applied/chdir
 # not-applied/indexcolor
 # not-applied/w3mface
+mutt-patched/sidebar-newonly