[notmuch] Gmane

2009-11-25 Thread Ingmar Vanhassel
In case anyone's interested, I've submitted this list to gmane:
http://dir.gmane.org/gmane.mail.notmuch.general

Maybe someone who was on this list from the very beginning can submit an
archive to them, for future reference.

-Ingmar
-- 
Exherbo KDE, X.org maintainer


[notmuch] [PATCH 2/4] notmuch: Config option to specify tags to be applied by 'notmuch new'.

2009-11-25 Thread Jan Janak
Hi Bart,

On 25-11 15:56, Bart Trojanowski wrote:
> Jan,
> 
> I really want this feature to get in, so I am going to do my best to
> review your code :)
> 
> Here are some more sticking points...
> 
> > +char **
> > +notmuch_config_get_new_tags (notmuch_config_t *config, size_t *length);
> 
> If you are not giving over control of the pointer to the caller please
> return const char * const *.

I followed Carl's style there, in particular the following function:
notmuch_config_get_user_other_email

I can, of course, change that. But maybe we should wait for Carl to see
which way he prefers.

> Similarly...
> 
> > +char **new_tags;
> 
> ... this should probably be const char **.

That's the same story. I followed user_other_email there.

> Next...
> 
> > +char **
> > +notmuch_config_get_new_tags (notmuch_config_t *config, size_t *length)
> 
> ... but ...
> 
> > +unsigned int count, i;
> > +
> > +if ((tags = notmuch_config_get_new_tags (config, )) == NULL)
> > +   return;
> 
> size_t != unsigned int on all platforms.  Please stick with one or the
> other.  Note there are a few calls to fix here.

That's a good catch. I will fix that one. Thanks a lot for the review, I
really appreciate that!

  -- Jan



[notmuch] [PATCH] notmuch-new: Option to disable tags from the configuration file.

2009-11-25 Thread Jan Janak
Hi Bart,

On 25-11 14:55, Bart Trojanowski wrote:
> Jan,
> 
> I think your use of STRNCMP_LITERAL here is wrong...
> 
> > +   } else if (STRNCMP_LITERAL (argv[i], "--no-config-tags") == 0) {
> > +   add_config_tags = 0;
> 
> it will happily match "--no-config-tags-xxx".

Ahh, I actually stole the code from the part which parses the --verbose
command line option. And I didn't check it. That one suffers from the same
problem, so I'll just fix them both in one patch.

> Can I also suggest including --no-config-tags in the 'notmuch help'
> output?

Sure, I'll add it.

> Besides that I am very happy with this patch series.

Thanks a lot!

  -- Jan


[notmuch] [PATCH] notmuch-new: Test if directory looks like Maildir before skipping tmp.

2009-11-25 Thread Jan Janak
On 25-11 12:12, Scott Robinson wrote:
> Excerpts from Jan Janak's message of Wed Nov 25 11:43:15 -0800 2009:
> > +/* Test if the directory looks like a Maildir directory.
> > + *
> > + * Search through the array of directory entries to see if we can find all
> > + * three subdirectories typical for Maildir, that is "new", "cur", and 
> > "tmp".
> > + *
> > + * Return 1 if the directory looks like a Maildir and 0 otherwise.
> > + */
> > +static int is_maildir (struct dirent **entries, int count)
> > +{
> > +int i, found = 0;
> > +
> > +for (i = 0; i < count; i++) {
> > +if (entries[i]->d_type != DT_DIR) continue;
> > +if (strcmp(entries[i]->d_name, "new") == 0 ||
> > +strcmp(entries[i]->d_name, "cur") == 0 ||
> > +strcmp(entries[i]->d_name, "tmp") == 0)
> > +{
> > +found++;
> > +}
> > +}
> > +
> > +return found >= 3;
> > +}
> 
> Maybe put the "found >= 3" in the for loop's stop-condition?

You are right, of course. Resubmitted, thanks a lot!

  -- Jan


[notmuch] [PATCH] notmuch-new: Test if directory looks like Maildir before skipping tmp.

2009-11-25 Thread Jan Janak
'notmuch new' skips directory entries with the name 'tmp'. This is to
prevent notmuch from processing possibly incomplete Maildir messages
stored in that directory.

This patch attempts to refine the feature. If "tmp" entry is found,
it first checks if the containing directory looks like a Maildir
directory. This is done by searching for other common Maildir
subdirectories. If they exist and if the entry "tmp" is a directory
then it is skipped.

Files and subdirectories with the name "tmp" that do not look like
Maildir will still be processed by 'notmuch new'.

Signed-off-by: Jan Janak 
---
 notmuch-new.c |   29 -
 1 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/notmuch-new.c b/notmuch-new.c
index e32b92a..10dc72b 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -80,6 +80,31 @@ static int ino_cmp(const struct dirent **a, const struct 
dirent **b)
 return ((*a)->d_ino < (*b)->d_ino) ? -1 : 1;
 }

+/* Test if the directory looks like a Maildir directory.
+ *
+ * Search through the array of directory entries to see if we can find all
+ * three subdirectories typical for Maildir, that is "new", "cur", and "tmp".
+ *
+ * Return 1 if the directory looks like a Maildir and 0 otherwise.
+ */
+static int is_maildir (struct dirent **entries, int count)
+{
+int i, found = 0;
+
+for (i = 0; i < count; i++) {
+   if (entries[i]->d_type != DT_DIR) continue;
+   if (strcmp(entries[i]->d_name, "new") == 0 ||
+   strcmp(entries[i]->d_name, "cur") == 0 ||
+   strcmp(entries[i]->d_name, "tmp") == 0)
+   {
+   found++;
+   if (found == 3) return 1;
+   }
+}
+
+return 0;
+}
+
 /* Examine 'path' recursively as follows:
  *
  *   o Ask the filesystem for the mtime of 'path' (path_mtime)
@@ -159,7 +184,9 @@ add_files_recursive (notmuch_database_t *notmuch,
 * user specify files to be ignored. */
if (strcmp (entry->d_name, ".") == 0 ||
strcmp (entry->d_name, "..") == 0 ||
-   strcmp (entry->d_name, "tmp") == 0 ||
+   (entry->d_type == DT_DIR &&
+(strcmp (entry->d_name, "tmp") == 0) &&
+is_maildir (namelist, num_entries)) ||
strcmp (entry->d_name, ".notmuch") ==0)
{
continue;
-- 
1.6.3.3



[notmuch] [PATCH -v4] notmuch.el: Add face support to search and show mode

2009-11-25 Thread Aneesh Kumar K. V
On Tue, 24 Nov 2009 21:24:07 -0800, Alexander Botero-Lowry  wrote:
> On Wed, 25 Nov 2009 10:28:00 +0530, "Aneesh Kumar K.V"  linux.vnet.ibm.com> wrote:
> > This add two faces, notmuch-show-subject-face and
> > notmuch-tag-face. The first face is used to show the subject
> > line in the notmuch-show-mode and the second one to show tags
> > in the notmuch-search-mode.
> > 
> First, I definetly think fontification is the way to go instead of
> the adhoc/crappy way that cworth and I have been doing this in the
> past.
> 
> [snip]
> 
> > +(defvar notmuch-show-font-lock-keywords
> > +  (list ;; header in font-lock-type-face
> > +   (list "\\(Subject:.*$\\)"
> > +'(1  'notmuch-show-subject-face)))
> > +  "Additonal expression to hightlight in notmuch-show-mode")
> > +
> So what happens if I have Subject:  in my message?

It will highlight them too. I initially tried to highlight it only
in the header fields. But then my elisp is not good to find out
how to do it for the full message. That is we need to search the
header area of each message and highlight specific fields. And all
the message fall in the same buffer. 


> We already ran
> into a problem where a patch sent the list that included notmuch control
> character caused it to go into an infinite loop, I'd prefer our
> fontification code be a bit more resilient. At the very least this
> should use the font-lock syntax tables stuff to only do header
> fontification when inside the header block. This would probably require
> that fontification occur before the message is post-processed by 
> notmuch-show to remove the section markers etc.

Highlighting specific part of the email should not get any trouble
like infinite loop. Unless somebody figure out how to make elisp 
highlight specific area, it would be nice to have the patch applied.
I really found it to help me when reading mails.


> 
> Also +1 for more subduded colors than red. :) Possibly consider copying
> the message-mode colors, so that there is a bit of consistency between
> sending and viewing mail? Might even be able to steal the message-mode
> faces by importing their symbols.
> 

I use yellow with black background. It is difficult to find a color that
everybody likes. Infact once of the reason the patch was not applied
till now was yellow may the subject line not readable. So i went for
read which kind of looked fine with white background.



