]> git.llucax.com Git - software/mutt-debian.git/commitdiff
adding sidebar-dotted, sidebar-sorted (Closes: 523774), refreshed sidebar
authorAntonio Radici <antonio@dyne.org>
Wed, 17 Jun 2009 19:47:48 +0000 (20:47 +0100)
committerAntonio Radici <antonio@dyne.org>
Wed, 17 Jun 2009 19:47:48 +0000 (20:47 +0100)
debian/changelog
debian/patches/mutt-patched/sidebar
debian/patches/mutt-patched/sidebar-dotted [new file with mode: 0644]
debian/patches/mutt-patched/sidebar-sorted [new file with mode: 0644]
debian/patches/series

index 6cbae153ad1a1bc594728408b3ada27ffcaa2e02..6fe2e2b1cbc63203daf810d177b1d35924c26b91 100644 (file)
@@ -4,12 +4,14 @@ mutt (1.5.20-2) unstable; urgency=low
     + upstream/533209-mutt_perror.patch: better error reporting if a mailbox
       cannot be opened (Closes: 533209)
     + added the right copyright misc/smime_keys-manpage.patch
+    + mutt-patched/sidebar: refreshed
+    + mutt-patched/sidebar-{dotted,sorted} added (Closes: 523774)
   * debian/control:
     + added default-mta to Recommends, removed exim4 (Closes: 533442)
     + added elinks-lite to B-D, removed links (Closes: 533445)
   * debian/mutt.install and debian/extra/lib/mailto-mutt: 
     + added the firefox mailto handler (Closes: 406850)
-
  -- Antonio Radici <antonio@dyne.org>  Tue, 16 Jun 2009 23:20:32 +0100
 
 mutt (1.5.20-1) unstable; urgency=low
index 42ff4e9f1501e721acbdf0aba424664c7ed28051..c719c2c5f9372cb2d2fe24a85fb2069e0723ce1b 100644 (file)
@@ -772,7 +772,7 @@ in the "mutt-patched" package.
        else if (ch == '|')
 --- a/mx.c
 +++ b/mx.c
-@@ -596,6 +596,7 @@
+@@ -595,6 +595,7 @@
   *            M_APPEND        open mailbox for appending
   *            M_READONLY      open mailbox in read-only mode
   *            M_QUIET         only print error messages
@@ -780,7 +780,7 @@ in the "mutt-patched" package.
   *    ctx     if non-null, context struct to use
   */
  CONTEXT *mx_open_mailbox (const char *path, int flags, CONTEXT *pctx)
-@@ -618,6 +619,8 @@
+@@ -617,6 +618,8 @@
      ctx->quiet = 1;
    if (flags & M_READONLY)
      ctx->readonly = 1;
