Accepting request 127359 from server:mail

This updates to a newer version of the mutt sidebar which allows sorting of the mailboxes. (forwarded request 125653 from gladiac)

OBS-URL: https://build.opensuse.org/request/show/127359
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mutt?expand=0&rev=48
This commit is contained in:
Stephan Kulow 2012-07-09 07:51:54 +00:00 committed by Git OBS Bridge
commit 1dd3bfe158
7 changed files with 1560 additions and 370 deletions

View File

@ -1,19 +1,19 @@
ask when sending list message replies to author only - Armin Wolfermann (aw)
diff --git a/PATCHES b/PATCHES
index cb66d17..e5bc9de 100644
--- a/PATCHES
+++ b/PATCHES
Index: mutt-1.5.21/PATCHES
===================================================================
--- mutt-1.5.21.orig/PATCHES 2012-06-21 11:48:06.757181997 +0200
+++ mutt-1.5.21/PATCHES 2012-06-21 11:48:50.352837436 +0200
@@ -1,3 +1,4 @@
+patch-1.5.9.aw.listreply.1
nion.sidebar-color
patch-1.5.19.sidebar.20090522.txt
patch-1.5.20.sidebar.20090619.txt
patch-1.5.19.rr.compressed.1
diff --git a/init.h b/init.h
index 82f3c7d..210d259 100644
--- a/init.h
+++ b/init.h
@@ -1329,6 +1329,13 @@ struct option_t MuttVars[] = {
patch-1.5.5.1.nt.xtitles.3.ab.1
Index: mutt-1.5.21/init.h
===================================================================
--- mutt-1.5.21.orig/init.h 2012-06-21 11:48:06.754181952 +0200
+++ mutt-1.5.21/init.h 2012-06-21 11:48:22.426417566 +0200
@@ -1331,6 +1331,13 @@ struct option_t MuttVars[] = {
** The locale used by \fCstrftime(3)\fP to format dates. Legal values are
** the strings your system accepts for the locale environment variable \fC$$$LC_TIME\fP.
*/
@ -27,10 +27,10 @@ index 82f3c7d..210d259 100644
{ "mail_check", DT_NUM, R_NONE, UL &BuffyTimeout, 5 },
/*
** .pp
diff --git a/mutt.h b/mutt.h
index fd42004..ef78e11 100644
--- a/mutt.h
+++ b/mutt.h
Index: mutt-1.5.21/mutt.h
===================================================================
--- mutt-1.5.21.orig/mutt.h 2012-06-21 11:48:06.788182463 +0200
+++ mutt-1.5.21/mutt.h 2012-06-21 11:48:22.426417566 +0200
@@ -290,6 +290,7 @@ enum
#endif
OPT_SUBJECT,
@ -39,11 +39,11 @@ index fd42004..ef78e11 100644
/* THIS MUST BE THE LAST VALUE. */
OPT_MAX
diff --git a/send.c b/send.c
index 047b2b4..d46327a 100644
--- a/send.c
+++ b/send.c
@@ -453,6 +453,7 @@ static int include_reply (CONTEXT *ctx, HEADER *cur, FILE *out)
Index: mutt-1.5.21/send.c
===================================================================
--- mutt-1.5.21.orig/send.c 2012-06-21 11:48:06.724181501 +0200
+++ mutt-1.5.21/send.c 2012-06-21 11:48:22.426417566 +0200
@@ -453,6 +453,7 @@ static int include_reply (CONTEXT *ctx,
static int default_to (ADDRESS **to, ENVELOPE *env, int flags, int hmfupto)
{
char prompt[STRING];
@ -51,7 +51,7 @@ index 047b2b4..d46327a 100644
if (flags && env->mail_followup_to && hmfupto == M_YES)
{
@@ -466,6 +467,23 @@ static int default_to (ADDRESS **to, ENVELOPE *env, int flags, int hmfupto)
@@ -466,6 +467,23 @@ static int default_to (ADDRESS **to, ENV
if (flags & SENDLISTREPLY)
return 0;

View File

@ -1,247 +0,0 @@
--- Makefile.am
+++ Makefile.am 2010-11-04 13:51:48.000000000 +0000
@@ -71,6 +71,7 @@ EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP O
rfc2231.h rfc822.h rfc3676.h sha1.h sort.h mime.types VERSION prepare \
_regex.h OPS.MIX README.SECURITY remailer.c remailer.h browser.h \
mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h \
+ sidebar.h \
README.SSL smime.h group.h \
muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \
ChangeLog mkchangelog.sh mutt_idna.h \
--- Makefile.in
+++ Makefile.in 2010-11-04 13:54:41.000000000 +0000
@@ -84,7 +84,7 @@ am_mutt_OBJECTS = addrbook.$(OBJEXT) ali
score.$(OBJEXT) send.$(OBJEXT) sendlib.$(OBJEXT) \
signal.$(OBJEXT) sort.$(OBJEXT) status.$(OBJEXT) \
system.$(OBJEXT) thread.$(OBJEXT) charset.$(OBJEXT) \
- history.$(OBJEXT) lib.$(OBJEXT) muttlib.$(OBJEXT) \
+ history.$(OBJEXT) lib.$(OBJEXT) sidebar.$(OBJEXT) muttlib.$(OBJEXT) \
editmsg.$(OBJEXT) mbyte.$(OBJEXT) url.$(OBJEXT) \
ascii.$(OBJEXT) crypt-mod.$(OBJEXT) safe_asprintf.$(OBJEXT)
am__objects_1 =
@@ -359,6 +359,7 @@ mutt_SOURCES = \
rfc822.c rfc1524.c rfc2047.c rfc2231.c rfc3676.c \
score.c send.c sendlib.c signal.c sort.c \
status.c system.c thread.c charset.c history.c lib.c \
+ sidebar.c \
muttlib.c editmsg.c mbyte.c \
url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c
@@ -389,6 +390,7 @@ EXTRA_DIST = COPYRIGHT GPL OPS OPS.PGP O
rfc2231.h rfc822.h rfc3676.h sha1.h sort.h mime.types VERSION prepare \
_regex.h OPS.MIX README.SECURITY remailer.c remailer.h browser.h \
mbyte.h lib.h extlib.c pgpewrap.c smime_keys.pl pgplib.h \
+ sidebar.h \
README.SSL smime.h group.h \
muttbug pgppacket.h depcomp ascii.h BEWARE PATCHES patchlist.sh \
ChangeLog mkchangelog.sh mutt_idna.h \
--- buffy.c
+++ buffy.c 2010-11-04 13:57:02.000000000 +0000
@@ -520,19 +520,22 @@ int mutt_buffy_check (int force)
{
case M_MBOX:
case M_MMDF:
- buffy_mbox_update (tmp);
+ if (option(OPTSIDEBAR))
+ buffy_mbox_update (tmp);
if (buffy_mbox_hasnew (tmp, &sb) > 0)
BuffyCount++;
break;
case M_MAILDIR:
- buffy_maildir_update (tmp);
+ if (option(OPTSIDEBAR))
+ buffy_maildir_update (tmp);
if (buffy_maildir_hasnew (tmp) > 0)
BuffyCount++;
break;
case M_MH:
- mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged);
+ if (option(OPTSIDEBAR))
+ mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged);
if ((tmp->new = mh_buffy (tmp->path)) > 0)
BuffyCount++;
break;
--- sidebar.c
+++ sidebar.c 2011-06-20 12:30:59.803926815 +0000
@@ -28,6 +28,7 @@
#include "sidebar.h"
#include "buffy.h"
#include <libgen.h>
+#include <limits.h>
#include "keymap.h"
#include <stdbool.h>
@@ -80,36 +81,45 @@ void calc_boundaries (int menu)
}
}
+static char sidebar_buffer[LINE_MAX];
char *make_sidebar_entry(char *box, int size, int new, int flagged)
{
- static char *entry = 0;
- char *c;
- int i = 0;
- int delim_len = strlen(SidebarDelim);
+ char *entry;
+ size_t i = 0;
+ size_t delim_len = strlen(NONULL(SidebarDelim));
+ size_t width = sizeof(sidebar_buffer) - 1;
+
+ entry = &sidebar_buffer[0];
+ if (SidebarWidth - delim_len + 1 > width || strlen(box) + 1 > width)
+ return NONULL(SidebarDelim);
- c = realloc(entry, SidebarWidth - delim_len + 2);
- if ( c ) entry = c;
entry[SidebarWidth - delim_len + 1] = 0;
for (; i < SidebarWidth - delim_len + 1; entry[i++] = ' ' );
i = strlen(box);
strncpy( entry, box, i < (SidebarWidth - delim_len + 1) ? i : (SidebarWidth - delim_len + 1) );
if (size == -1)
- sprintf(entry + SidebarWidth - delim_len - 3, "?");
+ snprintf(entry + SidebarWidth - delim_len - 3, width, "?");
else if ( new ) {
if (flagged > 0) {
- sprintf(
+ snprintf(
entry + SidebarWidth - delim_len - 5 - quick_log10(size) - quick_log10(new) - quick_log10(flagged),
+ width,
"% d(%d)[%d]", size, new, flagged);
} else {
- sprintf(
+ snprintf(
entry + SidebarWidth - delim_len - 3 - quick_log10(size) - quick_log10(new),
+ width,
"% d(%d)", size, new);
}
} else if (flagged > 0) {
- sprintf( entry + SidebarWidth - delim_len - 3 - quick_log10(size) - quick_log10(flagged), "% d[%d]", size, flagged);
+ snprintf(entry + SidebarWidth - delim_len - 3 - quick_log10(size) - quick_log10(flagged),
+ width,
+ "% d[%d]", size, flagged);
} else {
- sprintf( entry + SidebarWidth - delim_len - 1 - quick_log10(size), "% d", size);
+ snprintf(entry + SidebarWidth - delim_len - 1 - quick_log10(size),
+ width,
+ "% d", size);
}
return entry;
}
@@ -136,6 +146,7 @@ void set_curbuffy(char buf[LONG_STRING])
int draw_sidebar(int menu) {
+ char folder_buffer[LINE_MAX];
int lines = option(OPTHELP) ? 1 : 0;
lines += option(OPTSTATUSONTOP) ? 1 : 0;
@@ -143,10 +154,11 @@ int draw_sidebar(int menu) {
#ifndef USE_SLANG_CURSES
attr_t attrs;
#endif
- short delim_len = strlen(SidebarDelim);
+ short delim_len = strlen(NONULL(SidebarDelim));
short color_pair;
+ char *maildir = NONULL(Maildir);
- static bool initialized = false;
+ static bool initialized /* = false*/;
static int prev_show_value;
static short saveSidebarWidth;
@@ -170,7 +182,7 @@ int draw_sidebar(int menu) {
}
-// if ( SidebarWidth == 0 ) return 0;
+/* if ( SidebarWidth == 0 ) return 0; */
if (SidebarWidth > 0 && option (OPTSIDEBAR)
&& delim_len >= SidebarWidth) {
unset_option (OPTSIDEBAR);
@@ -229,6 +241,32 @@ int draw_sidebar(int menu) {
SETCOLOR(MT_COLOR_NORMAL);
for ( ; tmp && lines < LINES-1 - (menu != MENU_PAGER || option(OPTSTATUSONTOP)); tmp = tmp->next ) {
+ short maildir_is_prefix = 0;
+ int sidebar_folder_depth;
+ char *sidebar_folder_name;
+ char *safe_path;
+ char *base_name;
+
+ if ( !tmp->path || *tmp->path == '\0' ) {
+ move( lines, 0 );
+ lines++;
+ continue;
+ }
+
+ safe_path = strdupa(tmp->path);
+ if ( !safe_path ) {
+ move( lines, 0 );
+ lines++;
+ continue;
+ }
+
+ base_name = basename(safe_path);
+ if ( !base_name ) {
+ move( lines, 0 );
+ lines++;
+ continue;
+ }
+
if ( tmp == CurBuffy )
SETCOLOR(MT_COLOR_INDICATOR);
else if ( tmp->msg_unread > 0 )
@@ -244,35 +282,36 @@ int draw_sidebar(int menu) {
tmp->msgcount = Context->msgcount;
tmp->msg_flagged = Context->flagged;
}
- // check whether Maildir is a prefix of the current folder's path
- short maildir_is_prefix = 0;
- if ( (strlen(tmp->path) > strlen(Maildir)) &&
- (strncmp(Maildir, tmp->path, strlen(Maildir)) == 0) )
+ /* check whether Maildir is a prefix of the current folder's path */
+ if ( (strlen(tmp->path) > strlen(maildir)) &&
+ (strncmp(maildir, tmp->path, strlen(maildir)) == 0) )
maildir_is_prefix = 1;
- // calculate depth of current folder and generate its display name with indented spaces
- int sidebar_folder_depth = 0;
- char *sidebar_folder_name;
- sidebar_folder_name = basename(tmp->path);
+ /* calculate depth of current folder and generate its display name with indented spaces */
+ sidebar_folder_name = base_name;
+ sidebar_folder_depth = 0;
if ( maildir_is_prefix ) {
char *tmp_folder_name;
int i;
- tmp_folder_name = tmp->path + strlen(Maildir);
- for (i = 0; i < strlen(tmp->path) - strlen(Maildir); 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 (sidebar_folder_depth > 0) {
- sidebar_folder_name = malloc(strlen(basename(tmp->path)) + sidebar_folder_depth + 1);
+ if (sidebar_folder_depth + strlen(base_name) + 1 > sizeof(folder_buffer)) {
+ move( lines, 0 );
+ lines++;
+ continue;
+ }
+ sidebar_folder_name = &folder_buffer[0];
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, base_name, strlen(base_name) + sidebar_folder_depth);
}
}
printw( "%.*s", SidebarWidth - delim_len + 1,
make_sidebar_entry(sidebar_folder_name, tmp->msgcount,
tmp->msg_unread, tmp->msg_flagged));
- if (sidebar_folder_depth > 0)
- free(sidebar_folder_name);
lines++;
}
SETCOLOR(MT_COLOR_NORMAL);

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Jun 21 10:04:20 UTC 2012 - asn@cryptomilk.org
- Update sidebar patch.
-------------------------------------------------------------------
Tue May 29 14:10:05 UTC 2012 - puzel@suse.com

View File

@ -83,17 +83,15 @@ Patch3: %name-1.5.20-sendgroupreplyto.diff
Patch4: %name-1.5.15-wrapcolumn.diff
Patch5: patch-1.5.5.1.nt.xtitles.3.ab.1
# http://lunar-linux.org/index.php?page=mutt-sidebar
Patch6: patch-1.5.21.sidebar-aa6aa.txt.bz2
Patch7: mutt-1.5.21.sidebar-fix.dif
Patch8: mutt-1.5.21-opennfs.dif
Patch9: mutt-1.5.20-gpgme_set_locale.patch
Patch10: bug-676388-largefile.patch
Patch11: nion.sidebar-color.diff
Patch12: mutt-1.5.21-tinfo.dif
Patch6: mutt-1.5.21.sidebar.20090619.patch
Patch7: mutt-1.5.21-opennfs.dif
Patch8: mutt-1.5.20-gpgme_set_locale.patch
Patch9: bug-676388-largefile.patch
Patch10: mutt-1.5.21-tinfo.dif
# http://www.wolfermann.org/mutt.html
Patch13: aw.listreply.diff
Patch14: patch-1.5.21.vk.pgp_verbose_mime
Patch15: automake-1.12.patch
Patch11: aw.listreply.diff
Patch12: patch-1.5.21.vk.pgp_verbose_mime
Patch13: automake-1.12.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%global _sysconfdir %{_sysconfdir}
@ -110,21 +108,19 @@ for p in ../%name-%version-patches/*; do
patch -s -p1 < $p
done
%patch
%patch1 -p1
%patch2 -p0
%patch3 -p1
%patch4 -p0
%patch5 -p1
%patch6 -p1
%patch7 -p0 -b .sidebar
%patch8 -p0
%patch9 -p1
%patch10 -p1
%patch11 -p1 -b .sidebar.color
%patch12 -p0 -b .tinfo
%patch13 -p1 -b .listreply
%patch14 -p1
%patch15 -p1
%patch1 -p1 -b .compressed
%patch2 -p0 -b .pgpewrap
%patch3 -p1 -b .sendgroupreplyto
%patch4 -p0 -b .wrapcolumn
%patch5 -p1 -b .xtitles
%patch6 -p1 -b .sidebar
%patch7 -p0 -b .opennfs
%patch8 -p1 -b .gpgme
%patch9 -p1 -b .largefile
%patch10 -p0 -b .tinfo
%patch11 -p1 -b .listreply
%patch12 -p1 -b .pgp_verbose_mtime
%patch13 -p1 -b .automake-1.12
cp doc/Muttrc Muttrc.SuSE
cp %{S:2} .

View File

@ -1,74 +0,0 @@
diff -r 97d8bf4c46f9 PATCHES
--- a/PATCHES Mon Jun 29 17:52:30 2009 +0200
+++ b/PATCHES Mon Jun 29 17:54:21 2009 +0200
@@ -1,3 +1,4 @@
+nion.sidebar-color
patch-1.5.19.sidebar.20090522.txt
patch-1.5.19.rr.compressed.1
patch-1.5.5.1.nt.xtitles.3.ab.1
diff -r 97d8bf4c46f9 color.c
--- a/color.c Mon Jun 29 17:52:30 2009 +0200
+++ b/color.c Mon Jun 29 17:54:21 2009 +0200
@@ -95,6 +95,7 @@
{ "index", MT_COLOR_INDEX },
{ "sidebar_new", MT_COLOR_NEW },
{ "sidebar_flagged", MT_COLOR_FLAGGED },
+ { "sidebar", MT_COLOR_SIDEBAR },
{ NULL, 0 }
};
@@ -144,6 +145,7 @@
/* set some defaults */
ColorDefs[MT_COLOR_STATUS] = A_REVERSE;
+ ColorDefs[MT_COLOR_SIDEBAR] = A_REVERSE;
ColorDefs[MT_COLOR_INDICATOR] = A_REVERSE;
ColorDefs[MT_COLOR_SEARCH] = A_REVERSE;
ColorDefs[MT_COLOR_MARKERS] = A_REVERSE;
diff -r 97d8bf4c46f9 mutt_curses.h
--- a/mutt_curses.h Mon Jun 29 17:52:30 2009 +0200
+++ b/mutt_curses.h Mon Jun 29 17:54:21 2009 +0200
@@ -125,6 +125,7 @@
MT_COLOR_ATTACHMENT,
MT_COLOR_SEARCH,
MT_COLOR_BOLD,
+ MT_COLOR_SIDEBAR,
MT_COLOR_UNDERLINE,
MT_COLOR_INDEX,
MT_COLOR_NEW,
diff -r 97d8bf4c46f9 sidebar.c
--- a/sidebar.c Mon Jun 29 17:52:30 2009 +0200
+++ b/sidebar.c Mon Jun 29 17:54:21 2009 +0200
@@ -196,22 +196,26 @@
}
/* get attributes for divider */
- SETCOLOR(MT_COLOR_STATUS);
+ SETCOLOR(MT_COLOR_SIDEBAR);
#ifndef USE_SLANG_CURSES
attr_get(&attrs, &color_pair, 0);
#else
color_pair = attr_get();
#endif
- SETCOLOR(MT_COLOR_NORMAL);
+ /* SETCOLOR(MT_COLOR_SIDEBAR); */
/* draw the divider */
for ( ; lines < LINES-1-(menu != MENU_PAGER || option(OPTSTATUSONTOP)); lines++ ) {
move(lines, SidebarWidth - delim_len);
- addstr(NONULL(SidebarDelim));
-#ifndef USE_SLANG_CURSES
- mvchgat(lines, SidebarWidth - delim_len, delim_len, 0, color_pair, NULL);
-#endif
+ if (option (OPTASCIICHARS))
+ addstr (NONULL (SidebarDelim));
+ else if (!option (OPTASCIICHARS) && !strcmp (NONULL(SidebarDelim), "|"))
+ addch (ACS_VLINE);
+ else if ((Charset_is_utf8) && !strcmp (NONULL(SidebarDelim), "|"))
+ addstr ("\342\224\202");
+ else
+ addstr (NONULL (SidebarDelim));
}
if ( Incoming == 0 ) return 0;

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9c83a8003f9ff16b7987a3031c812d041ae55815f46b6657a75d8412a095b0fb
size 11287