A bunch of fixes from debian
by David Sterba
Hi,
I've set up my mutt-kz git tree, please find a few fixes taken from
debian's mutt-patched package, all of them from category 'upstream',
git://repo.or.cz/mutt-kz-devel.git debian-bugfixes
Shortlog:
debian/upstream/228671-pipe-mime.patch
debian/upstream/383769-score-match.patch
debian/upstream/528233-readonly-open.patch
debian/upstream/531430-imapuser.patch
debian/upstream/537061-dont-recode-saved-attachments.patch
debian/upstream/537694-segv-imap-headers.patch
debian/upstream/537818-emptycharset.patch
debian/upstream/542817-smimekeys-tmpdir.patch
debian/upstream/543467-thread-segfault.patch
debian/upstream/547980-smime_keys-chaining.patch
debian/upstream/548577-gpgme-1.2.patch
debian/upstream/553321-ansi-escape-segfault.patch
debian/upstream/568295-references.patch
debian/upstream/603288-split-fetches.patch
debian/upstream/608706-fix-spelling-errors.patch
debian/upstream/611410-no-implicit_autoview-for-text-html.patch
debian/upstream/619216-gnutls-CN-validation.patch
debian/upstream/624058-gnutls-deprecated-set-priority.patch
For completeness, these are already applied in current master:
578087-header-strchr.patch
584138-mx_update_context-segfault.patch
611412-bts-regexp.patch
620854-pop3-segfault.patch
624085-gnutls-deprecated-verify-peers.patch
Next I'm preparing more sidebar fixes.
david
11 years, 4 months
[PATCH 1/2] Test for the latest notmuch API change
by David Riebenbauer
In notmuch 0.13 the library's API has changed, so we explicitly test
for that with autoconf.
---
configure.ac | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/configure.ac b/configure.ac
index b6464da..3142ad5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -177,6 +177,18 @@ AC_ARG_ENABLE(notmuch, AC_HELP_STRING([--enable-notmuch], [Enable NOTMUCH suppor
NOTMUCH_LIBS="-lnotmuch"
OPS="$OPS \$(srcdir)/OPS.NOTMUCH"
need_notmuch="yes"
+
+ AC_MSG_CHECKING([for notmuch api version 3])
+ AC_COMPILE_IFELSE( [AC_LANG_PROGRAM(
+ [[#include <notmuch.h>]],
+ [[notmuch_database_open("/path", NOTMUCH_DATABASE_MODE_READ_ONLY, (notmuch_database_t**)NULL);]]
+ )],
+ [notmuch_api_3=yes
+ AC_DEFINE([NOTMUCH_API_3], 1, [Define to 1 if you have the notmuch api version 3.])
+ ],
+ [notmuch_api_3=no]
+ )
+ AC_MSG_RESULT([$notmuch_api_3])
fi
])
AM_CONDITIONAL(BUILD_NOTMUCH, test x$need_notmuch = xyes)
--
1.7.10
11 years, 5 months
[PATCH] fix recent notmuch api change
by Chris Mason
Hi everyone,
I'm not sure how to test for notmuch api versions, but this makes things
work with the latest notmuch.
Of course, it'll also break things for older notmuch...
diff --git a/mutt_notmuch.c b/mutt_notmuch.c
index 3a05a62..6a27a35 100644
--- a/mutt_notmuch.c
+++ b/mutt_notmuch.c
@@ -347,13 +347,14 @@ static notmuch_database_t *do_database_open(const char *filename,
{
notmuch_database_t *db = NULL;
unsigned int ct = 0;
+ int status = 0;
dprint(1, (debugfile, "nm: db open '%s' %s (timeout %d)\n", filename,
writable ? "[WRITE]" : "[READ]", NotmuchOpenTimeout));
do {
- db = notmuch_database_open(filename,
+ status = notmuch_database_open(filename,
writable ? NOTMUCH_DATABASE_MODE_READ_WRITE :
- NOTMUCH_DATABASE_MODE_READ_ONLY);
+ NOTMUCH_DATABASE_MODE_READ_ONLY, &db);
if (db || !NotmuchOpenTimeout || ct / 2 > NotmuchOpenTimeout)
break;
@@ -364,11 +365,13 @@ static notmuch_database_t *do_database_open(const char *filename,
} while (1);
if (verbose) {
- if (!db)
+ if (status)
mutt_error (_("Cannot open notmuch database: %s"), filename);
else if (ct > 1)
mutt_clear_error();
}
+ if (status)
+ return NULL;
return db;
}
11 years, 5 months
[PATCH] sidebar: add optional refresh interval
by David Sterba
New option sidebar_refresh: do not refresh sidebar in less
than $sidebar_refresh seconds (0 disables refreshing).
This helps when there are 'mbox' mailboxes and scanning for new
mails blocks UI and consumes CPU, although it might not be desired
to refresh. This de-syncs message counts listed in sidebar, can be
updated by entering the mailbox.
Signed-off-by: David Sterba <dsterba(a)suse.cz>
---
I'm concerned about CPU consumption mainly because I read mail on
a shared host and I usually know what mboxes I want to read and do
not want to wait when toggling sidebar to easily pick mbox.
buffy.c | 13 ++++++++++---
globals.h | 2 ++
init.h | 6 ++++++
sidebar.c | 15 +++++++++++++++
sidebar.h | 2 ++
5 files changed, 35 insertions(+), 3 deletions(-)
diff --git a/buffy.c b/buffy.c
index 989ea10..fc8efa6 100644
--- a/buffy.c
+++ b/buffy.c
@@ -26,6 +26,7 @@
#include "mx.h"
#include "mutt_curses.h"
+#include "sidebar.h"
#ifdef USE_IMAP
#include "imap.h"
@@ -543,22 +544,28 @@ static void buffy_check(BUFFY *tmp, struct stat *contex_sb)
{
case M_MBOX:
case M_MMDF:
- if (option(OPTSIDEBAR))
+ if (sidebar_should_refresh()) {
buffy_mbox_update (tmp);
+ sidebar_updated();
+ }
if (buffy_mbox_hasnew (tmp, &sb) > 0)
BuffyCount++;
break;
case M_MAILDIR:
- if (option(OPTSIDEBAR))
+ if (sidebar_should_refresh()) {
buffy_maildir_update (tmp);
+ sidebar_updated();
+ }
if (buffy_maildir_hasnew (tmp) > 0)
BuffyCount++;
break;
case M_MH:
- if (option(OPTSIDEBAR))
+ if (sidebar_should_refresh()) {
mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged);
+ sidebar_updated();
+ }
if ((tmp->new = mh_buffy (tmp->path)) > 0)
BuffyCount++;
break;
diff --git a/globals.h b/globals.h
--- a/globals.h
+++ b/globals.h
@@ -212,6 +212,8 @@ WHERE short ScoreThresholdFlag;
WHERE struct buffy_t *CurBuffy INITVAL(0);
WHERE short DrawFullLine INITVAL(0);
WHERE short SidebarWidth;
+WHERE short SidebarRefresh;
+WHERE short SidebarLastRefresh;
#ifdef USE_IMAP
WHERE short ImapKeepalive;
WHERE short ImapPipelineDepth;
diff --git a/init.h b/init.h
--- a/init.h
+++ b/init.h
@@ -1995,6 +1995,12 @@ struct option_t MuttVars[] = {
{ "sidebar_width", DT_NUM, R_BOTH, UL &SidebarWidth, 0 },
/*
** .pp
+ ** Do not refresh sidebar in less than $sidebar_refresh seconds,
+ ** (0 disables refreshing).
+ */
+ { "sidebar_refresh", DT_NUM, R_BOTH, UL &SidebarRefresh, 60 },
+ /*
+ ** .pp
** The width of the sidebar.
*/
{ "pgp_use_gpg_agent", DT_BOOL, R_NONE, OPTUSEGPGAGENT, 0},
diff --git a/sidebar.c b/sidebar.c
--- a/sidebar.c
+++ b/sidebar.c
@@ -199,6 +199,7 @@ int draw_sidebar(int menu) {
saveSidebarWidth = SidebarWidth;
if(!option(OPTSIDEBAR)) SidebarWidth = 0;
initialized = true;
+ SidebarLastRefresh = time(NULL);
}
/* save or restore the value SidebarWidth */
@@ -434,3 +435,16 @@ void toggle_sidebar(int menu)
set_curbuffy(""); /* default is the first mailbox */
draw_sidebar(menu);
}
+
+int sidebar_should_refresh()
+{
+ if (option(OPTSIDEBAR) && SidebarRefresh > 0) {
+ if (time(NULL) - SidebarLastRefresh >= SidebarRefresh)
+ return 1;
+ }
+ return 0;
+}
+void sidebar_updated()
+{
+ SidebarLastRefresh = time(NULL);
+}
diff --git a/sidebar.h b/sidebar.h
index 066b33b..94e08be 100644
--- a/sidebar.h
+++ b/sidebar.h
@@ -33,5 +33,7 @@ void scroll_sidebar(int, int);
void set_curbuffy(char*);
void set_buffystats(CONTEXT*);
void toggle_sidebar(int menu);
+int sidebar_should_refresh();
+void sidebar_updated();
#endif /* SIDEBAR_H */
--
1.7.6.233.gd79bc
11 years, 5 months
[PATCH] buildsys: add compiler flags enabling debugging symbols
by David Sterba
Automatically enabled when configured with --enable-debug
Signed-off-by: David Sterba <dsterba(a)suse.cz>
---
configure.ac | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/configure.ac b/configure.ac
index b6464da..167034a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -773,6 +773,7 @@ dnl -- end socket --
AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable debugging support]),
[ if test x$enableval = xyes ; then
AC_DEFINE(DEBUG,1,[ Define to enable debugging info. ])
+ CFLAGS="$CFLAGS -g"
fi
])
--
1.7.6.233.gd79bc
11 years, 5 months
Yay! I can build now!
by Darryl L. Pierce
I've been pretty busy recently and haven't had time to play with the
code or even build it. Now that I've tried, it's building for me and I'm
ready to start putting some time into the code.
Do we have a backlog of tasks to accomplish? And are we at a point where
we can release a stable build to package for Fedora?
--
Darryl L. Pierce, Sr. Software Engineer @ Red Hat, Inc.
Delivering value year after year.
Red Hat ranks #1 in value among software vendors.
http://www.redhat.com/promo/vendor/
11 years, 5 months
displaying full threads (even archived messages)
by Chris Mason
Hi everyone,
The TODO list mentions a features I really wanted, which is making a way
to display an entire thread, including archived messages. I'm not sure
what the best way to wire this up is, but here is some sample code that
replaces the current search with something that returns the entire
thread.
sup worked this way, but it was very difficult to use with big threads
because it was almost impossible to find individual messages that you
cared about. mutt has all the normal limiting/searching commands, so
having a huge thread returned isn't a big deal.
This patch is about 10 minutes old, treat it gently. It needs a
conditional to switch between whole-thread matching and strict message
matching, but I'll let people that know mutt internals better suggest
how to do that.
diff --git a/mutt_notmuch.c b/mutt_notmuch.c
--- a/mutt_notmuch.c
+++ b/mutt_notmuch.c
@@ -699,9 +702,95 @@ done:
FREE(&newpath);
}
+/*
+ * add all the replies to a given messages into the display.
+ * Careful, this calls itself recursively to make sure we get
+ * everything.
+ */
+static void append_replies(CONTEXT *ctx, notmuch_message_t *top)
+{
+ notmuch_messages_t *msgs;
+ for (msgs = notmuch_message_get_replies(top);
+ notmuch_messages_valid(msgs);
+ notmuch_messages_move_to_next(msgs)) {
+ notmuch_message_t *m = notmuch_messages_get(msgs);
+ append_message(ctx, m);
+ /* recurse through all the replies to this message too */
+ append_replies(ctx, m);
+ notmuch_message_destroy(m);
+ }
+}
+
+/*
+ * add each top level reply in the thread, and then add each
+ * reply to the top level replies
+ */
+static void append_thread(CONTEXT *ctx, notmuch_thread_t *thread)
+{
+ notmuch_messages_t *msgs;
+ for (msgs = notmuch_thread_get_toplevel_messages(thread);
+ notmuch_messages_valid(msgs);
+ notmuch_messages_move_to_next(msgs)) {
+ notmuch_message_t *m = notmuch_messages_get(msgs);
+ append_message(ctx, m);
+ append_replies(ctx, m);
+ notmuch_message_destroy(m);
+ }
+}
+
+/*
+ * The default read_query function, this one finds all the
+ * matching threads and then iterates through them
+ */
int nm_read_query(CONTEXT *ctx)
{
notmuch_query_t *q;
+ notmuch_threads_t *threads;
+ struct nm_ctxdata *data;
+ int limit, rc = -1;
+
+ if (init_context(ctx) != 0)
+ return -1;
+
+ data = get_ctxdata(ctx);
+ if (!data)
+ return -1;
+
+ dprint(1, (debugfile, "nm: reading messages...\n"));
+
+ q = get_query(data, FALSE);
+ if (q) {
+ limit = get_limit(data);
+
+ for (threads = notmuch_query_search_threads(q);
+ notmuch_threads_valid(threads) &&
+ (limit == 0 || ctx->msgcount < limit);
+ notmuch_threads_move_to_next(threads)) {
+
+ notmuch_thread_t *thread = notmuch_threads_get(threads);
+ append_thread(ctx, thread);
+ notmuch_thread_destroy(thread);
+ }
+
+ notmuch_query_destroy(q);
+ rc = 0;
+ }
+
+ if (!is_longrun(data))
+ release_db(data);
+
+ ctx->mtime = time(NULL);
+
+ mx_update_context(ctx, ctx->msgcount);
+
+ dprint(1, (debugfile, "nm: reading messages... done [rc=%d, count=%d]\n",
+ rc, ctx->msgcount));
+ return rc;
+}
+
+int nm_read_query_messages(CONTEXT *ctx)
+{
+ notmuch_query_t *q;
notmuch_messages_t *msgs;
struct nm_ctxdata *data;
int limit, rc = -1;
11 years, 5 months
Re: displaying full threads (even archived messages)
by Wesley Hearn
Chris Mason <chris.mason(a)fusionio.com> wrote:
Hi everyone,
The TODO list mentions a features I really wanted, which is making a way
to display an entire thread, including archived messages. I'm not sure
what the best way to wire this up is, but here is some sample code that
replaces the current search with something that returns the entire
thread.
sup worked this way, but it was very difficult to use with big threads
because it was almost impossible to find individual messages that you
cared about. mutt has all the normal limiting/searching commands, so
having a huge thread returned isn't a big deal.
This patch is about 10 minutes old, treat it gently. It needs a
conditional to switch between whole-thread matching and strict message
matching, but I'll let people that know mutt internals better suggest
how to do that.
diff --git a/mutt_notmuch.c b/mutt_notmuch.c
--- a/mutt_notmuch.c
+++ b/mutt_notmuch.c
@@ -699,9 +702,95 @@ done:
FREE(&newpath);
}
+/*
+ * add all the replies to a given messages into the display.
+ * Careful, this calls itself recursively to make sure we get
+ * everything.
+ */
+static void append_replies(CONTEXT *ctx, notmuch_message_t *top)
+{
+ notmuch_messages_t *msgs;
+ for (msgs = notmuch_message_get_replies(top);
+ notmuch_messages_valid(msgs);
+ notmuch_messages_move_to_next(msgs)) {
+ notmuch_message_t *m = notmuch_messages_get(msgs);
+ append_message(ctx, m);
+ /* recurse through all the replies to this message too */
+ append_replies(ctx, m);
+ notmuch_message_destroy(m);
+ }
+}
+
+/*
+ * add each top level reply in the thread, and then add each
+ * reply to the top level replies
+ */
+static void append_thread(CONTEXT *ctx, notmuch_thread_t *thread)
+{
+ notmuch_messages_t *msgs;
+ for (msgs = notmuch_thread_get_toplevel_messages(thread);
+ notmuch_messages_valid(msgs);
+ notmuch_messages_move_to_next(msgs)) {
+ notmuch_message_t *m = notmuch_messages_get(msgs);
+ append_message(ctx, m);
+ append_replies(ctx, m);
+ notmuch_message_destroy(m);
+ }
+}
+
+/*
+ * The default read_query function, this one finds all the
+ * matching threads and then iterates through them
+ */
int nm_read_query(CONTEXT *ctx)
{
notmuch_query_t *q;
+ notmuch_threads_t *threads;
+ struct nm_ctxdata *data;
+ int limit, rc = -1;
+
+ if (init_context(ctx) != 0)
+ return -1;
+
+ data = get_ctxdata(ctx);
+ if (!data)
+ return -1;
+
+ dprint(1, (debugfile, "nm: reading messages...\n"));
+
+ q = get_query(data, FALSE);
+ if (q) {
+ limit = get_limit(data);
+
+ for (threads = notmuch_query_search_threads(q);
+ notmuch_threads_valid(threads) &&
+ (limit == 0 || ctx->msgcount < limit);
+ notmuch_threads_move_to_next(threads)) {
+
+ notmuch_thread_t *thread = notmuch_threads_get(threads);
+ append_thread(ctx, thread);
+ notmuch_thread_destroy(thread);
+ }
+
+ notmuch_query_destroy(q);
+ rc = 0;
+ }
+
+ if (!is_longrun(data))
+ release_db(data);
+
+ ctx->mtime = time(NULL);
+
+ mx_update_context(ctx, ctx->msgcount);
+
+ dprint(1, (debugfile, "nm: reading messages... done [rc=%d, count=%d]\n",
+ rc, ctx->msgcount));
+ return rc;
+}
+
+int nm_read_query_messages(CONTEXT *ctx)
+{
+ notmuch_query_t *q;
notmuch_messages_t *msgs;
struct nm_ctxdata *data;
int limit, rc = -1;
_______________________________________________
mutt-kz mailing list
mutt-kz(a)lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/mutt-kz
11 years, 6 months
whole thread archiving
by Chris Mason
Hi everyone,
This muttrc line:
macro index A "<modify-labels-then-hide>+archive -inbox\n<sync-mailbox>"
Archives a message. Is there a way to do this for a whole thread? I
know I can tag the thread and then archive the tagged messages, but I'm
hoping for muttrc solution.
-chris
11 years, 6 months
Build Issues
by Andrew Davidson
I'm seeing some issues building mutt-kz.
Here's a log excerpt:
gcc -DPKGDATADIR=\"/usr/local/share/mutt\"
-DSYSCONFDIR=\"/usr/local/etc\" -DBINDIR=\"/usr/local/bin\"
-DMUTTLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H=1 -I. -I.
-I. -Iintl -I./intl -Wall -pedantic -Wno-long-long -g -O2 -MT
safe_asprintf.o -MD -MP -MF .deps/safe_asprintf.Tpo -c -o
safe_asprintf.o safe_asprintf.c
mv -f .deps/safe_asprintf.Tpo .deps/safe_asprintf.Po
gcc -DPKGDATADIR=\"/usr/local/share/mutt\"
-DSYSCONFDIR=\"/usr/local/etc\" -DBINDIR=\"/usr/local/bin\"
-DMUTTLOCALEDIR=\"/usr/local/share/locale\" -DHAVE_CONFIG_H=1 -I. -I.
-I. -Iintl -I./intl -Wall -pedantic -Wno-long-long -g -O2 -MT
mutt_notmuch.o -MD -MP -MF .deps/mutt_notmuch.Tpo -c -o mutt_notmuch.o
mutt_notmuch.c
mutt_notmuch.c: In function 'do_database_open':
mutt_notmuch.c:356:6: error: too few arguments to function
'notmuch_database_open'
/usr/local/include/notmuch.h:200:1: note: declared here
make[2]: *** [mutt_notmuch.o] Error 1
make[2]: Leaving directory `/home/amdavidson/src/mutt-kz'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/amdavidson/src/mutt-kz'
make: *** [all] Error 2
Any tips?
Thanks,
-- Andrew Davidson
11 years, 6 months