@@ -789,7 +789,7 @@ in the "mutt-patched" package.
  
    if (flags & (M_APPEND|M_NEWFOLDER))
    {
-@@ -722,9 +725,21 @@
+@@ -721,9 +724,21 @@
  void mx_fastclose_mailbox (CONTEXT *ctx)
  {
    int i;
diff --git a/debian/patches/mutt-patched/sidebar-dotted b/debian/patches/mutt-patched/sidebar-dotted
new file mode 100644 (file)
index 0000000..b5e3bc0
--- /dev/null
@@ -0,0 +1,64 @@
+From: Evgeni Golov <sargentd@die-welt.net>
+License: 3-BSD
+
+When using IMAP, a '.' is often used as a separator instead of '/'.
+This patch enables mutt to find these dots and
+1. correctly intend the dir in the sidebar
+2. if "sidebar_shortpath" is set, shorten the dir to the part after
+   the last dot
+
+I hope, it's usefull for someone ;)
+
+--- a/sidebar.c
++++ b/sidebar.c
+@@ -255,14 +255,23 @@
+                       int i;
+                       tmp_folder_name = tmp->path + strlen(Maildir);
+                       for (i = 0; i < strlen(tmp->path) - strlen(Maildir); i++) {
+-                              if (tmp_folder_name[i] == '/') sidebar_folder_depth++;
++                              if (tmp_folder_name[i] == '/'  || tmp_folder_name[i] == '.') sidebar_folder_depth++;
+                       }
+                       if (sidebar_folder_depth > 0) {
+-                              sidebar_folder_name = malloc(strlen(basename(tmp->path)) + sidebar_folder_depth + 1);
++                              if (option(OPTSIDEBARSHORTPATH)) {
++                                      tmp_folder_name = strrchr(tmp->path, '.');
++                                      if (tmp_folder_name == NULL)
++                                              tmp_folder_name = tmp->path;
++                                      else
++                                              tmp_folder_name++;
++                              }
++                              else
++                                      tmp_folder_name = tmp->path;
++                              sidebar_folder_name = malloc(strlen(basename(tmp_folder_name)) + sidebar_folder_depth + 1);
+                               for (i=0; i < sidebar_folder_depth; i++)
+                                       sidebar_folder_name[i]=' ';
+                               sidebar_folder_name[i]=0;
+-                              strncat(sidebar_folder_name, basename(tmp->path), strlen(basename(tmp->path)) + sidebar_folder_depth);
++                              strncat(sidebar_folder_name, basename(tmp_folder_name), strlen(basename(tmp_folder_name)) + sidebar_folder_depth);
+                       }
+               }
+               printw( "%.*s", SidebarWidth - delim_len + 1,
+--- a/init.h
++++ b/init.h
+@@ -1979,6 +1979,11 @@
+   ** .pp
+   ** The width of the sidebar.
+   */
++  { "sidebar_shortpath", DT_BOOL, R_BOTH, OPTSIDEBARSHORTPATH, 0 },
++  /*
++  ** .pp
++  ** Should the sidebar shorten the path showed.
++  */
+   { "pgp_use_gpg_agent", DT_BOOL, R_NONE, OPTUSEGPGAGENT, 0},
+   /*
+   ** .pp
+--- a/mutt.h
++++ b/mutt.h
+@@ -427,6 +427,7 @@
+   OPTSAVENAME,
+   OPTSCORE,
+   OPTSIDEBAR,
++  OPTSIDEBARSHORTPATH,
+   OPTSIGDASHES,
+   OPTSIGONTOP,
+   OPTSORTRE,
diff --git a/debian/patches/mutt-patched/sidebar-sorted b/debian/patches/mutt-patched/sidebar-sorted
new file mode 100644 (file)
index 0000000..dbfa3cf
--- /dev/null
@@ -0,0 +1,75 @@
+From: Evgeni Golov <sargentd@die-welt.net>
+License: 3-BSD
+
+When using IMAP and imap_check_subscribed, the server reports the
+dirs in a random order.
+This patch introduces a new option, sidebar_sort. Which, when it is
+set, sorts the dirs in the sidebar alphabetically.
+
+I hope, it's usefull for someone ;)
+
+PS: This has to be applied ontop of my sidebar-dotted patch, but it
+should be easy to adopt it to a vanilla mutt.
+
+--- a/sidebar.c
++++ b/sidebar.c
+@@ -54,6 +54,35 @@
+       for ( ; tmp->next != 0; tmp = tmp->next )
+               tmp->next->prev = tmp;
++      if (option(OPTSIDEBARSORT)) {
++              int needsort=1;
++              BUFFY *prev;
++              BUFFY *next;
++              BUFFY *tmp2;
++              while (needsort==1) {
++                      needsort=0;
++                      tmp = Incoming;
++                      for ( ; tmp ; tmp=tmp->next ) {
++                              if (tmp->next != NULL && strcmp(tmp->path, tmp->next->path) > 0) {
++                                      needsort=1;
++                                      prev = tmp->prev;
++                                      next = tmp->next;
++                                      if (prev != NULL)
++                                              prev->next = next;
++                                      else
++                                              Incoming = next;
++                                      next->prev = prev;
++                                      tmp2 = next->next;
++                                      next->next = tmp;
++                                      tmp->prev = next;
++                                      tmp->next = tmp2;
++                                      if (tmp2 != NULL)
++                                              tmp2->prev = tmp;
++                              }
++                      }
++              }
++      }
++
+       if ( TopBuffy == 0 && BottomBuffy == 0 )
+               TopBuffy = Incoming;
+       if ( BottomBuffy == 0 ) {
+--- a/init.h
++++ b/init.h
+@@ -1984,6 +1984,11 @@
+   ** .pp
+   ** Should the sidebar shorten the path showed.
+   */
++  { "sidebar_sort", DT_BOOL, R_BOTH, OPTSIDEBARSORT, 0 },
++  /*
++  ** .pp
++  ** Should the sidebar be sorted.
++  */
+   { "pgp_use_gpg_agent", DT_BOOL, R_NONE, OPTUSEGPGAGENT, 0},
+   /*
+   ** .pp
+--- a/mutt.h
++++ b/mutt.h
+@@ -428,6 +428,7 @@
+   OPTSCORE,
+   OPTSIDEBAR,
+   OPTSIDEBARSHORTPATH,
++  OPTSIDEBARSORT,
+   OPTSIGDASHES,
+   OPTSIGONTOP,
+   OPTSORTRE,
index e4998306b9af398a5483b04fd50c7a019f4e5372..c0d3ad96462e95b578ac059f2b1ccb0d5cd75a46 100644 (file)
@@ -51,9 +51,11 @@ mutt.org
 mutt-patched/sidebar-compat-revert.debian
 mutt-patched/sidebar
 mutt-patched/sidebar-compat-apply.debian
+mutt-patched/sidebar-dotted
+mutt-patched/sidebar-sorted
 
 # not applying cleanly at the moment
-mutt-patched/nntp
+#mutt-patched/nntp
 
 # unapplied patches for custom packages
 # not-applied/chdir