aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mail-client/mutt/files/sidebar-dotted.patch')
-rw-r--r--mail-client/mutt/files/sidebar-dotted.patch70
1 files changed, 70 insertions, 0 deletions
diff --git a/mail-client/mutt/files/sidebar-dotted.patch b/mail-client/mutt/files/sidebar-dotted.patch
new file mode 100644
index 0000000..95150b2
--- /dev/null
+++ b/mail-client/mutt/files/sidebar-dotted.patch
@@ -0,0 +1,70 @@
+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 ;)
+
+Index: mutt-1.5.18/sidebar.c
+===================================================================
+--- mutt-1.5.18.orig/sidebar.c 2008-11-06 18:36:26.000000000 +0100
++++ mutt-1.5.18/sidebar.c 2008-11-06 18:37:18.000000000 +0100
+@@ -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,
+Index: mutt-1.5.18/init.h
+===================================================================
+--- mutt-1.5.18.orig/init.h 2008-11-06 18:37:26.000000000 +0100
++++ mutt-1.5.18/init.h 2008-11-06 18:37:47.000000000 +0100
+@@ -1548,6 +1548,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
+Index: mutt-1.5.18/mutt.h
+===================================================================
+--- mutt-1.5.18.orig/mutt.h 2008-11-06 18:37:55.000000000 +0100
++++ mutt-1.5.18/mutt.h 2008-11-06 18:38:10.000000000 +0100
+@@ -438,6 +438,7 @@
+ OPTSAVENAME,
+ OPTSCORE,
+ OPTSIDEBAR,
++ OPTSIDEBARSHORTPATH,
+ OPTSIGDASHES,
+ OPTSIGONTOP,
+ OPTSORTRE,