1
From: Evgeni Golov <sargentd@die-welt.net>
4
When using IMAP, a '.' is often used as a separator instead of '/'.
5
This patch enables mutt to find these dots and
6
1. correctly intend the dir in the sidebar
7
2. if "sidebar_shortpath" is set, shorten the dir to the part after
10
I hope, it's usefull for someone ;)
13
===================================================================
14
--- mutt.orig/sidebar.c 2009-06-25 12:36:53.000000000 +0200
15
+++ mutt/sidebar.c 2009-06-25 12:36:59.000000000 +0200
18
tmp_folder_name = tmp->path + strlen(Maildir);
19
for (i = 0; i < strlen(tmp->path) - strlen(Maildir); i++) {
20
- if (tmp_folder_name[i] == '/') sidebar_folder_depth++;
21
+ if (tmp_folder_name[i] == '/' || tmp_folder_name[i] == '.') sidebar_folder_depth++;
23
if (sidebar_folder_depth > 0) {
24
- sidebar_folder_name = malloc(strlen(basename(tmp->path)) + sidebar_folder_depth + 1);
25
+ if (option(OPTSIDEBARSHORTPATH)) {
26
+ tmp_folder_name = strrchr(tmp->path, '.');
27
+ if (tmp_folder_name == NULL)
28
+ tmp_folder_name = tmp->path;
33
+ tmp_folder_name = tmp->path;
34
+ sidebar_folder_name = malloc(strlen(basename(tmp_folder_name)) + sidebar_folder_depth + 1);
35
for (i=0; i < sidebar_folder_depth; i++)
36
sidebar_folder_name[i]=' ';
37
sidebar_folder_name[i]=0;
38
- strncat(sidebar_folder_name, basename(tmp->path), strlen(basename(tmp->path)) + sidebar_folder_depth);
39
+ strncat(sidebar_folder_name, basename(tmp_folder_name), strlen(basename(tmp_folder_name)) + sidebar_folder_depth);
42
printw( "%.*s", SidebarWidth - delim_len + 1,
44
===================================================================
45
--- mutt.orig/init.h 2009-06-25 12:36:53.000000000 +0200
46
+++ mutt/init.h 2009-06-25 12:36:59.000000000 +0200
47
@@ -1969,6 +1969,11 @@
49
** The width of the sidebar.
51
+ { "sidebar_shortpath", DT_BOOL, R_BOTH, OPTSIDEBARSHORTPATH, 0 },
54
+ ** Should the sidebar shorten the path showed.
56
{ "pgp_use_gpg_agent", DT_BOOL, R_NONE, OPTUSEGPGAGENT, 0},
60
===================================================================
61
--- mutt.orig/mutt.h 2009-06-25 12:36:53.000000000 +0200
62
+++ mutt/mutt.h 2009-06-25 12:36:59.000000000 +0200
67
+ OPTSIDEBARSHORTPATH,