[notmuch] [PATCH] Make search filters handle disjunctive queries.

2009-12-02 Thread Jan Janak
Jed, On 02-12 14:46, Jed Brown wrote: > On Wed, 2 Dec 2009 14:18:08 +0100, Jan Janak wrote: > > I haven't been really following this thread in detail. What is that you need > > from notmuch-select-tag-with-completion? To be able to process a list of > > tags > > s

[notmuch] [PATCH] Make search filters handle disjunctive queries.

2009-12-02 Thread Jan Janak
On 02-12 11:59, Jed Brown wrote: > A patch for notmuch-search-filter follows, my change to > notmuch-search-filter-by-tag is not very useful since > notmuch-select-tag-with-completion does not allow a space to be > inserted. I don't know how to get completion on multiple > space-separated terms.

Re: [notmuch] [PATCH] Make search filters handle disjunctive queries.

2009-12-02 Thread Jan Janak
Jed, On 02-12 14:46, Jed Brown wrote: On Wed, 2 Dec 2009 14:18:08 +0100, Jan Janak j...@ryngle.com wrote: I haven't been really following this thread in detail. What is that you need from notmuch-select-tag-with-completion? To be able to process a list of tags separated by spaces? Maybe

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

2009-11-27 Thread Jan Janak
On 26-11 22:53, Ingmar Vanhassel wrote: > Excerpts from Michiel Buddingh''s message of Thu Nov 26 22:12:02 +0100 2009: > > Haven't tested it, but it seems you can put > > > > [core] > > whitespace = trailing-space,space-before-tab > > > > into your ~/.gitconfig now. I've also set emacs to

[notmuch] [PATCH 3/3] notmuch.el: Select tag names with completion.

2009-11-27 Thread Jan Janak
Hi Carl, On 26-11 07:15, Carl Worth wrote: > On Mon, 23 Nov 2009 01:10:56 +0100, Jan Janak wrote: > > Several commands ask the user for a tag name. With this feature the > > user can just press tab and Emacs automatically retrieves the list of > > all existing tags

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

2009-11-27 Thread Jan Janak
On 26-11 22:53, Ingmar Vanhassel wrote: Excerpts from Michiel Buddingh''s message of Thu Nov 26 22:12:02 +0100 2009: Haven't tested it, but it seems you can put [core] whitespace = trailing-space,space-before-tab into your ~/.gitconfig now. I've also set emacs to mark trailing

[notmuch] [PATCH] Makefile: Enable backslash escapes for echo.

2009-11-26 Thread Jan Janak
Hi Stefan, On 26-11 09:17, Stefan Schmidt wrote: > This fixes a visual glitch during a silent compile. > Before: > Use "make V=1" to see the verbose compile lines.\n CC debugger.o > CCgmime-filter-reply.o > > After: > Use "make V=1" to see the verbose compile lines. > CCdebugger.o

[notmuch] [PATCH 0/4] Make tags applied by 'notmuch new' configurable.

2009-11-26 Thread Jan Janak
Hello, On 24-11 23:10, Jan Janak wrote: > I would like to propose that we make the list of tags applied by 'notmuch new' > configurable. Right now notmuch applies two tags to all new messages added to > the database, 'inbox' and 'unread'. The two tags are added by the C code in > n

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

2009-11-26 Thread Jan Janak
. Bugfix: Fix parsing of --verbose cmdline option. This is a revised version of the patch, incorporating suggestions made by Bart Trojanowski. Thanks Bart! Signed-off-by: Jan Janak --- notmuch-new.c | 21 - notmuch.c | 13 +++-- 2 files changed, 23 insertions(+), 11

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

2009-11-26 Thread Jan Janak
Trojanowski. Signed-off-by: Jan Janak --- notmuch-new.c | 40 ++-- notmuch.c |8 +++- 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/notmuch-new.c b/notmuch-new.c index af717b7..cfbc6aa 100644 --- a/notmuch-new.c +++ b/notmuch-new.c

[notmuch] [PATCH 3/5] notmuch-setup: Copy/create the new section with tags for 'notmuch-new'.

2009-11-26 Thread Jan Janak
suggestions from Bart Trojanowski. Signed-off-by: Jan Janak --- notmuch-client.h |4 notmuch-config.c | 40 notmuch-setup.c | 18 ++ 3 files changed, 58 insertions(+), 4 deletions(-) diff --git a/notmuch-client.h b/notmuch-client.h

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

