Jan Janak [Wed, 25 Nov 2009 21:11:45 +0000 (22:11 +0100)]
notmuch-new: Test if directory looks like Maildir before skipping tmp.
'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'.
notmuch-new: Fix notmuch new to look at files within symbolic links
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
Bart Trojanowski [Wed, 25 Nov 2009 04:54:35 +0000 (23:54 -0500)]
notmuch-show: identify which messages printed matched the query string
The show command outputs all messages in the threads that match the
search-terms. This patch introduces a 'match:[01]' entry to the 'message{'
line output by the show command. Value of 1 indicates that the message is
matching the search expression.
Bart Trojanowski [Wed, 25 Nov 2009 04:54:34 +0000 (23:54 -0500)]
have _notmuch_thread_create mark which messages matched the query
When _notmuch_thread_create() is given a query string, it can return more
messages than just those matching the query. To distinguish those that
matched the query expression, the MATCHING_SEARCH flag is set
appropriately.
Bart Trojanowski [Wed, 25 Nov 2009 04:54:33 +0000 (23:54 -0500)]
message: add flags to notmuch_message_t
This patch allows for different flags, internal to notmuch, to be set on a
message object. The patch does not define any such flags, just the
facilities to manage these flags.
Jed Brown [Wed, 25 Nov 2009 01:35:13 +0000 (02:35 +0100)]
notmuch-reply.c: accept the --format=default default option.
This factors actual generation of the reply out of notmuch_reply_command
into notmuch_reply_format_default(), in preparation for other --format=
options.
Bart Trojanowski [Fri, 27 Nov 2009 23:02:05 +0000 (18:02 -0500)]
vim: use <Space> more consistently in search view
In search view <Space> will show the thead, but folding messages that
don't match the current search expression. Conversly, <Enter> always
shows all messages in the thread.
Jed Brown [Thu, 26 Nov 2009 21:36:50 +0000 (22:36 +0100)]
notmuch-search-add/remove-tag: restrict to messages in current query
Rather than tagging the everything in the thread. This is arguably more
desirable behavior and is consistent with clearly desirably behavior of
notmuch-search-operate-all.
Note that this change applies indirectly to
notmuch-search-archive-thread (which is actually equivalent behavior
since this function is primarily used when browsing an inbox).
Jed Brown [Thu, 26 Nov 2009 21:36:49 +0000 (22:36 +0100)]
New function notmuch-search-operate-all: operate on all messages in the current query.
It is often convenient to change tags on several messages at once. This
function applies any number of tag whitespace-delimited tag
modifications to all messages matching the current query.
notmuch.el: Use variable notmuch-search-oldest-first to decide the search order
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
Jan Janak [Wed, 25 Nov 2009 03:30:22 +0000 (04:30 +0100)]
search-tags: Add support for search-terms.
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).
Jan Janak [Wed, 25 Nov 2009 03:30:21 +0000 (04:30 +0100)]
lib: New function to collect tags from a list of messages.
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.
Jan Janak [Mon, 23 Nov 2009 00:10:56 +0000 (01:10 +0100)]
notmuch.el: Select tag names with completion.
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 from notmuch database with 'notmuch search-tags' and
presents a completion buffer to the user.
This feature is very useful for users who have a large number of tags
because it saves typing and minimizes the risk of typos.
Jan Janak [Mon, 23 Nov 2009 00:10:54 +0000 (01:10 +0100)]
notmuch: New function to retrieve all tags from the database.
This patch adds a new function called notmuch_database_get_all_tags
which can be used to obtain a list of all tags from the database
(in other words, the list contains all tags from all messages). The
function produces an alphabetically sorted list.
To add support for the new function, we rip the guts off of
notmuch_message_get_tags and put them in a new generic function
called _notmuch_convert_tags. The generic function takes a
Xapian::TermIterator as argument and uses the iterator to find tags.
This makes the function usable with different Xapian objects.
Function notmuch_message_get_tags is then reimplemented to call the
generic function with message->doc.termlist_begin() as argument.
Similarly, we implement notmuch_message_database_get_all_tags, the
function calls the generic function with db->xapian_db->allterms_begin()
as argument.
Finally, notmuch_database_get_all_tags is exported through
lib/notmuch.h
modify notmuch_setup_command to return 1 if config file write fails.
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.