aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch.c
Commit message (Collapse)AuthorAge
...
* notmuch show: Use GMime to decode messages.Gravatar Carl Worth2009-11-02
| | | | We now actually get text content rather than blocks of BASE64, etc.
* Add a simple manual page for notmuch.Gravatar Carl Worth2009-11-02
| | | | | By pulling content out of notmuch help, and also the messages printed by "notmuch setup".
* notmuch: Add a talloc context argument to each top-level command function.Gravatar Carl Worth2009-10-31
| | | | | | | I had noticed several times earlier that having a talloc context passed in would make things more convenient. I'm not exercising that convenience yet, but the context is there now, (and there's one fewer item on our TODO list).
* Rename message_results/thread_results to messages/threads.Gravatar Carl Worth2009-10-31
| | | | Shorter naming without being any less clear. A definite win.
* notmuch: Reference help, don't print it for unknown commands.Gravatar Carl Worth2009-10-31
| | | | | The shorter output is much nicer for something that might end up in an emacs mini-buffer, for example.
* Fix relative date formatting to not split one day into two formats.Gravatar Carl Worth2009-10-29
| | | | | | | | | | | | | We were aware of this bug when we wrote the function, (that a date six days in the past would be treated as the "Friday" or as the "Oct. 23" case depending on whether its time was before or after the current time today). We thought it wouldn't be a problem, but in practice it is. In scanning search results with this output, the transition between formats makes it look like a day boundary, (so it would be easy to mistakenly think "Oct. 23" is Thursday). Fix this to avoid confusion, (still being careful to never print "Thursday" for a date 7 days in the past when today is Thursday).
* notmuch search: Add (relative) date to search outputGravatar Carl Worth2009-10-29
| | | | | The new function for formatting relative dates is nice enough that we need to start using it more places. Here's one of them.
* notmuch show: Add a one-line summary of the message before the header.Gravatar Carl Worth2009-10-29
| | | | | The idea here is that a client could usefully display just this one line while optionally hiding the other header fields.
* notmuch show: Trim down header list.Gravatar Carl Worth2009-10-29
| | | | | This is for now a non-configurable list of Subject, From, To, Cc, Bcc, and Date.
* notmuch show: Add body of message as well.Gravatar Carl Worth2009-10-29
| | | | | 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.
* notmuch show: Initial implementation (headers only)Gravatar Carl Worth2009-10-29
| | | | | | | 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.
* Fix add_message and get_filename to strip/re-add the database path.Gravatar Carl Worth2009-10-28
| | | | | We now store only a relative path inside the database so the database is not nicely relocatable.
* notmuch setup/new: Print progress once per second instead of after 1000 files.Gravatar Carl Worth2009-10-28
| | | | | | With the recent addition of full-text indexing, printing only once per 1000 files just isn't often enough. The new timer-based approach will be reliable regardless of the speed of adding message.
* notmuch search: Clarify documentation of implicit Boolean operatorsGravatar Carl Worth2009-10-28
| | | | | | | | | The original documentation of implicit AND is what we want, but Xapian doesn't actually let us get that today. So be honest about what the user can actually expect. And let's hope the Xapian wizards give us the feature we want soon: http://trac.xapian.org/ticket/402
* notmuch help: Review and augment all of the "notmuch help" documentation.Gravatar Carl Worth2009-10-28
| | | | | | The big addition here is the first description of the syntax for the query strings for "notmuch search", (and, by reference, for "notmuch tag").
* notmuch help: Be less verbose by default and support detailed helpGravatar Carl Worth2009-10-28
| | | | | | | | | | | Putting all of our documentation into a single help message was getting a bit unwieldy. Now, the simple output of "notmuch help" is a reasonable reminder and a quick reference. Then we now support a new syntax of: "notmuch help <command>" for the more detailed help messages. This gives us freedom to put more detailed caveats, etc. into some sub-commands without worrying about the usage statement getting too long.
* Add new "notmuch tag" command for adding/removing tags.Gravatar Carl Worth2009-10-27
| | | | | | | | | | This uses the same search functionality as "notmuch search" so it should be quite powerful. And this global search might be quick enough to be used for "automatic" adding of tags to new messages. Of course, this will all be a lot more useful when we can search for actual text of messages and not just tags.
* Merge branch to fix broken "notmuch setup" and "notmuch new"Gravatar Carl Worth2009-10-27
|\ | | | | | | | | | | | | I'm trying to stick to a habit of fixing previously-introduced bugs on side branches off of the commit that introduced the bug. The idea here is to make it easy to find the commits to cherry pick if bisecting in the future lands on one of the broken commits.
| * Fix "notmuch new" (bad performance, and no committing of results).Gravatar Carl Worth2009-10-27
| | | | | | | | | | | | | | | | | | | | | | | | | | We were incorrectly only destroying messages in the case of successful addition to the database, and not in other cases, (such as failure due to FILE_NOT_EMAIL). I'm still not entirely sure why this was performing abysmally, (as in making an operation that should take a small fraction of a second take 10 seconds), nor why it was causing the database to entirely fail to get new results. But fortunately, this all seems to work now.
| * Unbreak the "notmuch setup" command.Gravatar Carl Worth2009-10-27
| | | | | | | | | | | | | | | | | | The recent addition of support for automatically adding tags to new messages for "notmuch new" caused "notmuch setup" to segfault. The fix is simple, (just need to move a destroy function to inside a nearby if block). Did I mention recently we need to add a test suite?
* | notmuch restore: Fix to remove all tags before adding tags.Gravatar Carl Worth2009-10-26
| | | | | | | | | | | | | | | | | | | | | | | | 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
* | notmuch restore: Don't bother printing tag values.Gravatar Carl Worth2009-10-26
|/ | | | | The code was just a little messy here with three parallel conditions testing for message == NULL.
* add_message: Add an optional parameter for getting the just-added message.Gravatar Carl Worth2009-10-26
| | | | | We use this to implement the addition of "inbox" and "unread" tags for all messages added by "notmuch new".
* Fix incorrect name of _notmuch_thread_get_subject.Gravatar Carl Worth2009-10-26
| | | | | | Somehow this naming with an underscore crept in, (but only in the private header, so notmuch.c was compiling with no prototype). Fix to be the notmuch_thread_get_subject originally intended.
* Add public notmuch_thread_get_subjectGravatar Carl Worth2009-10-26
| | | | | And use this in "notmuch search" to display subject line as well as thread ID.
* Remove all calls to g_strdup_printfGravatar Carl Worth2009-10-26
| | | | | | Replacing them with calls to talloc_asprintf if possible, otherwise to asprintf (with it's painful error-handling leaving the pointer undefined).
* Add notmuch_thread_get_tagsGravatar Carl Worth2009-10-26
| | | | | And augment "notmuch search" to print tag values as well as thread ID values. This tool is almost usable now.
* tags: Re-implement tags iterator to avoid having C++ in the interfaceGravatar Carl Worth2009-10-26
| | | | | | | We want to be able to iterate over tags stored in various ways, so the previous TermIterator-based tags object just wasn't general enough. The new interface is nice and simple, and involves only C datatypes.
* notmuch restore: Fix leak of FILE* object.Gravatar Carl Worth2009-10-26
| | | | | Apparently, I didn't copy enough of the "notmuch dump" implementation since it didn't have a similar leak.
* Add an initial implementation of a notmuch_thread_t object.Gravatar Carl Worth2009-10-25
| | | | | | | | | | | | | | | | | | | 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.
* Rename notmuch_query_search to notmuch_query_search_messagesGravatar Carl Worth2009-10-25
| | | | | | | | | | 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.
* Add -Wswitch-enum and fix warnings.Gravatar Carl Worth2009-10-25
| | | | | | Having to enumerate all the enum values at every switch is annoying, but this warning actually found a bug, (missing support for NOTMUCH_STATUS_OUT_OF_MEMORY in notmuch_status_to_string).
* Add -Wmising-declarations and fix warnings.Gravatar Carl Worth2009-10-25
| | | | Wow, lots of missing 'static' on internal functions.
* Re-enable the warning for unused parameters.Gravatar Carl Worth2009-10-25
| | | | | It's easy enough to squelch the warning with an __attribute__ ((unused)) and it might just catch something for us in the future.
* Add -Wextra and fix warnings.Gravatar Carl Worth2009-10-25
| | | | | | | | When adding -Wextra we also add -Wno-ununsed-parameters since that function means well enough, but is really annoying in practice. So the warnings we fix here are basically all comparsions between signed and unsigned values.
* Add an INTERNAL_ERROR macro and use it for all internal errors.Gravatar Carl Worth2009-10-25
| | | | | | We were previously just doing fprintf;exit at each point, but I wanted to add file and line-number details to all messages, so it makes sense to use a single macro for that.
* notmuch dump: Eliminate extra space in error message.Gravatar Carl Worth2009-10-25
| | | | Little details can make big impressions.
* Move read-only-archive hint from "notmuch setup" to "notmuch new"Gravatar Carl Worth2009-10-25
| | | | | | | | | | The "notmuch setup" output was getting overwhelmingly verbose. Also, some people might not have a lot of mail, so might never need this optimization. It's much better to move the hint to the time when the user could actually benefit from it, (it's easy to detect that "notmuch new" took more than 1 second, and we know if there are any read-only directories there or not).
* Add a preliminary "notmuch search" command.Gravatar Carl Worth2009-10-24
| | | | | | | | | | | | | This isn't behaving at all like it's documented yet, (for example, it's returning message IDs not thread IDs[*]). In fact, the output code is just a copy of the body of "notmuch dump", so all you get for now is message ID and tags. But this should at least be enough to start exercising the query functionality, (which is currently very buggy). [*] I'll want to convert the databse to store thread documents before fixing that.
* notmuch setup/new: Propagate failure from notmuch_database_set_timestampGravatar Carl Worth2009-10-24
| | | | | | | | | | With some recent testing, the timestamp was failing, (overflowing the term limit), and reporting an error, but the top-level notmuch command was still returning a success return value. I think it's high time to add a test suite, (and the code base is small enough that if we add it now it shouldn't be *too* hard to shoot for a very high coverage percentage).
* Revert "Remove some unneeded initializers."Gravatar Carl Worth2009-10-24
| | | | | | | This reverts commit fb1bae07002d45138832eacb280419dbd7a19774. These initializers were totally necessary. I clearly wasn't thinking straight when I removed them.
* Cut the enthusiasm a bit.Gravatar Carl Worth2009-10-23
| | | | It gets annoying pretty quick.
* Make "notmuch new" ignore directories that are read-only.Gravatar Carl Worth2009-10-23
| | | | | | With this, "notmuch new" is now plenty fast even with large archives spanning many sub-directories. Document this both in "notmuch help" and also in the output of notmuch setup.
* add_files: Pull one stat out of the recrusive function.Gravatar Carl Worth2009-10-23
| | | | | There's no need to stat each directory both before and after each recursive call.
* More fixing of plurals.Gravatar Carl Worth2009-10-23
| | | | | It definitely doesn't help that we have the same messages in both "setup" and "new". Should combine those really.
* More care in final status reporting.Gravatar Carl Worth2009-10-23
| | | | | Printing "Added 1 new messages" just looks like lack of attention to detail, (but yes plurals can be annoying this way).
* Print a better message than "0s" for zero seconds.Gravatar Carl Worth2009-10-23
| | | | It's nice to have a tool that at least construct actual sentences.
* Add new "notmuch new" command.Gravatar Carl Worth2009-10-23
| | | | | | | | Finally, I can get new messages into my notmuch database without having to run a complete "notmuch setup" again. This takes advantage of the recent timestamp capabilities in the database to avoid looking into directories that haven't changed since the last time "notmuch new" was run.
* add_files: Change to return a status value instead of voidGravatar Carl Worth2009-10-23
| | | | | Also change to use goto rather than early returns. And once again, there were lots of bugs in the error cases previously.
* notmuch setup: Clean up the progress printing a bit.Gravatar Carl Worth2009-10-23
| | | | | | | | | | Get rid of a useless leading 0 on the seconds value, and make a distinction between "files" and "messages", (we process many files, but not all of them are recongized as messages). Finally, add a summary line at the end saying how many unique messages were added to the database. Since this comes right after the total number of files, it gives the user at least a hint as to how many messages were encountered with duplicate message IDs.