2009-11-26 Thread Jan Janak
. 'notmuch new' is modified not to apply 'inbox' and 'unread' by default, but instead it obtains the set of tags to be applied from the new configuration file option. Signed-off-by: Jan Janak This revision of the patch includes suggestions from Bart Trojanowski. --- notmuch-client.h |3

[notmuch] [PATCH 1/5] notmuch-new: Remove tag_add_inbox_unread in favor of a generic solution.

2009-11-26 Thread Jan Janak
-off-by: Jan Janak --- notmuch-new.c |8 1 files changed, 0 insertions(+), 8 deletions(-) diff --git a/notmuch-new.c b/notmuch-new.c index e32b92a..9970407 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -41,13 +41,6 @@ handle_sigint (unused (int sig)) } static void

[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

[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

[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

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

2009-11-25 Thread Jan Janak
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 n

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

2009-11-25 Thread Jan Janak
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 n

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

2009-11-25 Thread Jan Janak
. 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] [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

[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

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

2009-11-25 Thread Jan Janak
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] [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

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

2009-11-24 Thread Jan Janak
them all with: notmuch new --tag=prehistory Tags to be applied every time 'notmuch new' is run can be specified in the configuration file. One-time tags for individual runs can be specified on the command line with this new option. Signed-off-by: Jan Janak --- notmuch-new.c | 40

[notmuch] [PATCH 3/4] notmuch-setup: Copy/create the new section with tags for 'notmuch-new'.

2009-11-24 Thread Jan Janak
would also have no tags in the section [new]. We never ask the user interactively for the list of tags to be used by 'notmuch new', it is assumed that beginners would want to stick to the defaults and advanced users can edit the configuration manually. Signed-off-by: Jan Janak --- notmuch

[notmuch] [PATCH 1/4] notmuch-new: Remove tag_add_inbox_unread in favor of a generic solution.

2009-11-24 Thread Jan Janak
-off-by: Jan Janak --- notmuch-new.c |8 1 files changed, 0 insertions(+), 8 deletions(-) diff --git a/notmuch-new.c b/notmuch-new.c index e32b92a..9970407 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -41,13 +41,6 @@ handle_sigint (unused (int sig)) } static void

[notmuch] [PATCH 0/4] Make tags applied by 'notmuch new' configurable.

2009-11-24 Thread Jan Janak
I would like to propose that we make the list of tags applied by 'notmuch new' configurable. Right now notmuch applies two tags to all new messages added to the database, 'inbox' and 'unread'. The two tags are added by the C code in notmuch-new.c and they cannot be changed without editing the

[notmuch] notmuch 'index' mode.

2009-11-24 Thread Jan Janak
On 24-11 08:38, Keith Packard wrote: > On Tue, 24 Nov 2009 13:14:07 +0100, Jan Janak wrote: > > > I like this. I think this is much cleaner than the "virtual tag" > > approach. > > A disadvantage I see is that you would not see this 'virtual tags' in > the

[notmuch] notmuch 'index' mode.

2009-11-24 Thread Jan Janak
On Tue, Nov 24, 2009 at 4:16 AM, Carl Worth wrote: > And notice, I don't think we'll need to do the "virtual tag" thing of > associating a tag name with a search and doing the work of making > notmuch maintain the consistency of that tag and search string. It will > be much more clean (and

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

2009-11-24 Thread Jan Janak
On Mon, Nov 23, 2009 at 5:55 AM, Carl Worth wrote: > On Sun, 22 Nov 2009 18:14:20 -0500, Jameson Graef Rollins finestructure.net> wrote: >> I think Carl said he wanted to keep the ability to specify exactly >> where the database is stored, so if we could move away from something >> that makes

[notmuch] [PATCH] makefile: Tell echo to interpret escape sequences.

2009-11-23 Thread Jan Janak
On Mon, Nov 23, 2009 at 3:41 AM, Carl Worth wrote: > On Sun, 22 Nov 2009 13:44:37 +0100, Jan Janak wrote: >> The initial message that informs the user about the possibility to use >> make V=1 contains a \n at the end, but echo wouldn't interpret that >> properly withou

[notmuch] [PATCH] notmuch-new: Eliminate gcc warning caused by ino_cmp.

2009-11-23 Thread Jan Janak
On Mon, Nov 23, 2009 at 3:38 AM, Carl Worth wrote: > On Sun, 22 Nov 2009 13:32:36 +0100, Jan Janak wrote: >> The function passed to scandir in the fourth argument takes two >> const void* arguments. To eliminate the gcc warning about incompatible >> types, we ch

[notmuch] search-tags and tag completion in notmuch.el

2009-11-23 Thread Jan Janak
Hello, The three patches I sent to the list a couple of minutes ago is another revision of the patches that I had sent earlier. The first two patches implement support for 'notmuch search-tags'. The last patch adds support for tag completion to notmuch.el using the new command. Right now

[notmuch] [PATCH 3/3] notmuch.el: Select tag names with completion.

2009-11-23 Thread Jan Janak
a large number of tags because it saves typing and minimizes the risk of typos. Signed-off-by: Jan Janak --- notmuch.el | 22 +- 1 files changed, 17 insertions(+), 5 deletions(-) diff --git a/notmuch.el b/notmuch.el index 5927737..b6be395 100644 --- a/notmuch.el +++ b

[notmuch] [PATCH 2/3] notmuch: New command 'search-tags'.

2009-11-23 Thread Jan Janak
This is a new notmuch command that can be used to search for all tags found in the database. The resulting list is alphabetically sorted. The primary use-case for this new command is to provide the tag completion feature in Emacs (and other interfaces). Signed-off-by: Jan Janak

[notmuch] [PATCH 1/3] notmuch: New function to retrieve all tags from the database.

2009-11-23 Thread Jan Janak
_all_tags is exported through lib/notmuch.h Signed-off-by: Jan Janak --- lib/database-private.h | 13 + lib/database.cc| 43 +++ lib/message.cc | 34 +++--- lib/notmuch.h | 10 ++

[notmuch] [PATCH] makefile: Declare clean target as phony.

2009-11-22 Thread Jan Janak
This ensures that make clean always proceeds, even if the user accidentally creates a file named 'clean'. Also, it ignores errors in rm and other commands. Signed-off-by: Jan Janak --- Makefile |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/Makefile b/Makefile index

[notmuch] [PATCH] makefile: Tell echo to interpret escape sequences.

2009-11-22 Thread Jan Janak
The initial message that informs the user about the possibility to use make V=1 contains a \n at the end, but echo wouldn't interpret that properly without the -e command line option. --- Makefile |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/Makefile b/Makefile index

[notmuch] [PATCH] notmuch-new: Eliminate gcc warning caused by ino_cmp.

2009-11-22 Thread Jan Janak
The function passed to scandir in the fourth argument takes two const void* arguments. To eliminate the gcc warning about incompatible types, we change ino_cmp to match this and then re-type the parameters in the body of ino_cmp. Signed-off-by: Jan Janak --- notmuch-new.c |5 +++-- 1 files

[notmuch] [PATCH] notmuch new: Support for conversion of spool subdirectories into tags

2009-11-22 Thread Jan Janak
On Sat, Nov 21, 2009 at 7:44 PM, Carl Worth wrote: > On Wed, 18 Nov 2009 05:57:03 +0100, Jan Janak wrote: >> This patch makes it possible to convert subdirectory names inside the >> spool directory into message tags. Messages stored in subdirectory >> "foo" will be

[notmuch] Asynchronous tagging

2009-11-21 Thread Jan Janak
On Sat, Nov 21, 2009 at 10:04 PM, Jed Brown wrote: >> ?3) Message flags are updated on the IMAP server (for example when you >> mark a message as read in gmail). Offlineimap keeps message flags >> synchronized. ?If you mark a local message as read then the change is >> propagated to the IMAP

[notmuch] [PATCH 2/2] notmuch list: A new command to produce various lists.

2009-11-21 Thread Jan Janak
On Thu, Nov 19, 2009 at 3:41 PM, Carl Worth wrote: > On Thu, 19 Nov 2009 12:52:49 +0100, Jan Janak wrote: >> I implemented a new notmuch command that can be used to list all tags >> present in the database: > > Ah, very very interesting! I'd been planning on doing somet

[notmuch] Asynchronous tagging

2009-11-21 Thread Jan Janak
On Sat, Nov 21, 2009 at 9:01 PM, Carl Worth wrote: >> 3. I had initially put 'notmuch new' in a cron job (instead of >> offlineimap postsync hook) and new/search would sometimes complain about >> missing files in the maildir. ?The first time this happened, it did not >> correct itself and I ended

[notmuch] Recommended Coding Style?

2009-11-20 Thread Jan Janak
Hi Guys, Is there any recommended coding style for the C/C++ code in notmuch? -- Jan

[notmuch] Segfault searching for tags

2009-11-20 Thread Jan Janak
On Fri, Nov 20, 2009 at 2:10 PM, Jeffrey Ollie wrote: > On Fri, Nov 20, 2009 at 5:32 AM, Carl Worth wrote: >> On Thu, 19 Nov 2009 16:45:43 +0100, Adrian Perez de Castro > igalia.com> wrote: >>> The thing is that in notmuch_message_get_in_reply_to(), line 288, a NULL >>> instance of

[notmuch] [PATCH 2/2] notmuch list: A new command to produce various lists.

2009-11-19 Thread Jan Janak
On Thu, Nov 19, 2009 at 3:41 PM, Carl Worth wrote: > On Thu, 19 Nov 2009 12:52:49 +0100, Jan Janak wrote: >> I implemented a new notmuch command that can be used to list all tags >> present in the database: > > Ah, very very interesting! I'd been planning on doing somet

[notmuch] [PATCH] notmuch.el: Completion for tag names.

2009-11-19 Thread Jan Janak
-off-by: Jan Janak --- notmuch.el | 22 +- 1 files changed, 17 insertions(+), 5 deletions(-) diff --git a/notmuch.el b/notmuch.el index 706e9f3..587e093 100644 --- a/notmuch.el +++ b/notmuch.el @@ -165,7 +165,8 @@ Unlike builtin `next-line' this version accepts no arguments

[notmuch] [PATCH 2/2] notmuch list: A new command to produce various lists.

2009-11-19 Thread Jan Janak
. -- Jan On Thu, Nov 19, 2009 at 12:34 PM, Jan Janak wrote: > Here we create a new notmuch command called list. The purpose of the > command is to produce various lists from the notmuch database. > > At the moment we support only one command, notmuch list tags. This > command creates a l

[notmuch] [PATCH 2/2] notmuch list: A new command to produce various lists.

2009-11-19 Thread Jan Janak
Here we create a new notmuch command called list. The purpose of the command is to produce various lists from the notmuch database. At the moment we support only one command, notmuch list tags. This command creates a list of all tags found in the database. Signed-off-by: Jan Janak

[notmuch] [PATCH 1/2] notmuch: Support for notmuch_database_get_tags

2009-11-19 Thread Jan Janak
->doc.termlist_begin() as argument. Similarly, we implement notmuch_message_database_tags, the function calls the generic function with db->xapian_db->allterms_begin() as argument. Finally, notmuch_database_get_tags is exported through lib/notmuch.h Signed-off-by: Jan Janak --- lib/database.

[notmuch] [PATCH] Makefile: Make object targets depend on Makefiles

2009-11-19 Thread Jan Janak
All objects need to be recompiled when any of the Makefiles changes, so we make them all depend on all the Makefiles. Signed-off-by: Jan Janak --- Makefile | 11 +++ 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 96aaa73..2787aff 100644

[notmuch] Why is no. of files from count_files reset to 0?

2009-11-18 Thread Jan Janak
Hello, The function count_file returns the total number of files to be processed, the result is then stored in add_files_state.total_files. But that variable is reset back to 0 in notmuch_new_command. When I comment out the following line (before add_files is called):

[notmuch] [PATCH] notmuch new: Support for conversion of spool subdirectories into tags

2009-11-18 Thread Jan Janak
adds it as a new tag to the message. Signed-off-by: Jan Janak --- lib/database.cc |3 +- notmuch-new.c | 74 +- 2 files changed, 74 insertions(+), 3 deletions(-) diff --git a/lib/database.cc b/lib/database.cc index 3c8d626..f779

[notmuch] What a great idea!

2009-11-17 Thread Jan Janak
On Tue, Nov 17, 2009 at 11:35 PM, Jan Janak wrote: > Hello, > > First of all, notmuch is a wonderful idea, both the cmdline tool and > the emacs interface! Thanks a lot for writing it, I was really excited > when I read the announcement today. > > Have you considered se

[notmuch] What a great idea!

2009-11-17 Thread Jan Janak
Hello, First of all, notmuch is a wonderful idea, both the cmdline tool and the emacs interface! Thanks a lot for writing it, I was really excited when I read the announcement today. Have you considered sending an announcement to the org-mode mailing list? http://org-mode.org Various ways of

[notmuch] [PATCH] Older versions of install do not support -C.

2009-11-17 Thread Jan Janak
Do not use -C cmdline option of install, older versions, commonly found in distributions like Debian, do not seem to support it. Running make install on such systems (tested on Debian Lenny) fails. Signed-off-by: Jan Janak --- Makefile.local |8 1 files changed, 4 insertions(+), 4