aboutsummaryrefslogtreecommitdiff
path: root/notmuch.h
AgeCommit message (Collapse)Author
2009-11-09libify: Move library sources down into lib directory.Carl Worth
A "make" invocation still works from the top-level, but not from down inside the lib directory yet.
2009-11-02Remove notmuch_message_get_header_size and notmuch_message_get_all_headersCarl Worth
The notmuch.c main program now uses GMime directly rather than using these functions, and I'd rather not export any functions unless we have good evidence that the functions are necessary.
2009-10-31Rename message_results/thread_results to messages/threads.Carl Worth
Shorter naming without being any less clear. A definite win.
2009-10-29notmuch search: Add (relative) date to search outputCarl Worth
The new function for formatting relative dates is nice enough that we need to start using it more places. Here's one of them.
2009-10-29notmuch show: Add a one-line summary of the message before the header.Carl Worth
The idea here is that a client could usefully display just this one line while optionally hiding the other header fields.
2009-10-29notmuch show: Add body of message as well.Carl Worth
This is just the raw message body for now, (so any MIME parsing will be up to the consumer). And this will likely change in the future.
2009-10-29notmuch show: Initial implementation (headers only)Carl Worth
We're using a delimiter syntax that Keith is optimistic about being able to easily parse in emacs. Note: We're not escaping any occurrence of the delimiters in the message yet, so we'll need to fix that.
2009-10-28Fix add_message and get_filename to strip/re-add the database path.Carl Worth
We now store only a relative path inside the database so the database is not nicely relocatable.
2009-10-27notmuch_database_add_message: Do not return a message on failure.Carl Worth
The recent, disastrous failure of "notmuch new" would have been avoided with this change. The new_command function was basically assuming that it would only get a message object on success so wasn't destroying the message in the other cases.
2009-10-26notmuch restore: Fix to remove all tags before adding tags.Carl Worth
This means that the restore operation will now properly pick up the removal of tags indicated by the tag just not being present in the dump file. We added a few new public functions in order to support this: notmuch_message_freeze notmuch_message_remove_all_tags notmuch_message_thaw
2009-10-26add_message: Add an optional parameter for getting the just-added message.Carl Worth
We use this to implement the addition of "inbox" and "unread" tags for all messages added by "notmuch new".
2009-10-26Add public notmuch_thread_get_subjectCarl Worth
And use this in "notmuch search" to display subject line as well as thread ID.
2009-10-26Add notmuch_thread_get_tagsCarl Worth
And augment "notmuch search" to print tag values as well as thread ID values. This tool is almost usable now.
2009-10-25Add an initial implementation of a notmuch_thread_t object.Carl Worth
We've now got a new notmuch_query_search_threads and a notmuch_threads_result_t iterator. The thread object itself doesn't do much yet, (just allows one to get the thread_id), but that's at least enough to see that "notmuch search" is actually doing something now, (since it has been converted to print thread IDs instead of message IDs). And maybe that's all we need. Getting the messages belonging to a thread is as simple as a notmuch_query_search_messages with a string of "thread:<thread-id>". Though it would be convenient to add notmuch_thread_get_messages which could use the existing notmuch_message_results_t iterator. Now we just need an implementation of "notmuch show" and we'll have something somewhat usable.
2009-10-25Rename notmuch_query_search to notmuch_query_search_messagesCarl Worth
Along with renaming notmuch_results_t to notmuch_message_results_t. The new type is quite a mouthful, but I don't expect it to be used much other than the for-loop idiom in the documentation, (which does at least fit nicely within 80 columns). This is all in preparation for the addition of a new notmuch_query_search_threads of course.
2009-10-25Change database to store only a single thread ID per message.Carl Worth
Instead of supporting multiple thread IDs, we now merge together thread IDs if one message is ever found to belong to more than one thread. This allows for constructing complete threads when, for example, a child message doesn't include a complete list of References headers back to the beginning of the thread. It also simplifies dealing with mapping a message ID to a thread ID which is now a simple get_thread_id just like get_message_id, (and no longer an iterator-based thing like get_tags).
2009-10-25add_message: Propagate error status from notmuch_message_create_for_message_idCarl Worth
What a great feeling to remove an XXX comment.
2009-10-24notmuch_database_create: Document idea to (optionally) return a statusCarl Worth
The current problem is that when this function fails the caller doesn't get any information about what the particular failure was, (something in the filesystem? or in Xapian?). We should fix that.
2009-10-23Re-order documentation a bit.Carl Worth
The notmuch_database_get_default_path function is unique in not accepting a notmuch_database_t* (nor creating one). So list it outside the other notmuch_database functions.
2009-10-23notmuch_message_get_filename: Improve documentation.Carl Worth
Fix a typo, and add clarifications about the lifetime and readonly nature of the return value.
2009-10-23Add NOTMUCH_STATUS_DUPLICATE_MESSAGE_IDCarl Worth
And document that notmuch_database_add_message can return this value. This pushes the hard decision of what to do with duplicate messages out to the user, but that's OK. (We weren't really doing anything with these ourselves, and this way the user is at least informed of the issue, rather than it just getting papered over internally.)
2009-10-23Clean up comments to not include spaces before tabs.Carl Worth
This were just unclean, (an invisble sort of uncleanliness, but still there are liable to make for ugly diffs). Oh, wait, like this one! But at least it's not sprinkled among code changes.
2009-10-23Clarify documentation and error string for NOTMUCH_STATUS_TAG_TOO_LONGCarl Worth
It's helpful to point out NOTMUCH_STATUS_TAG_MAX for users.
2009-10-23Add notmuch_database_set_timestamp and notmuch_database_get_timestampCarl Worth
These will be very helpful to implement an efficient "notmuch new" command which imports new mail messages that have appeared.
2009-10-23Fix notmuch_message_get_message_id to never return NULL.Carl Worth
With the recent improvements to the handling of message IDs we "know" that a NULL message ID is impossible, (so we simply abort if the impossible happens).
2009-10-23Add notmuch_message_get_filenameCarl Worth
This is a new public function to find the filename of the original email message for a message-object that was found in the database. We may change this function in the future to support returning a list of filenames, (for messages with duplicate message IDs).
2009-10-22Generate message ID (using SHA1) when a mail message contains none.Carl Worth
This is important as we're using the message ID as the unique key in our database. So previously, all messages with no message ID would be treated as the same message---not good at all.
2009-10-21Add notmuch_status_to_string function.Carl Worth
Be kind and let the user print error messages, not just error codes.
2009-10-21Add notmuch_message_add_tag and notmuch_message_remove_tagCarl Worth
With these two added, we now have enough functionality in the library to implement "notmuch restore".
2009-10-21notmuch_query_search: Clarify the documentation.Carl Worth
This is where we wanted to put the note to recommend the user call notmuch_message_destroy if the lifetime of the message is much shorter than the lifetime of the query. (Somehow this had ended up in the documentation of notmuch_message_get_tags before.)
2009-10-21notmuch.h: Fix some copy-paste errors in the documentaton.Carl Worth
In several places we had "results" where "tags" was intended. It actually read fine in some cases, but this is still better.
2009-10-21database: Add new notmuch_database_find_messageCarl Worth
With this function, and the recently added support for notmuch_message_get_thread_ids, we now recode the find_thread_ids function to work just the way we expect a user of the public notmuch API to work. Not too bad really.
2009-10-21Add notmuch_message_get_thread_ids functionCarl Worth
Along with all of the notmuch_thread_ids_t iterator functions. Using a consistent idiom seems better here rather than returning a comma-separated string and forcing the user to parse it.
2009-10-20query: Remove the magic NOTMUCH_QUERY_ALLCarl Worth
Using the address of a static char* was clever, but really unnecessary. An empty string is much less magic, and even easier to understand as the way to query everything from the database.
2009-10-20Add destroy functions for results, message, and tags.Carl Worth
None of these are strictly necessary, (everything was leak-free without them), but notmuch_message_destroy can actually be useful for when one query has many message results, but only one is needed to be live at a time. The destroy functions for results and tags are fairly gratuitous, as there's unlikely to be any benefit from calling them. But they're all easy to add, (all of these functions are just wrappers for talloc_free), and we do so for consistency and completeness.
2009-10-20Implement 'notmuch dump'.Carl Worth
This is a fairly big milestone for notmuch. It's our first command to do anything besides building the index, so it proves we can actually read valid results out from the index. It also puts in place almost all of the API and infrastructure we will need to allow searching of the database. Finally, with this change we are now using talloc inside of notmuch which is truly a delight to use. And now that I figured out how to use C++ objects with talloc allocation, (it requires grotty parts of C++ such as "placement new" and "explicit destructors"), we are valgrind-clean for "notmuch dump", (as in "no leaks are possible").
2009-10-20notmuch_database_create/open: Fix to handle NULL as documented.Carl Worth
When documenting these functions I described support for a NOTMUCH_BASE environment variable to be consulted in the case of a NULL path. Only, I had forgotten to actually write the code. This code exists now, with a new, exported function: notmuch_database_default_path
2009-10-19notmuch: Ignore files that don't look like email messages.Carl Worth
This is helpful for things like indexes that other mail programs may have left around. It also means we can make the initial instructions much easier, (the user need not worry about moving away auxiliary files from some other email program).
2009-10-18notmuch: Start actually adding messages to the index.Carl Worth
This is the beginning of the notmuch library as well, with its interface in notmuch.h. So far we've got create, open, close, and add_message (all with a notmuch_database prefix). The current add_message function has already been whittled down from what we have in notmuch-index-message to add only references, message-id, and thread-id to the index, (that is---just enough to do thread-linkage but nothing for full-text searching). The concept here is to do something quickly so that the user can get some data into notmuch and start using it. (The most interesting stuff is then thread-linkage and labels like inbox and unread.) We can defer the full-text indexing of the body of the messages for later, (such as in the background while the user is reading mail). The initial thread-stitching step is still slower than I would like. We may have to stop using libgmime for this step as its overhead is not worth it for the simple case of just parsing the message-id, references, and in-reply-to headers.