> [snip]
> 
> >  (defun notmuch-search-mode ()
> >"Major mode for searching mail with notmuch.
> > @@ -865,7 +888,18 @@ global search.
> >(setq truncate-lines t)
> >(setq major-mode 'notmuch-search-mode
> > mode-name "notmuch-search")
> > -  (setq buffer-read-only t))
> > +  (setq buffer-read-only t)
> > +  (if (not notmuch-tag-face-alist)
> > +  (add-to-list 'notmuch-search-font-lock-keywords (list
> > +   "\\(([^)]*)$\\)" '(1  'notmuch-tag-face)))
> This way of detecting the tags seems ok, but I think it would be nicer
> if it could be done even more deterministically. :) One idea that be
> neat is to have a --format=sexp for notmuch search, which exports sexps
> (probably alists, but could be some other format) for the search results
> that can just be eval'd and processed in a cleaner way (and would also
> make for nicer APIs in emacs for querying notmuch itself). Actually I
> really like the idea of a sexp output mode for show too, instead of the
> markers *plots*
> 
> > +(progn
> > +  (setq notmuch-search-tags (mapcar 'car notmuch-tag-face-alist))
> > +  (loop for notmuch-search-tag  in notmuch-search-tags
> > +do (add-to-list 'notmuch-search-font-lock-keywords (list
> > +   (concat "\\(" notmuch-search-tag "\\)")
> > +   `(1  ,(cdr (assoc notmuch-search-tag 
> > notmuch-tag-face-alist
> > +  (set (make-local-variable 'font-lock-defaults)
> > + '(notmuch-search-font-lock-keywords t)))
> >  
> I don't really see the point of fontifying all tags the same way if no
> tag-faces have been set, especially if none of the rest of the search
> results are fontified.

This was done as per Carl's request. The idea was to make tags stand out
from rest of the subject. 

-aneesh


[notmuch] [PATCH] notmuch-new: Test if directory looks like Maildir before skipping tmp.

2009-11-25 Thread Jan Janak
'notmuch new' skips directory entries with the name 'tmp'. This is to
prevent notmuch from processing possibly incomplete Maildir messages
stored in that directory.

This patch attempts to refine the feature. If "tmp" entry is found,
it first checks if the containing directory looks like a Maildir
directory. This is done by searching for other common Maildir
subdirectories. If they exist and if the entry "tmp" is a directory
then it is skipped.

Files and subdirectories with the name "tmp" that do not look like
Maildir will still be processed by 'notmuch new'.

Signed-off-by: Jan Janak 
---
 notmuch-new.c |   28 +++-
 1 files changed, 27 insertions(+), 1 deletions(-)

diff --git a/notmuch-new.c b/notmuch-new.c
index e32b92a..3e1c9a7 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -80,6 +80,30 @@ static int ino_cmp(const struct dirent **a, const struct 
dirent **b)
 return ((*a)->d_ino < (*b)->d_ino) ? -1 : 1;
 }

+/* Test if the directory looks like a Maildir directory.
+ *
+ * Search through the array of directory entries to see if we can find all
+ * three subdirectories typical for Maildir, that is "new", "cur", and "tmp".
+ *
+ * Return 1 if the directory looks like a Maildir and 0 otherwise.
+ */
+static int is_maildir (struct dirent **entries, int count)
+{
+int i, found = 0;
+
+for (i = 0; i < count; i++) {
+   if (entries[i]->d_type != DT_DIR) continue;
+   if (strcmp(entries[i]->d_name, "new") == 0 ||
+   strcmp(entries[i]->d_name, "cur") == 0 ||
+   strcmp(entries[i]->d_name, "tmp") == 0)
+   {
+   found++;
+   }
+}
+
+return found >= 3;
+}
+
 /* Examine 'path' recursively as follows:
  *
  *   o Ask the filesystem for the mtime of 'path' (path_mtime)
@@ -159,7 +183,9 @@ add_files_recursive (notmuch_database_t *notmuch,
 * user specify files to be ignored. */
if (strcmp (entry->d_name, ".") == 0 ||
strcmp (entry->d_name, "..") == 0 ||
-   strcmp (entry->d_name, "tmp") == 0 ||
+   (entry->d_type == DT_DIR &&
+(strcmp (entry->d_name, "tmp") == 0) &&
+is_maildir (namelist, num_entries)) ||
strcmp (entry->d_name, ".notmuch") ==0)
{
continue;
-- 
1.6.3.3



[notmuch] [PATCH] notmuch-new: Option to disable tags from the configuration file.

2009-11-25 Thread Jan Janak
This patch slightly changes behavior of the command line option --tag.
Any tags specified by the user on the command line will be added
*in addition* to tags configured in the configuration file.

This behavior can be changed with the new command line option
--no-config-tags. The user can use this option to ignore any tags from
the configuration file (i.e. only tags specified on the command line
will be applied).

With this new option the user can configure 'notmuch new' not to apply
any tags (and that was not possible before):

  notmuch new --no-config-tags

Suggested by Karl Wiberg.

Signed-off-by: Jan Janak 
---
 notmuch-new.c |   19 +++
 notmuch.c |   11 ++-
 2 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/notmuch-new.c b/notmuch-new.c
index 94036da..e988bf1 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -28,6 +28,7 @@ static notmuch_config_t *config = NULL;

 static char **cmdline_tags = NULL;
 static unsigned int cmdline_tags_count = 0;
+static int add_config_tags = 1;

 static void
 handle_sigalrm (unused (int signal))
@@ -79,19 +80,19 @@ apply_tags (notmuch_message_t *message)
 char** tags;
 unsigned int count, i;

+if (add_config_tags) {
+   tags = notmuch_config_get_new_tags (config, );
+   for (i = 0; tags && (i < count); i++) {
+   if (tags[i])
+   notmuch_message_add_tag (message, tags[i]);
+   }
+}
+
 if (cmdline_tags_count) {
for (i = 0; i < cmdline_tags_count; i++) {
if (cmdline_tags[i])
notmuch_message_add_tag (message, cmdline_tags[i]);
}
-} else {
-   if ((tags = notmuch_config_get_new_tags (config, )) == NULL)
-   return;
-
-   for (i = 0; i < count; i++) {
-   if (tags[i])
-   notmuch_message_add_tag (message, tags[i]);
-   }
 }
 }

@@ -451,6 +452,8 @@ notmuch_new_command (void *ctx, int argc, char *argv[])
}
tmp[cmdline_tags_count++] = opt;
cmdline_tags = tmp;
+   } else if (STRNCMP_LITERAL (argv[i], "--no-config-tags") == 0) {
+   add_config_tags = 0;
} else {
fprintf (stderr, "Unrecognized option: %s\n", argv[i]);
return 1;
diff --git a/notmuch.c b/notmuch.c
index 1bd3265..ff8d5bb 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -149,7 +149,16 @@ command_t commands[] = {
   "\n"
   "\t\t\tAdd the tag  to all messages newly added to the\n"
   "\t\t\tdatabase. You may repeat this option several times if\n"
-  "\t\t\tyou want to add more tags.\n"
+  "\t\t\tyou want to add more tags. Any tags configured in the\n"
+  "\t\t\tconfiguration file will still be added, unless you also\n"
+  "\t\t\tuse the option --no-config-tags.\n"
+  "\n"
+  "\t\t--no-config-tags\n"
+  "\n"
+  "\t\t\tDo not add tags configured in the configuration file.\n"
+  "\t\t\tUse this option if you only want to add tags specified\n"
+  "\t\t\ton the command line with --tag or if do not want to add\n"
+  "\t\t\tany tags at all.\n"
   "\n"
   "\t\tNote: \"notmuch new\" runs (other than the first run) will\n"
   "\t\tskip any read-only directories, so you can use that to mark\n"
-- 
1.6.3.3



[notmuch] [PATCH 3/3] change config file location to be ~/.notmuch/config

2009-11-25 Thread Carl Worth
On Sun, 22 Nov 2009 18:14:20 -0500, Jameson Graef Rollins  wrote:
>   else.  (I think there's a whole other thread to be started about
>   this, because I think the config should also hold the location of
>   the maildir to be indexed, not the path to the index itself, which
>   then makes implicit assumptions about where the maildir is.)

For what it's worth, the configuration *does* hold the location of the
maildir to be indexed, (and then makes an implicit assumption about
where the index is).

-Carl


[notmuch] [PATCH 3/3] change config file location to be ~/.notmuch/config

2009-11-25 Thread Carl Worth
On Sun, 22 Nov 2009 16:58:36 -0500, Jameson Graef Rollins  wrote:
> This change creates a ~/.notmuch config directory where the config
> file is stored when created with the "setup" command.  The use of a
> ~/.notmuch config directory creates one place where all notmuch config
> files and data can be stored, which will greatly simplify managing
> notmuch, and reduce cluter of user dot files.

As discussed downthread, we should really make this fallback to load
~/.notmuch-config in case ~/.notmuch/config doesn't exist.

But as soon as we have that backwards compatibility in place, then
there's no rush for this change at all. We can wait until we actually
have a second file to store in here before we move from a single
.notmuch-config file to a ~/.notmuch/config file within a directory.

-Carl


[notmuch] [PATCH 2/3] modify notmuch_setup_command to return 1 if config file write fails.

2009-11-25 Thread Carl Worth
On Sun, 22 Nov 2009 16:58:35 -0500, Jameson Graef Rollins  wrote:
> This fixes a small bug in notmuch_setup_command such that it returned
> OK and output the setup message footer even if the config file write
> step failed.

Thanks for the fix. This is pushed.

-Carl


[notmuch] [PATCH 1/3] remove Makefile.config from source to allow for custom config.

2009-11-25 Thread Carl Worth
On Sun, 22 Nov 2009 16:58:34 -0500, Jameson Graef Rollins  wrote:
> Modified ./configure script to generate a Makefile.config if it
> doesn't exist.  This will allow people to maintain custom
> Makefile.config files without causing conflicts with the repository.

It's definitely a good idea to get the generated Makefile.config out of
the repository so that users can maintain their own versions without
conflicts.

In order to do this, we'll need to fix the Makefile to have a rule to
generate Makefile.config if it doesn't exist by running configure, (and
it could also give a message letting the user know that it's running
configure without arguments, and the user can run it explicitly with
arguments if desired[*]).

-Carl

[*] Of course, that's not *really* necessary until our configure script
actually *does* accept arguments, but we really should add at least
--prefix right away.


[notmuch] [PATCH 2/2] Recognize reply --format=headers-only-git

2009-11-25 Thread Jed Brown
This currently means the same thing as --format=headers-only, but this
name gives more freedom to change --format=headers-only without breaking
existing versions of git.
---
 notmuch-reply.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/notmuch-reply.c b/notmuch-reply.c
index 9ca1236..2b16dae 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -376,7 +376,8 @@ notmuch_reply_command (void *ctx, int argc, char *argv[])
opt = argv[i] + sizeof ("--format=") - 1;
if (strcmp (opt, "default") == 0) {
reply_format_func = notmuch_reply_format_default;
-   } else if (strcmp (opt, "headers-only") == 0) {
+   } else if (strcmp (opt, "headers-only") == 0 ||
+  strcmp (opt, "headers-only-git") == 0) {
reply_format_func = notmuch_reply_format_headers_only;
} else {
fprintf (stderr, "Invalid value for --format: %s\n", opt);
-- 
1.6.5.3



[notmuch] [PATCH 4/4] notmuch-new: New cmdline option --tag=.

2009-11-25 Thread Jan Janak
Hi Karl,

On Wed, Nov 25, 2009 at 7:21 AM, Karl Wiberg  wrote:
> On Tue, Nov 24, 2009 at 11:10 PM, Jan Janak  wrote:
>> The list of tags to be applied by 'notmuch new' can be configured in
>> the configuration file. This command line option can be used to
>> override the list of tags from the coonfiguration file on the command
>> line. You may repeat the option several times if you want to apply
>> more than one tag:
>>
>> ?notmuch new --tag=apple --tag=orange
>
> This leaves no way to skip the tags in the config file without adding
> at least one tag on the command line, right?

Right.

> It might be more flexible
> to e.g. have the commandline tags applied in _addition_ to the tags in
> the config, and have a --no-config-tags flag to skip the tags in the
> config when desired.

Yeah, I think that's a very good idea. I'll submit another patch for
that. Thanks for the suggestion!

  -- Jan


[notmuch] [PATCH 2/4] notmuch: Config option to specify tags to be applied by 'notmuch new'.

2009-11-25 Thread Bart Trojanowski
Jan,

I really want this feature to get in, so I am going to do my best to
review your code :)

Here are some more sticking points...

> +char **
> +notmuch_config_get_new_tags (notmuch_config_t *config, size_t *length);

If you are not giving over control of the pointer to the caller please
return const char * const *.

Similarly...

> +char **new_tags;

... this should probably be const char **.

Next...

> +char **
> +notmuch_config_get_new_tags (notmuch_config_t *config, size_t *length)

... but ...

> +unsigned int count, i;
> +
> +if ((tags = notmuch_config_get_new_tags (config, )) == NULL)
> + return;

size_t != unsigned int on all platforms.  Please stick with one or the
other.  Note there are a few calls to fix here.

-Bart

-- 
WebSig: http://www.jukie.net/~bart/sig/


[notmuch] [PATCH] notmuch-new: Option to disable tags from the configuration file.

2009-11-25 Thread Bart Trojanowski
Jan,

I think your use of STRNCMP_LITERAL here is wrong...

> + } else if (STRNCMP_LITERAL (argv[i], "--no-config-tags") == 0) {
> + add_config_tags = 0;

it will happily match "--no-config-tags-xxx".

Can I also suggest including --no-config-tags in the 'notmuch help'
output?

Besides that I am very happy with this patch series.

-pBart

-- 
WebSig: http://www.jukie.net/~bart/sig/


[notmuch] [PATCH] notmuch.el: Require message mode to avoid undefined function in replies.

2009-11-25 Thread Eric Anholt
Otherwise, those without keithp's .emacs would end up with reply mode
not being entered.  Suggested by keithp.
---
 notmuch.el |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 551048a..42d397a 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -49,6 +49,7 @@

 (require 'cl)
 (require 'mm-view)
+(require 'message)

 (defvar notmuch-show-mode-map
   (let ((map (make-sparse-keymap)))
-- 
1.6.4.3



[notmuch] Using notmuch from Ruby, Python, et al.

2009-11-25 Thread Jeffrey Ollie
On Wed, Nov 25, 2009 at 11:58 AM, Scott Robinson  wrote:
>
> I selected cJSON because it was simple for integration. Given how libsha1.c is
> included in lib/, I figured adding a depedency wouldn't be very popular.

Oh, I noticed libsha1.c as well, and it bugs the heck out of me.  I
just haven't gotten around to doing anything about it yet.

> Would it be better to link with a previously existing library?

IMHO yes.  I was looking at json-glib because it seems to be the only
C JSON API in Fedora, plus it's based upon glib.  From what I've read
it should be really easy to serialize a GMimeObject to a JSON
structure with very few calls using json-glib.

-- 
Jeff Ollie


[notmuch] Using notmuch from Ruby, Python, et al.

2009-11-25 Thread Jeffrey Ollie
On Wed, Nov 25, 2009 at 11:40 AM, Scott Robinson  wrote:
>
> As the json work is a bit more substantial, is it preferable to start a 
> [PATCH]
> thread or link to a git repo?

Probably a new [PATCH] thread so that the changes can be discussed.

-- 
Jeff Ollie


[notmuch] Using notmuch from Ruby, Python, et al.

2009-11-25 Thread Jeffrey Ollie
On Wed, Nov 25, 2009 at 10:16 AM, Scott Robinson  wrote:
>
> To accomplish this, I used the cJSON library sans parsing logic.

I wasn't familiar with cJSON so I went over to take a look.  I haven't
really examined the code, but I really don't like the fact that you
are expected to copy the cJSON code into your project.

-- 
Jeff Ollie


[notmuch] Search results now start appearing "instantly"

2009-11-25 Thread Carl Worth
Here's a nice feature for any of you who have been suffering with
"notmuch search" taking forever before it would complete, (such as when
trying to display "notmuch search tag:inbox" with every message in your
collection having the inbox tag).

I've fixed the "notmuch search" command-line program to not do any of
the "chunking" that it was doing before, but to instead stream results
out as quickly as possible. So it takes maybe a second or two before the
results start appearing, but then it's a steady stream from then on.

I've also fixed the emacs interface to "notmuch search" which previously
would wait until the command completed and would then do the processing
it needs to on the buffer. The new implementation instead fires off
"notmuch search" as an asynchronous process and filters the results as
they come in.

The net effect is that searches now appear instantly and you can just
watch the scrollbar shrink as the results keep coming in, (and you can
navigate and read messages as much as you'd like while results keep
coming).

It's working out fairly well, (but for one minor bug which is that you
lose your current position when you refresh). And I hope people are
happy with it. For some it might take notmuch from "interesting, but
too slow to be usable" to "blisteringly fast, and where have you been
all my life".

The one thing that might still be undesirable is that the "notmuch
search" process will still continue to burn CPU until all of the results
are complete. We could probably take some clues from the user's actions
to ameliorate this. It would be easy to suspend the search process when
the user obviously isn't needing more results and then resume it
later. Detecting what the user needs is a little tricky, but in some
cases will be obvious, (such as the user switching away from the scroll
buffer or the user viewing a tiny fraction of the search results and not
scrolling through them).

So please update to the latest code and let me know what you think. I'll
be interested to hear if this helps people, and also to know if the CPU
usage is a problem for anybody.

And for the authors of the other interfaces, let us know when you've got
similar support for streaming searches, (or if you didn't get this
automatically as soon as "notmuch search" was fixed).

-Carl
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20091125/bfdac07d/attachment-0001.pgp>


[notmuch] notmuch new: Memory problem

2009-11-25 Thread Dominik Epple
Hello,

I repeated the procedure (mb2md, notmuch new), but before, I saved all
those large emails with backup logs into a separate folder which i
deleted before "notmuch new". Then, "notmoch new" works as expected.
So the problem stems indeed from too many too large files being
present. (I actually found some being as large as 40M, not just 2.4M,
as written in previous mails.)

Regards
Dominik


2009/11/23 Dominik Epple :
> Hi,
>
> 2009/11/20 Carl Worth :
>> On Fri, 20 Nov 2009 09:56:50 +0100, Dominik Epple > googlemail.com> wrote:
>>> Is there a problem with the number of my mails? I currently have over
>>> 40.000 Mails... they live currently in mbox files, I created a Maildir
>>> with mb2md-3.20.pl.
>>
>> I'm suspecting that you have some big files in there, (such as indexes
>> from some other mail program). We had code in notmuch to detect and
>> ignore these, but a recent bug had broken that.
>>
>> I just fixed this code as of the below commit. So please update and try
>> again and let us know if things work any better.
>
> Ok, one of the problems seems to be solved. One can learn from the
> info: output that the code actually ignores non-email data. These
> files are small and fragments of real mail. Obviously the mb2md code
> made errors there.
>
> But I run in a different issue. I have a lot of files in the Maildir
> which contain base64 encoded binary data. (Some remote site sends my
> its daily backup logs.) Those files are all of 2.4 megabyte in size.
> By adding some debug code to notmuch-new.c, I find out that the
> program becomes very slow and consumes a lot of memory when adding
> these files. I just killed it when it consumed 2 GByte again.
>
> So as you suspected, the problem seems to stem from large files. But
> those large files are not indices or stuff like that from different
> mail programs, but they are valid emails which contain a lot of
> (encoded) binary data.
>
> Perhaps we should be able to configure notmuch such that he ignores
> all mails that match specific pattern (like "Subject: Backup logs
> from.*")
>
> Regards
> Dominik
>


[notmuch] Using notmuch from Ruby, Python, et al.

2009-11-25 Thread Jeffrey Ollie
On Wed, Nov 25, 2009 at 10:16 AM, Scott Robinson  wrote:
>
> == Shared Library
>
> I have modified the build to output a shared library. It's a small change
> relying on libtool.
>
> However, the archives indicate Carl dislikes libtool?

Ugh, please, let's not go down the autoconf/automake/libtool route.

> == JSON output
>
> I added a --output=(text|json) option to "search" and "show." Then, emit json
> results appropriately.
>
> To accomplish this, I used the cJSON library sans parsing logic.
>
> However, I saw discussion about providing a --format option?

Awesome, I was just looking at using json-glib but I haven't gotten
very far yet, mainly because I've never used it before (nor done much
of anything with JSON). I was going to call the option
'--output-format=(standard|json)' but I'm not going to worry about the
color of that bikeshed.

IMHO, I think both approaches would be valuable, that way people
writing front ends could choose the methods that worked best for them.
 Do you have patches that you are ready to share?

-- 
Jeff Ollie


[notmuch] [PATCH -v4] notmuch.el: Add face support to search and show mode

2009-11-25 Thread Bart Trojanowski
* Jeffrey Ollie  [091125 09:33]:
> On Tue, Nov 24, 2009 at 11:24 PM, Alexander Botero-Lowry
>  wrote:
> >
> > This way of detecting the tags seems ok, but I think it would be nicer
> > if it could be done even more deterministically. :) One idea that be
> > neat is to have a --format=sexp for notmuch search, which exports sexps
> > (probably alists, but could be some other format) for the search results
> > that can just be eval'd and processed in a cleaner way (and would also
> > make for nicer APIs in emacs for querying notmuch itself). Actually I
> > really like the idea of a sexp output mode for show too, instead of the
> > markers *plots*
> 
> Along the same lines, I was thinking that it would be nice to be able
> to get output formatted in JSON as well for possible use in a web
> front-end.  Actually, it looks like Emacs has support for JSON as
> well[1].  Not sure what release it was introduced in, but I see that
> it's in 23.1.
> 
> http://edward.oconnor.cx/2006/03/json.el

Would it be possible to make templates for output?

notmuch show --format=json would have notmuch follow rules from
.notmuch/json.template (or somesuch)

-Bart

-- 
WebSig: http://www.jukie.net/~bart/sig/


[notmuch] [PATCH] notmuch-new: Fix notmuch new to look at files within symbolic links

2009-11-25 Thread Aneesh Kumar K.V
We look at the modified time of the database and the directory
to decide whether we need to look at only the subdirectories.
ie, if directory modified time is < database modified time
then we have already looking at all the files withing the
directory. So we just need to iterate through the subdirectories

But with symlinks we need to make sure we follow them even if
the directory modified time is less than database modified time

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch-new.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/notmuch-new.c b/notmuch-new.c
index e32b92a..ba5bb5a 100644
--- a/notmuch-new.c
+++ b/notmuch-new.c
@@ -149,7 +149,7 @@ add_files_recursive (notmuch_database_t *notmuch,
/* If this directory hasn't been modified since the last
 * add_files, then we only need to look further for
 * sub-directories. */
-   if (path_mtime <= path_dbtime && entry->d_type != DT_DIR)
+   if (path_mtime <= path_dbtime && entry->d_type == DT_REG)
continue;

/* Ignore special directories to avoid infinite recursion.
-- 
1.6.5.2.74.g610f9



[notmuch] [PATCH -v2] notmuch.el: Use variable notmuch-search-oldest-first to decide the search order

2009-11-25 Thread Aneesh Kumar K.V
Make sure we use notmuch-search-oldest-first to decide the how
the search result should be displayed. This helps to set the
value to nil and have latest mail shown first. This also fix the
notmuch-folder mode to use the right search order when we select
a folder. Also the notmuch command is fixed to use the right ordering.


Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |7 ---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 5737f77..45c3dc6 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -817,7 +817,8 @@ thread from that buffer can be show when done with this 
one)."
 (fset 'notmuch-search-mode-map notmuch-search-mode-map)

 (defvar notmuch-search-query-string)
-(defvar notmuch-search-oldest-first)
+(defvar notmuch-search-oldest-first t
+  "Show the oldest mail first in the search-mode")


 (defun notmuch-search-scroll-up ()
@@ -1129,7 +1130,7 @@ current search results AND that are tagged with the given 
tag."
 (defun notmuch ()
   "Run notmuch to display all mail with tag of 'inbox'"
   (interactive)
-  (notmuch-search "tag:inbox" t))
+  (notmuch-search "tag:inbox" notmuch-search-oldest-first))

 (setq mail-user-agent 'message-user-agent)

@@ -1199,7 +1200,7 @@ results for the search terms in that line.
   (setq folder (notmuch-folder-find-name)))
   (let ((search (assoc folder notmuch-folders)))
 (if search
-   (notmuch-search (cdr search) t
+   (notmuch-search (cdr search) notmuch-search-oldest-first

 (defun notmuch-folder ()
   "Show the notmuch folder view and update the displayed counts."
-- 
1.6.5.2.74.g610f9



[notmuch] [PATCH -v4] notmuch.el: Add face support to search and show mode

2009-11-25 Thread Aneesh Kumar K.V
This add two faces, notmuch-show-subject-face and
notmuch-tag-face. The first face is used to show the subject
line in the notmuch-show-mode and the second one to show tags
in the notmuch-search-mode.

We can selectively highlight each tag by setting notmuch-tag-face-alist as below

(defface notmuch-tag-unread-face
 'class color) (background light)) (:foreground "goldenrod" :bold t))
(((class color) (background dark)) (:foreground "goldenrod" :bold t)))
  "Notmuch search mode face used to highligh tags.")

(defface notmuch-tag-inbox-face
 'class color) (background light)) (:foreground "red" :bold t))
(((class color) (background dark)) (:foreground "red" :bold t)))
  "Notmuch search mode face used to highligh tags.")

(setq notmuch-tag-face-alist '(("unread" . 'notmuch-tag-unread-face)
 ("inbox" . 'notmuch-tag-inbox-face)))
(require 'notmuch)

Signed-off-by: Aneesh Kumar K.V 
---
 notmuch.el |   38 --
 1 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 551048a..5737f77 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -663,6 +663,17 @@ which this thread was originally shown."
   (notmuch-show-markup-message)))
   (notmuch-show-hide-markers))

+(defface notmuch-show-subject-face
+ 'class color)) (:foreground "red")))
+  "Notmuch show mode face used to highligh subject line."
+  :group 'notmuch)
+
+(defvar notmuch-show-font-lock-keywords
+  (list ;; header in font-lock-type-face
+   (list "\\(Subject:.*$\\)"
+'(1  'notmuch-show-subject-face)))
+  "Additonal expression to hightlight in notmuch-show-mode")
+
 ;;;###autoload
 (defun notmuch-show-mode ()
   "Major mode for viewing a thread with notmuch.
@@ -695,7 +706,9 @@ view, (remove the \"inbox\" tag from each), with
   (use-local-map notmuch-show-mode-map)
   (setq major-mode 'notmuch-show-mode
mode-name "notmuch-show")
-  (setq buffer-read-only t))
+  (setq buffer-read-only t)
+  (set (make-local-variable 'font-lock-defaults)
+ '(notmuch-show-font-lock-keywords t)))

 ;;;###autoload

@@ -835,6 +848,16 @@ thread from that buffer can be show when done with this 
one)."
   (goto-char (point-max))
   (forward-line -1))

+(defface notmuch-tag-face
+ 'class color)) (:foreground "red")))
+  "Notmuch search mode face used to highligh tags."
+  :group 'notmuch)
+
+(defvar notmuch-tag-face-alist nil
+  "List containing the tag list that need to be highlighed")
+
+(defvar notmuch-search-font-lock-keywords  nil)
+
 ;;;###autoload
 (defun notmuch-search-mode ()
   "Major mode for searching mail with notmuch.
@@ -865,7 +888,18 @@ global search.
   (setq truncate-lines t)
   (setq major-mode 'notmuch-search-mode
mode-name "notmuch-search")
-  (setq buffer-read-only t))
+  (setq buffer-read-only t)
+  (if (not notmuch-tag-face-alist)
+  (add-to-list 'notmuch-search-font-lock-keywords (list
+   "\\(([^)]*)$\\)" '(1  'notmuch-tag-face)))
+(progn
+  (setq notmuch-search-tags (mapcar 'car notmuch-tag-face-alist))
+  (loop for notmuch-search-tag  in notmuch-search-tags
+do (add-to-list 'notmuch-search-font-lock-keywords (list
+   (concat "\\(" notmuch-search-tag "\\)")
+   `(1  ,(cdr (assoc notmuch-search-tag 
notmuch-tag-face-alist
+  (set (make-local-variable 'font-lock-defaults)
+ '(notmuch-search-font-lock-keywords t)))

 (defun notmuch-search-find-thread-id ()
   "Return the thread for the current thread"
-- 
1.6.5.2.74.g610f9



[notmuch] Using notmuch from Ruby, Python, et al.

2009-11-25 Thread Scott Robinson
Excerpts from Jeffrey Ollie's message of Wed Nov 25 10:03:05 -0800 2009:
> On Wed, Nov 25, 2009 at 11:58 AM, Scott Robinson  
> wrote:
> > Would it be better to link with a previously existing library?
> 
> IMHO yes.  I was looking at json-glib because it seems to be the only
> C JSON API in Fedora, plus it's based upon glib.  From what I've read
> it should be really easy to serialize a GMimeObject to a JSON
> structure with very few calls using json-glib.

I'm taking a look at json-glib now.

But, it doesn't look to support streaming output.
-- 
Scott Robinson | http://quadhome.com/

Q: Why are my replies five sentences or less?
A: http://five.sentenc.es/


[notmuch] Using notmuch from Ruby, Python, et al.

2009-11-25 Thread Scott Robinson
Excerpts from Jeffrey Ollie's message of Wed Nov 25 09:46:47 -0800 2009:
> On Wed, Nov 25, 2009 at 10:16 AM, Scott Robinson  
> wrote:
> >
> > To accomplish this, I used the cJSON library sans parsing logic.
> 
> I wasn't familiar with cJSON so I went over to take a look.  I haven't
> really examined the code, but I really don't like the fact that you
> are expected to copy the cJSON code into your project.

I selected cJSON because it was simple for integration. Given how libsha1.c is
included in lib/, I figured adding a depedency wouldn't be very popular.

Would it be better to link with a previously existing library?
-- 
Scott Robinson | http://quadhome.com/

Q: Why are my replies five sentences or less?
A: http://five.sentenc.es/


[notmuch] [PATCH] notmuch: Add Maildir directory name as tag name for messages

2009-11-25 Thread Carl Worth
On Sun, 22 Nov 2009 10:33:53 +0100, Michiel Buddingh'  wrote:
> On the positive side, this allows us to map these flags onto tags,
> at least for indexing (the patch at the bottom implements this), and,
> if I can pry you away from your principles, later for modification
> as well.

Hi Michiel,

I'm finally getting around to reviewing this patch. I think the
functionality of respecting these maildir flags for initial import is
going to be really important. So thanks for looking at this!

Some comments on the patches below.

> +enum storage_type
> +notmuch_config_get_storage_type (notmuch_config_t *config);
> +
>  notmuch_bool_t
>  debugger_is_active (void);
>  
> +
> +
> +
>  #endif

[nit] Try to look out for introducing excess whitespace like that.

> +" The other value is 'storage_type', which can currently be set to\n"
> +" 'maildir' or 'none'.\n";

This part of the patch I don't like. I've got a mail collection spanning
over a decade, and it's seen a lot of strange things. Most of my mail is
in maildir format, but not quite all of it. And I actually like the
ability to just shove random new messages into the mail store manually
without having to create a maildir name for it.

So I don't think a global configuration makes sense here. Meanwhile,
it's really easy to detect the presence of a maildir. Whenever we see
child directories of "cur", "new", and "tmp" then we should turn on the
processing of maildir flags for when processing mail in "cur" and "new".

> @@ -257,7 +262,7 @@ notmuch_config_open (void *ctx,
>   talloc_free (email);
>   }
>  }
> -
> +
>  /* When we create a new configuration file here, we  add some
>   * comments to help the user understand what can be done. */
>  if (is_new) {

[nit] Trailing whitespace inserted there as well.

Hmm... I was going to say that git ships with a pre-commit hook you can
turn on that checks for trailing whitespace and aborts the commit if
it's present. But it looks like the currently shipping pre-commit.sample
hook doesn't do this anymore. So I'll have to find out what the current
recommended way is to get this behavior. Does anybody here know?

> + i += 3;
> + for (; i < (path + l) && !end_of_flags; i++) {
> + switch (*i) {
> + case 'F': /* flagged */
> + notmuch_message_add_tag (message, "flagged");
> + break;
> + case 'R': /* the message has been replied to */
> + notmuch_message_add_tag (message, "replied");
> + break;
> + case 'D': 
> + notmuch_message_add_tag (message, "draft");
> + break;
> + case 'S': /* Indicate a message has been read */
> + notmuch_message_add_tag (message, "seen");
> + seen = TRUE;
> + break;
> + case 'T': /* Indicates a message has been marked as trash */
> + notmuch_message_add_tag (message, "trashed");
> + break;
> + case 'P': /* indicates a message has been forwarded */
> + notmuch_message_add_tag (message, "passed");
> + break;
> + default:
> + end_of_flags = TRUE;
> + break;
> + }
> + }
> +}
> +
> +if (i == NULL || !seen) { 
> + /* mark messages without any flags, or the seen flag as 'unseen' */
> + notmuch_message_add_tag (message, "unseen");
> +}

OK, now we're into the meat of things. Clearly, you're directly
supporting the documented flags of maildir. But we need to do a few
things differently here. Most importantly, notmuch is already using an
"unread" tag, so maildir's S flag should map that *that* rather than
adding new "unseen" and "seen" flags. So messages with the S flag would
not get the "unread" tag and messages without S would get the "unread"
tag.

The "flagged" and "replied" tags seem reasonable enough. But for
"trashed" and "passed" I think I'd rather see the tag names as "deleted"
and "forwarded". (Since I can imagine adding commands to notmuch for
"delete" and "forward" but not for "trash" nor "pass").

Finally, all of the new behavior here needs to be documented in both
notmuch.1 and notmuch.c where the current behavior with respect to
"inbox" and "unread" is already documented.

Oh, and setting the "inbox" tag correctly here based on the maildir tags
is the final and most important thing. It looks like that's missing from
the above. So, a missing "S" flag should map to adding both the "inbox"
and "unread" tags.

> (state->ignore_read_only_directories)) {
>   state->saw_read_only_directory = TRUE;
> - goto DONE;
> + goto DONE;  
>  }

Trailing whitespace strikes again! :-)


> + if (state->storage_type == MAILDIR) {
> + char * leaf = basename(next);

You could save the basename call by examining the leaf name when it is
available as a standalone string up in the caller.

So this patch is close, but needs a few fixes.

Thanks again,

-Carl

[notmuch] Using notmuch from Ruby, Python, et al.

2009-11-25 Thread Scott Robinson
Excerpts from Jeffrey Ollie's message of Wed Nov 25 08:33:39 -0800 2009:
> On Wed, Nov 25, 2009 at 10:16 AM, Scott Robinson  
> wrote:
> >
> > == Shared Library
> >
> > I have modified the build to output a shared library. It's a small change
> > relying on libtool.
> >
> > However, the archives indicate Carl dislikes libtool?
> 
> Ugh, please, let's not go down the autoconf/automake/libtool route.

I didn't use autoconf and friends. Just put in libtool where $(CXX) and $(CC)
are. Going with the system defaults.

See the attached patch.

> > == JSON output
> >
> > I added a --output=(text|json) option to "search" and "show." Then, emit 
> > json
> > results appropriately.
> >
> > To accomplish this, I used the cJSON library sans parsing logic.
> >
> > However, I saw discussion about providing a --format option?
> 
> Awesome, I was just looking at using json-glib but I haven't gotten
> very far yet, mainly because I've never used it before (nor done much
> of anything with JSON). I was going to call the option
> '--output-format=(standard|json)' but I'm not going to worry about the
> color of that bikeshed.
> 
> IMHO, I think both approaches would be valuable, that way people
> writing front ends could choose the methods that worked best for them.
>  Do you have patches that you are ready to share?
> 

Yes!

As the json work is a bit more substantial, is it preferable to start a [PATCH]
thread or link to a git repo?
-- 
Scott Robinson | http://quadhome.com/

Q: Why are my replies five sentences or less?
A: http://five.sentenc.es/
-- next part --
A non-text attachment was scrubbed...
Name: libtoolize-notmuch.diff
Type: application/octet-stream
Size: 3996 bytes
Desc: not available
URL: 
<http://notmuchmail.org/pipermail/notmuch/attachments/20091125/7d8741a7/attachment.obj>


[notmuch] [PATCH -v4] notmuch.el: Add face support to search and show mode

2009-11-25 Thread Jeffrey Ollie
On Tue, Nov 24, 2009 at 11:24 PM, Alexander Botero-Lowry
 wrote:
>
> This way of detecting the tags seems ok, but I think it would be nicer
> if it could be done even more deterministically. :) One idea that be
> neat is to have a --format=sexp for notmuch search, which exports sexps
> (probably alists, but could be some other format) for the search results
> that can just be eval'd and processed in a cleaner way (and would also
> make for nicer APIs in emacs for querying notmuch itself). Actually I
> really like the idea of a sexp output mode for show too, instead of the
> markers *plots*

Along the same lines, I was thinking that it would be nice to be able
to get output formatted in JSON as well for possible use in a web
front-end.  Actually, it looks like Emacs has support for JSON as
well[1].  Not sure what release it was introduced in, but I see that
it's in 23.1.

http://edward.oconnor.cx/2006/03/json.el

-- 
Jeff Ollie


[notmuch] Using notmuch from Ruby, Python, et al.

2009-11-25 Thread Scott Robinson
I'm hoping this thread will provide a guide for my efforts.

I'm writing a web frontend for notmuch in Ruby. But, the output from the
notmuch command-line is ambiguous. Therefore, I've started two branches
experimenting with different ways of providing hooks.

Which of these approaches are likely to be pulled upstream?

== Shared Library

I have modified the build to output a shared library. It's a small change
relying on libtool.

However, the archives indicate Carl dislikes libtool?

== JSON output

I added a --output=(text|json) option to "search" and "show." Then, emit json
results appropriately.

To accomplish this, I used the cJSON library sans parsing logic.

However, I saw discussion about providing a --format option?
-- 
Scott Robinson | http://quadhome.com/

Q: Why are my replies five sentences or less?
A: http://five.sentenc.es/


[notmuch] [PATCH 4/4] notmuch-new: New cmdline option --tag=.

2009-11-25 Thread Karl Wiberg
On Tue, Nov 24, 2009 at 11:10 PM, Jan Janak  wrote:
> The list of tags to be applied by 'notmuch new' can be configured in
> the configuration file. This command line option can be used to
> override the list of tags from the coonfiguration file on the command
> line. You may repeat the option several times if you want to apply
> more than one tag:
>
> ?notmuch new --tag=apple --tag=orange

This leaves no way to skip the tags in the config file without adding
at least one tag on the command line, right? It might be more flexible
to e.g. have the commandline tags applied in _addition_ to the tags in
the config, and have a --no-config-tags flag to skip the tags in the
config when desired. Or, if that seems more convenient, have a
--config-tags=yes|no flag that defaults to yes when no --tag is given,
and to no when at least one --tag is given.

-- 
Karl Wiberg, kha at treskal.com
   subrabbit.wordpress.com
   www.treskal.com/kalle


[notmuch] [PATCH] Silence compiler warning by initializing a variable.

2009-11-25 Thread Jeffrey C. Ollie
If Xapian threw an exception on notmuch_query_count_messages the count
variable could be used uninitialized.  Initialize count to solve the
problem.

Signed-off-by: Jeffrey C. Ollie 
---
 lib/query.cc |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/query.cc b/lib/query.cc
index a571a61..9106b92 100644
--- a/lib/query.cc
+++ b/lib/query.cc
@@ -315,7 +315,7 @@ notmuch_query_count_messages (notmuch_query_t *query)
 {
 notmuch_database_t *notmuch = query->notmuch;
 const char *query_string = query->query_string;
-Xapian::doccount count;
+Xapian::doccount count = 0;

 try {
Xapian::Enquire enquire (*notmuch->xapian_db);
-- 
1.6.5.2



[notmuch] [PATCH] notmuch.el: When removing tags, offer only those a msg/thread has set.

2009-11-25 Thread Jan Janak
When removing a tag from a message or thread, build a completion buffer
which contains only tags that the message or thread has really set.

Signed-off-by: Jan Janak 
---
 notmuch.el |8 
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index a9f534b..9594f63 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -137,11 +137,11 @@ within the current window."
   (or (memq prop buffer-invisibility-spec)
  (assq prop buffer-invisibility-spec)

-(defun notmuch-select-tag-with-completion (prompt)
+(defun notmuch-select-tag-with-completion (prompt  search-terms)
   (let ((tag-list
 (with-output-to-string
   (with-current-buffer standard-output
-(call-process notmuch-command nil t nil "search-tags")
+(apply 'call-process notmuch-command nil t nil "search-tags" 
search-terms)
 (completing-read prompt (split-string tag-list "\n+" t) nil nil nil)))

 (defun notmuch-show-next-line ()
@@ -218,7 +218,7 @@ Unlike builtin `next-line' this version accepts no 
arguments."
 (defun notmuch-show-remove-tag ( toremove)
   "Remove a tag from the current message."
   (interactive
-   (list (notmuch-select-tag-with-completion "Tag to remove: ")))
+   (list (notmuch-select-tag-with-completion "Tag to remove: " 
(notmuch-show-get-message-id
   (let ((tags (notmuch-show-get-tags)))
 (if (intersection tags toremove :test 'string=)
(progn
@@ -968,7 +968,7 @@ and will also appear in a buffer named \"*Notmuch 
errors*\"."

 (defun notmuch-search-remove-tag (tag)
   (interactive
-   (list (notmuch-select-tag-with-completion "Tag to remove: ")))
+   (list (notmuch-select-tag-with-completion "Tag to remove: " 
(notmuch-search-find-thread-id
   (notmuch-call-notmuch-process "tag" (concat "-" tag) 
(notmuch-search-find-thread-id))
   (notmuch-search-set-tags (delete tag (notmuch-search-get-tags

-- 
1.6.3.3



[notmuch] [PATCH 2/2] search-tags: Add support for search-terms.

2009-11-25 Thread Jan Janak
This patch adds support for search-terms to 'notmuch search-tags'. If
no search-term is provided then the command returns a list of all tags
from the database.

If the user provides one or more search-terms as arguments then the
command collects tags from matching messages only.

This could be used by functions in the Emacs mode to further limit the
list of tags offered for completion. For example, functions that remove
tags from message(s) could offer only tags present in the message(s).

Signed-off-by: Jan Janak 
---
 notmuch-search-tags.c |   55 
 notmuch.c |   13 +++
 2 files changed, 49 insertions(+), 19 deletions(-)

diff --git a/notmuch-search-tags.c b/notmuch-search-tags.c
index 1201165..7a1305e 100644
--- a/notmuch-search-tags.c
+++ b/notmuch-search-tags.c
@@ -21,34 +21,31 @@

 #include "notmuch-client.h"

-static int
-list_all_tags (notmuch_database_t* db)
+static void
+print_tags (notmuch_tags_t *tags)
 {
-notmuch_tags_t* tags;
-const char* t;
+const char *t;

-if ((tags = notmuch_database_get_all_tags (db)) == NULL) {
-   fprintf (stderr, "Error while obtaining tags from the database.\n");
-   return 1;
-}
-
-while((t = notmuch_tags_get (tags))) {
+while ((t = notmuch_tags_get (tags))) {
printf ("%s\n", t);
notmuch_tags_advance (tags);
 }
-
-notmuch_tags_destroy (tags);
-return 0;
 }

 int
 notmuch_search_tags_command (void *ctx, int argc, char *argv[])
 {
+notmuch_messages_t *msgs;
+notmuch_tags_t *tags;
 notmuch_config_t *config;
 notmuch_database_t *db;
+notmuch_query_t *query;
+char *query_str;

+tags = NULL;
 config = NULL;
 db = NULL;
+query = NULL;

 if ((config = notmuch_config_open (ctx, NULL, NULL)) == NULL) {
goto error;
@@ -60,12 +57,42 @@ notmuch_search_tags_command (void *ctx, int argc, char 
*argv[])
goto error;
 }

-if (list_all_tags (db) != 0) goto error;
+if (argc > 0) {
+   if ((query_str = query_string_from_args (ctx, argc, argv)) == NULL) {
+   fprintf (stderr, "Out of memory.\n");
+   goto error;
+   }
+
+   if (*query_str == '\0') {
+   fprintf (stderr, "Error: Invalid search string.\n");
+   goto error;
+   }
+
+   if ((query = notmuch_query_create (db, query_str)) == NULL) {
+   fprintf (stderr, "Out of memory\n");
+   goto error;
+   }
+
+
+   msgs = notmuch_query_search_messages (query);
+   if ((tags = notmuch_messages_collect_tags (msgs)) == NULL) goto error;
+} else {
+   if ((tags = notmuch_database_get_all_tags (db)) == NULL) {
+   fprintf (stderr, "Error while getting tags from the database.\n");
+   goto error;
+   }
+}
+
+print_tags (tags);

+notmuch_tags_destroy (tags);
+if (query) notmuch_query_destroy (query);
 notmuch_database_close (db);
 return 0;

 error:
+if (tags) notmuch_tags_destroy (tags);
+if (query) notmuch_query_destroy (query);
 if (db) notmuch_database_close (db);
 return 1;
 }
diff --git a/notmuch.c b/notmuch.c
index c57bb5c..5b0284c 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -255,11 +255,14 @@ command_t commands[] = {
   "\t\t\"notmuch restore\" command provides you a way to import\n"
   "\t\tall of your tags (or labels as sup calls them)." },
 { "search-tags", notmuch_search_tags_command,
-  NULL,
-  "List all tags found in the database.",
-  "\t\tThis command returns an alphabetically sorted list of all tags\n"
-  "\t\tthat are present in the database. In other words, the resulting\n"
-  "\t\tlist is a collection of all tags from all messages." },
+  "[ [...] ]",
+  "\t\tList all tags found in the database or matching messages.",
+  "\t\tRun this command without any search-term(s) to obtain a list\n"
+  "\t\tof all tags found in the database. If you provide one or more\n"
+  "\t\tsearch-terms as argument(s) then the resulting list will\n"
+  "\t\tcontain tags only from messages that match the search-term(s).\n"
+  "\n"
+  "\t\tIn both cases the list will be alphabetically sorted." },
 { "help", notmuch_help_command,
   "[]",
   "\t\tThis message, or more detailed help for the named command.",
-- 
1.6.3.3



[notmuch] [PATCH 1/2] lib: New function to collect tags from a list of messages.

2009-11-25 Thread Jan Janak
This patch adds a new function that can be used to collect a list of
unique tags from a list of messages. 'notmuch search-tags' uses the
function to get a list of tags from messages matching a search-term,
but it has the potential to be used elsewhere so we put it in the lib.

Signed-off-by: Jan Janak 
---
 lib/messages.c |   40 
 lib/notmuch.h  |   15 +++
 2 files changed, 55 insertions(+), 0 deletions(-)

diff --git a/lib/messages.c b/lib/messages.c
index 54c0ab0..aa92535 100644
--- a/lib/messages.c
+++ b/lib/messages.c
@@ -20,6 +20,8 @@

 #include "notmuch-private.h"

+#include 
+
 /* Create a new notmuch_message_list_t object, with 'ctx' as its
  * talloc owner.
  *
@@ -140,3 +142,41 @@ notmuch_messages_destroy (notmuch_messages_t *messages)
 {
 talloc_free (messages);
 }
+
+
+notmuch_tags_t *
+notmuch_messages_collect_tags (notmuch_messages_t *messages)
+{
+notmuch_tags_t *tags, *msg_tags;
+notmuch_message_t *msg;
+GHashTable *htable;
+GList *keys, *l;
+const char *tag;
+
+tags = _notmuch_tags_create (messages);
+if (tags == NULL) return NULL;
+
+htable = g_hash_table_new_full (g_str_hash, g_str_equal, free, NULL);
+
+while ((msg = notmuch_messages_get (messages))) {
+   msg_tags = notmuch_message_get_tags (msg);
+   while ((tag = notmuch_tags_get (msg_tags))) {
+   g_hash_table_insert (htable, xstrdup (tag), NULL);
+   notmuch_tags_advance (msg_tags);
+   }
+   notmuch_tags_destroy (msg_tags);
+   notmuch_message_destroy (msg);
+   notmuch_messages_advance (messages);
+}
+
+keys = g_hash_table_get_keys (htable);
+for (l = keys; l; l = l->next) {
+   _notmuch_tags_add_tag (tags, (char *)l->data);
+}
+
+g_list_free (keys);
+g_hash_table_destroy (htable);
+
+_notmuch_tags_prepare_iterator (tags);
+return tags;
+}
diff --git a/lib/notmuch.h b/lib/notmuch.h
index c05e802..9fa2770 100644
--- a/lib/notmuch.h
+++ b/lib/notmuch.h
@@ -635,6 +635,21 @@ notmuch_messages_advance (notmuch_messages_t *messages);
 void
 notmuch_messages_destroy (notmuch_messages_t *messages);

+/* Return a list of tags from all messages.
+ *
+ * The resulting list is guaranteed not to contain duplicated tags.
+ *
+ * WARNING: You can no longer iterate over messages after calling this
+ * function, because the iterator will point at the end of the list.
+ * We do not have a function to reset the iterator yet and the only
+ * way how you can iterate over the list again is to recreate the
+ * message list.
+ *
+ * The function returns NULL on error.
+ */
+notmuch_tags_t *
+notmuch_messages_collect_tags (notmuch_messages_t *messages);
+
 /* Get the message ID of 'message'.
  *
  * The returned string belongs to 'message' and as such, should not be
-- 
1.6.3.3



[notmuch] [PATCH 2/2] notmuch-reply.c: implement notmuch_reply_format_headers_only

2009-11-25 Thread Jed Brown
This command only generates References, To, and Cc headers.
The purpose is primarily for use in

  git send-email --notmuch id:

to get proper threading and address the relevant parties.  Hooks for
other SCMs may come later.

Signed-off-by: Jed Brown 
---
 notmuch-reply.c |   70 +++
 1 files changed, 70 insertions(+), 0 deletions(-)

diff --git a/notmuch-reply.c b/notmuch-reply.c
index 17eb38d..e85568c 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -283,6 +283,74 @@ notmuch_reply_format_default(void *ctx, notmuch_config_t 
*config, notmuch_query_
 return 0;
 }

+/* This format is currently tuned for a git send-email --notmuch hook */
+static int
+notmuch_reply_format_headers_only(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query)
+{
+GMimeMessage *reply;
+notmuch_messages_t *messages;
+notmuch_message_t *message;
+const char *recipients, *in_reply_to, *orig_references, *references;
+char *reply_headers;
+unsigned int i;
+
+for (messages = notmuch_query_search_messages (query);
+notmuch_messages_has_more (messages);
+notmuch_messages_advance (messages))
+{
+   message = notmuch_messages_get (messages);
+
+   /* The 0 means we do not want headers in a "pretty" order. */
+   reply = g_mime_message_new (0);
+   if (reply == NULL) {
+   fprintf (stderr, "Out of memory\n");
+   return 1;
+   }
+
+   in_reply_to = talloc_asprintf (ctx, "<%s>",
+notmuch_message_get_message_id (message));
+
+   orig_references = notmuch_message_get_header (message, "references");
+
+   /* We print References first because git format-patch treats it 
specially.
+* Git uses the first entry of References to create In-Reply-To.
+*/
+   references = talloc_asprintf (ctx, "%s%s%s",
+ in_reply_to,
+ orig_references ? orig_references : "",
+ orig_references ? " " : "");
+   g_mime_object_set_header (GMIME_OBJECT (reply),
+ "References", references);
+
+   for (i = 0; i < ARRAY_SIZE (reply_to_map); i++) {
+   const char *addr;
+
+   recipients = notmuch_message_get_header (message,
+reply_to_map[i].header);
+   if ((recipients == NULL || recipients[0] == '\0') && 
reply_to_map[i].fallback)
+   recipients = notmuch_message_get_header (message,
+
reply_to_map[i].fallback);
+
+   addr = add_recipients_for_string (reply, config,
+ reply_to_map[i].recipient_type,
+ recipients);
+   }
+
+   g_mime_object_set_header (GMIME_OBJECT (reply), "Bcc",
+  notmuch_config_get_user_primary_email (config));
+
+   reply_headers = g_mime_object_to_string (GMIME_OBJECT (reply));
+   printf ("%s", reply_headers);
+   free (reply_headers);
+
+   g_object_unref (G_OBJECT (reply));
+   reply = NULL;
+
+   notmuch_message_destroy (message);
+}
+return 0;
+}
+
 int
 notmuch_reply_command (void *ctx, int argc, char *argv[])
 {
@@ -304,6 +372,8 @@ notmuch_reply_command (void *ctx, int argc, char *argv[])
opt = argv[i] + sizeof ("--format=") - 1;
if (strcmp (opt, "default") == 0) {
reply_format_func = notmuch_reply_format_default;
+   } else if (strcmp (opt, "headers-only") == 0) {
+   reply_format_func = notmuch_reply_format_headers_only;
} else {
fprintf (stderr, "Invalid value for --format: %s\n", opt);
return 1;
-- 
1.6.5.3



[notmuch] [PATCH 1/2] notmuch-reply.c: accept the --format=default default option.

2009-11-25 Thread Jed Brown
This factors actual generation of the reply out of notmuch_reply_command
into notmuch_reply_format_default(), in preparation for other --format=
options.

Signed-off-by: Jed Brown 
---
 notmuch-reply.c |  121 +++---
 1 files changed, 78 insertions(+), 43 deletions(-)

diff --git a/notmuch-reply.c b/notmuch-reply.c
index 65bd356..17eb38d 100644
--- a/notmuch-reply.c
+++ b/notmuch-reply.c
@@ -23,6 +23,17 @@
 #include "notmuch-client.h"
 #include "gmime-filter-reply.h"

+static const struct {
+const char *header;
+const char *fallback;
+GMimeRecipientType recipient_type;
+} reply_to_map[] = {
+{ "reply-to", "from", GMIME_RECIPIENT_TYPE_TO  },
+{ "to", NULL, GMIME_RECIPIENT_TYPE_TO  },
+{ "cc", NULL, GMIME_RECIPIENT_TYPE_CC  },
+{ "bcc",NULL, GMIME_RECIPIENT_TYPE_BCC }
+};
+
 static void
 reply_part_content (GMimeObject *part)
 {
@@ -182,58 +193,17 @@ add_recipients_for_string (GMimeMessage *message,
 return add_recipients_for_address_list (message, config, type, list);
 }

-int
-notmuch_reply_command (void *ctx, int argc, char *argv[])
+static int
+notmuch_reply_format_default(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query)
 {
-notmuch_config_t *config;
-notmuch_database_t *notmuch;
-notmuch_query_t *query;
 GMimeMessage *reply;
-char *query_string;
 notmuch_messages_t *messages;
 notmuch_message_t *message;
-int ret = 0;
 const char *subject, *recipients, *from_addr = NULL;
 const char *in_reply_to, *orig_references, *references;
 char *reply_headers;
-struct {
-   const char *header;
-   const char *fallback;
-   GMimeRecipientType recipient_type;
-} reply_to_map[] = {
-   { "reply-to", "from", GMIME_RECIPIENT_TYPE_TO  },
-   { "to", NULL, GMIME_RECIPIENT_TYPE_TO  },
-   { "cc", NULL, GMIME_RECIPIENT_TYPE_CC  },
-   { "bcc",NULL, GMIME_RECIPIENT_TYPE_BCC }
-};
 unsigned int i;

-config = notmuch_config_open (ctx, NULL, NULL);
-if (config == NULL)
-   return 1;
-
-query_string = query_string_from_args (ctx, argc, argv);
-if (query_string == NULL) {
-   fprintf (stderr, "Out of memory\n");
-   return 1;
-}
-
-if (*query_string == '\0') {
-   fprintf (stderr, "Error: notmuch reply requires at least one search 
term.\n");
-   return 1;
-}
-
-notmuch = notmuch_database_open (notmuch_config_get_database_path (config),
-NOTMUCH_DATABASE_MODE_READ_ONLY);
-if (notmuch == NULL)
-   return 1;
-
-query = notmuch_query_create (notmuch, query_string);
-if (query == NULL) {
-   fprintf (stderr, "Out of memory\n");
-   return 1;
-}
-
 for (messages = notmuch_query_search_messages (query);
 notmuch_messages_has_more (messages);
 notmuch_messages_advance (messages))
@@ -310,6 +280,71 @@ notmuch_reply_command (void *ctx, int argc, char *argv[])

notmuch_message_destroy (message);
 }
+return 0;
+}
+
+int
+notmuch_reply_command (void *ctx, int argc, char *argv[])
+{
+notmuch_config_t *config;
+notmuch_database_t *notmuch;
+notmuch_query_t *query;
+char *opt, *query_string;
+int i, ret = 0;
+int (*reply_format_func)(void *ctx, notmuch_config_t *config, 
notmuch_query_t *query);
+
+reply_format_func = notmuch_reply_format_default;
+
+for (i = 0; i < argc && argv[i][0] == '-'; i++) {
+   if (strcmp (argv[i], "--") == 0) {
+   i++;
+   break;
+   }
+if (STRNCMP_LITERAL (argv[i], "--format=") == 0) {
+   opt = argv[i] + sizeof ("--format=") - 1;
+   if (strcmp (opt, "default") == 0) {
+   reply_format_func = notmuch_reply_format_default;
+   } else {
+   fprintf (stderr, "Invalid value for --format: %s\n", opt);
+   return 1;
+   }
+   } else {
+   fprintf (stderr, "Unrecognized option: %s\n", argv[i]);
+   return 1;
+   }
+}
+
+argc -= i;
+argv += i;
+
+config = notmuch_config_open (ctx, NULL, NULL);
+if (config == NULL)
+   return 1;
+
+query_string = query_string_from_args (ctx, argc, argv);
+if (query_string == NULL) {
+   fprintf (stderr, "Out of memory\n");
+   return 1;
+}
+
+if (*query_string == '\0') {
+   fprintf (stderr, "Error: notmuch reply requires at least one search 
term.\n");
+   return 1;
+}
+
+notmuch = notmuch_database_open (notmuch_config_get_database_path (config),
+NOTMUCH_DATABASE_MODE_READ_ONLY);
+if (notmuch == NULL)
+   return 1;
+
+query = notmuch_query_create (notmuch, query_string);
+if (query == NULL) {
+   fprintf (stderr, "Out of memory\n");
+   return 1;
+}
+
+if (reply_format_func (ctx, config, query) != 0)
+   return 1;

 

[notmuch] Notmuch-side support for git send-email --notmuch id:

2009-11-25 Thread Jed Brown
These two patches provide support for features like the one in the
subject line.  Along with these two patches, I have one for git
format-patch (which I will submit upstream soon) that uses the output
from notmuch reply --format=headers-only to build a reply with proper
referencing, To, and Cc fields.

Since options for git send-email are passed to git format-patch,

  git send-email --notmuch id:

is a substitute for

  git send-email --in-reply-to  --to  --cc  --add-header 
'References: ...'




[notmuch] [PATCH 2/2] add some very rudimentary support for handling html parts

2009-11-25 Thread Alexander Botero-Lowry
I was planning to be committing super awesome mime-handling support
that would make notmuch rival every mail program ever for pure mime
awesomeness. It turns out, that mime is confusing and hard, and the
mm-* functions do awesome things like provide different forms based
on the number and composition of mime-parts in a document, so I set
my first-pass goal a bit lower. What this does, is if there is an
html mime-part in the message and it's the first part, it gets inlined
using `mm-display-part'. This should solve the biggest problem I was
facing, which is HTML only messages that I have to go into the awful
mime-mode to view.

This still even leaves in the Non-text part: message and all.
---
 notmuch.el |   41 -
 1 files changed, 32 insertions(+), 9 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 1853762..fa061c3 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -554,29 +554,52 @@ which this thread was originally shown."
 (goto-char end))
   (forward-line

-(defun notmuch-show-markup-part (beg end depth)
+(defun notmuch-show-markup-part (beg end depth mime-message)
   (if (re-search-forward notmuch-show-part-begin-regexp nil t)
   (progn
+(if (eq mime-message nil)
+(let ((filename (notmuch-show-get-filename)))
+  (with-temp-buffer
+(insert-file-contents filename nil nil nil t)
+(setq mime-message (mm-dissect-buffer)
(forward-line)
-   (let ((beg (point-marker)))
+   (let ((part-beg (point-marker)))
  (re-search-forward notmuch-show-part-end-regexp)
- (let ((end (copy-marker (match-beginning 0
-   (goto-char end)
+
+ (let ((part-end (copy-marker (match-beginning 0
+   (goto-char part-end)
(if (not (bolp))
(insert "\n"))
-   (indent-rigidly beg end depth)
-   (notmuch-show-markup-citations-region beg end depth)
+   (indent-rigidly part-beg part-end depth)
+(save-excursion
+  (goto-char part-beg)
+  (forward-line -1)
+  (beginning-of-line)
+  (let ((handle-type (mm-handle-type mime-message))
+mime-type)
+(if (sequencep (car handle-type))
+(setq mime-type (car handle-type))
+  (setq mime-type (car (car (cdr handle-type
+  )
+(if (equal mime-type "text/html")
+(mm-display-part mime-message
+
+   (notmuch-show-markup-citations-region part-beg part-end depth)
; Advance to the next part (if any) (so the outer loop can
; determine whether we've left the current message.
(if (re-search-forward notmuch-show-part-begin-regexp nil t)
(beginning-of-line)
-(goto-char end)))
+(goto-char end))
+  mime-message)

 (defun notmuch-show-markup-parts-region (beg end depth)
   (save-excursion
 (goto-char beg)
-(while (< (point) end)
-  (notmuch-show-markup-part beg end depth
+(let (mime-message)
+  (while (< (point) end)
+(setq mime-message
+  (notmuch-show-markup-part
+   beg end depth mime-message))

 (defun notmuch-show-markup-body (depth btn)
   (re-search-forward notmuch-show-body-begin-regexp)
-- 
1.6.5.2



[notmuch] [PATCH 1/2] add functions to toggle the nearest backwards button of a given type

2009-11-25 Thread Alexander Botero-Lowry
It was noted that though local expansion was nice, it was also pretty
nice to have an easy way to just open the headers without moving to the
header button. So this exposes a number of symbols which search backwards
in the buffer for the nearest button of the desire type and push it
---
 notmuch.el |   33 +
 1 files changed, 33 insertions(+), 0 deletions(-)

diff --git a/notmuch.el b/notmuch.el
index 551048a..1853762 100644
--- a/notmuch.el
+++ b/notmuch.el
@@ -771,6 +771,39 @@ thread from that buffer can be show when done with this 
one)."
   
   )))

+(defun notmuch-toggle-hidden-section (section-button-type) 
+  (save-excursion
+(let ((btn (forward-button -1)))
+  (while btn
+(if (button-has-type-p btn section-button-type)
+(progn (push-button)
+   (setq btn nil))
+  (condition-case err
+  (setq btn (forward-button -1))
+(error (setq btn nil))
+)
+)
+
+(defun notmuch-toggle-hidden-headers ()
+  (interactive)
+  (notmuch-toggle-hidden-section 'notmuch-button-headers-toggle-type)
+)
+
+(defun notmuch-toggle-hidden-body ()
+  (interactive)
+  (notmuch-toggle-hidden-section 'notmuch-button-body-toggle-type)
+)
+
+(defun notmuch-toggle-hidden-citation ()
+  (interactive)
+  (notmuch-toggle-hidden-section 'notmuch-button-citation-toggle-type)
+)
+
+(defun notmuch-toggle-hidden-signature ()
+  (interactive)
+  (notmuch-toggle-hidden-section 'notmuch-button-signature-toggle-type)
+)
+
 (defvar notmuch-search-authors-width 40
   "Number of columns to use to display authors in a notmuch-search buffer.")

-- 
1.6.5.2



[notmuch] vim interface pull request

2009-11-25 Thread Bart Trojanowski
Carl,

as you already know, I've spent some time working on a vim-based
interface to notmuch.  I currently only depend on the 'march:[01]'
patches that we talked about briefly on irc.  Everything else is
isolated to the 'vim' directory and should not effect anyone else.

My efforts are cataloged here:

git://git.jukie.net/notmuch.git (vim branch)
http://git.jukie.net/notmuch.git?a=shortlog;h=refs/heads/vim

Please consider pulling in the vim branch.

-Bart

-- 
WebSig: http://www.jukie.net/~bart/sig/