aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch.c
Commit message (Collapse)AuthorAge
* Add notmuch_status_to_string function.Gravatar Carl Worth2009-10-21
| | | | | Be kind and let the user print error messages, not just error codes.
* Implement "notmuch restore".Gravatar Carl Worth2009-10-21
| | | | | | It's pretty easy to do with all the right infrastructure in place. Now that I can get my tags from sup to notmuch, maybe I'll be able to start reading mail again.
* Pull out a chomp_newline function from "notmuch setup"Gravatar Carl Worth2009-10-21
| | | | | We'll want this same thing with "notmuch restore", (and really anything using getline).
* notmuch dump: Fix to print spaces between tags.Gravatar Carl Worth2009-10-21
| | | | Simple little bug here made all the tags run together.
* notmuch dump: Fix buffer overrun in error message.Gravatar Carl Worth2009-10-21
| | | | Just a little bug I noticed while editing nearby code.
* notmuch setup: Print a few protecting spaces after progress reports.Gravatar Carl Worth2009-10-21
| | | | | | | | | | This is to help keep the report looking clean when a new report is shorter than a previous reports, (say, when crossing the boundary from over one minute remaining to less than one minute remaining). This used to be here, but I must have accidentally dropped it when reformatting the progress report recently.
* query: Remove the magic NOTMUCH_QUERY_ALLGravatar Carl Worth2009-10-20
| | | | | | | 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.
* notmuch dump: Free each message as it's used.Gravatar Carl Worth2009-10-20
| | | | | | | | | | | | Previously we were leaking[*] memory in that the memory footprint of a "notmuch dump" run would continue to grow until the output was complete, and then finally all the memory would be freed. Now, the memory footprint is small and constant, O(1) rather than O(n) in the number of messages. [*] Not leaking in a valgrind sense---every byte was still carefully being accounted for and freed eventually.
* Implement 'notmuch dump'.Gravatar Carl Worth2009-10-20
| | | | | | | | | | | | | | | | 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").
* notmuch: Fix setup so that accepting the default mail path works.Gravatar Carl Worth2009-10-20
| | | | | | The recent change from GIOChannel to getline, (with a semantic change of the newline terminator now being included in the result that setup_command sees), broke this.
* notmuch: Use GNU libc getline() instead of glib GIOChannelGravatar Carl Worth2009-10-20
| | | | | Less reliance on glib is always nice for our memory-leak testing efforts.
* Add some explanation about NOTMUCH_BASE to setup_command.Gravatar Carl Worth2009-10-20
| | | | | | | Since we allow the user to enter a custom directory, we need to let the user know how to make this persistent. Of course, a better answer would be to take what the user entered and shove it into a ~/.notmuch-config file or so, but for now this will have to do.
* notmuch_database_create/open: Fix to handle NULL as documented.Gravatar Carl Worth2009-10-20
| | | | | | | | | | | 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
* notmuch: Revamp help message a bit.Gravatar Carl Worth2009-10-19
| | | | | | The big update here is the addition of the dump and restore commands which are next on my list. Also, I've now come up with a syntax for documenting the arguments of sub-commands.
* notmuch: Ignore files that don't look like email messages.Gravatar Carl Worth2009-10-19
| | | | | | | 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).
* notmuch: Reword the progress report slightly.Gravatar Carl Worth2009-10-19
| | | | | | I noticed this style during a recent Debian install and I liked how much less busy it is compared to what we had before, (while still telling the user everything she might want).
* Document which pieces of glib we're still using.Gravatar Carl Worth2009-10-19
| | | | | | | | Looks like we can copy in a hash-table implementation, (from cairo, say), and then a few _ascii_ functions from glib, (we'll need to switch a few current uses if things like isspace, etc. to locale- independent versions as well). So not too hard to free ourselves of glib for now, (until we add GMime back in later, of course).
* notmuch: Ignore .notmuch when counting files.Gravatar Carl Worth2009-10-19
| | | | | | We were correctly ignoring this when adding files, but not when doing the initial count. Clearly we need better code sharing here.
* notmuch: Start actually adding messages to the index.Gravatar Carl Worth2009-10-18
| | | | | | | | | | | | | | | | | | | | | | 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.
* Start a new top-level executable: notmuch.Gravatar Carl Worth2009-10-17
Of course, there's not much that this program does yet. It's got some structure for some sub-commands that don't do anything. And it has a main command that prints some explanatory text and then counts all the regular files in your mail archive.