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] 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
[PATCH] buildsys: remove AM_C_PROTOTYPES
by David Sterba
The macro has been obsoleted and breaks build with automake 1.12, older
versions work ok.
Signed-off-by: David Sterba <dsterba(a)suse.cz>
---
attempts to fix issue #18
configure.ac | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/configure.ac b/configure.ac
index 7a7ebc1..b6464da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -30,7 +30,6 @@ AC_MSG_RESULT($mutt_cv_prefix)
AC_PROG_CC
AC_ISC_POSIX
-AM_C_PROTOTYPES
if test "x$U" != "x"; then
AC_MSG_ERROR(Compiler not ANSI compliant)
fi
--
1.7.6.233.gd79bc
11 years, 6 months