aboutsummaryrefslogtreecommitdiff
path: root/notmuch.c
Commit message (Collapse)AuthorAge
...
* Add 'notmuch count' command to show the count of matching messagesKeith Packard2009-11-23
| | | | | | | | | | | Getting the count of matching threads or messages is a fairly expensive operation. Xapian provides a very efficient mechanism that returns an approximate value, so use that for this new command. This returns the number of matching messages, not threads, as that is cheap to compute. Signed-off-by: Keith Packard <keithp@keithp.com>
* Support multiple configuration files via $NOTMUCH_CONFIGAlec Berryman2009-11-23
| | | | | If present, $NOTMUCH_CONFIG will be used as the configuration file location.
* Support for printing file paths in new commandAdrian Perez2009-11-23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For very large mail boxes, it is desirable to know which files are being processed e.g. when a crash occurs to know which one was the cause. Also, it may be interesting to have a better idea of how the operation is progressing when processing mailboxes with big messages. This patch adds support for printing messages as they are processed by "notmuch new": * The "new" command now supports a "--verbose" flag. * When running in verbose mode, the file path of the message about to be processed is printed in the following format: current/total: /path/to/message/file Where "current" is the number of messages processed so far and "total" is the total count of files to be processed. The status line is erased using an ANSI sequence "\033[K" (erase current line from the cursor to the end of line) each time it is refreshed. This should not pose a problem because nearly every terminal supports it. * The signal handler for SIGALRM and the timer are not enabled when running in verbose mode, because we are already printing progress with each file, periodical reports are not neccessary.
* notmuch main(): Remove stale comment.Carl Worth2009-11-18
| | | | The code this comment was referring to has since been deleted.
* notmuch help: Print to stdout, not to stderr.Lars Kellogg-Stedman2009-11-18
| | | | | | Let usage() take a FILE * argument so that you can output to stderr in response to usage errors, and stdout in response to an explicit request.
* notmuch help: Update documentation (following recent text from notmuch.1)Carl Worth2009-11-17
| | | | | | | We take the recently created text from the notmuch manual page and update the "notmuch help" command to use similar text. In particular, we add a new "notmuch help search-terms" for documenting the search syntax that is common to several commands.
* notmuch new: Unbreak after the addition of notmuch-config.Carl Worth2009-11-11
| | | | | | Pull in the code from add-files.c now that notmuch_new_command is the only user, (we no longer have notmuch_setup_command adding any messages).
* notmuch: Make the command of "notmuch" walk the user through the next step.Carl Worth2009-11-11
| | | | | | | | If this is run first, it will run "notmuch setup" directly. After that is successful, it will look for a databae and tell the user to run "notmuch new" if the database doesn't exist yet. Finally, if the database is present, it will provide some example "notmuch search" commands for the user to try.
* notmuch: Move welcome messages from "notmuch" to "notmuch setup".Carl Worth2009-11-11
| | | | | | It's quite possible for someone to read the documentation and run "notmuch setup" rather than just "notmuch". In that case, we don't want to be any less welcoming.
* notmuch: Add a configuration system.Carl Worth2009-11-11
| | | | | | | | | | | | | | This will allow for things like the database path to be specified without any cheesy NOTMUCH_BASE environment variable. It also will allow "notmuch reply" to recognize the user's email address when constructing a reply in order to do the right thing, (that is, to use the user's address to which mail was sent as From:, and not to reply to the user's own addresses). With this change, the "notmuch setup" command is now strictly for changing the configuration of notmuch. It no longer creates the database, but instead instructs the user to call "notmuch new" to do that.
* notmuch reply: Use GMime to construct the header for the reply.Carl Worth2009-11-11
| | | | | | | | | The advantage here is that we actually get the necessary folding of long headers, (particularly the References header, but also things like Subject). This also gives us parsed recipient addresses so that we can easily elide the sender's address(es) from the recipient list (just as soon as we have a configured value for the recipient's address(es)).
* notmuch reply: Add (incomplete) reply commandKeith Packard2009-11-10
| | | | | | | | | | | | | | Reviewed-by: Carl Worth <cworth@cworth.org> Keith wrote all the code here against notmuch before notmuch.c was split up into multiple files. So I've pushed the code around in various ways to match the new code structure, but have generally tried to avoid making any changes to the behavior of the code. I did fix one bug---a missing call to g_mime_stream_file_set_owner in show_part which would cause "notmuch show" to go off into the weeds when trying to show multiple messages, (since the first stream would fclose stdout).
* notmuch: Break notmuch.c up into several smaller files.Carl Worth2009-11-10
| | | | | | | | Now that the client sources are alone here in their own directory, (with all the library sources down inside the lib directory), we can break the client up into multiple files without mixing the files up. The hope is that these smaller files will be easier to manage and maintain.
* notmuch setup: Remove a debugging print.Carl Worth2009-11-09
| | | | | This was just some extra noise printed when requesting a non-default mail directory itneractively.
* notmuch show: Don't show the subject line twice.Carl Worth2009-11-06
| | | | | | | | I recently added a print of the subject line for use as part of a two-line summary in the emacs client. But of course, the subject was already being printed on the next line. So I didn't really need to add anything, I could have just stopped hiding what was already printed. Anyway, we now avoid printing it twice in a row.
* notmuch show: Move subject from one-line summary down to its own line.Carl Worth2009-11-05
| | | | | And change the display code in emacs to display the one-line summary in inverse video.
* Update notmuch man page with recently-added documentation.Carl Worth2009-11-05
| | | | | It would be nice to have this documentation live in a single place, but for now, this is what we get.
* notmuch search: Document the from, to, and subject prefixes.Carl Worth2009-11-05
| | | | | I've been using these for a long time, but I had neglected to document them until now.
* notmuch show: Fix to work with any search string rather than just a thread ID.Carl Worth2009-11-05
| | | | | | | | | | | The more general command is more consistent, and more useful. We also fix "notmuch search" to output copy-and-pasteable search terms for the thread with "thread:" prepended already. Similarly, the message-ID in the output of "notmuch show" is also now printed as a valid search term, ("id:<message-id>" rather than "ID: <message-id>"). Naturally, the emacs code is also changed to track these changes.
* notmuch show: Add filename to output (next to message ID).Carl Worth2009-11-04
| | | | | This will allow a client using "notmuch show" to directly open the filename and do whatever it wants with it.
* notmuch show: Fix misplaced g_object_unref leading to error message.Carl Worth2009-11-04
| | | | | | | | | | We were inadvertently calling g_object_unref on a wild pointer leading to the following error message: GLib-GObject-CRITICAL **: g_object_unref: assertion `G_IS_OBJECT (object)' failed Now, why glib doesn't abort on critical errors, I'll never understand.
* notmuch show: Remove custom "unread" hack, (printing tag in two locations).Carl Worth2009-11-03
| | | | | | | | I previously had a hack that special-cased the "unread" tag and printed it on the same line as the message ID. But now that we are printing all tags at the end of the one-line summary we don't need this anymore. Get rid of it, and just read "unread" from the list of tags just like any other tag.
* notmuch show: Print tags for each message.Carl Worth2009-11-03
| | | | | This is in the one-line summary so should always be visible even in our emacs client that's so eager to make things invisible.
* Hide bodies of message that have already been read.Carl Worth2009-11-03
| | | | | | | | | | | | Also hide all markers. From here, all we really need for legibility is the following: * Hide away citations and signatures * Call out the one-line summary some way, (larger font size?) * Add nesting for replies
* notmuch show: Switch to control character to mark sections of outputCarl Worth2009-11-02
| | | | | | | | | | We were previously using things like "%message{" which were not guaranteed to never appear in an email message. Using a control character (^L or '\f' instead of '%') gives us better assurance that our delimiter doesn't show up in an original email message. This still isn't entirely safe since we're decoding encoded text in the body of the email message so almost all bets are off really.
* Tweak relative dates to be close to the same length.Carl Worth2009-11-02
| | | | | Most all of the returned strings will now fill most of a 12-character string, (depending on the length of the month).
* notmuch show: Don't print non-text MIME parts.Carl Worth2009-11-02
| | | | | | Additionally, print a part number for each MIME part so that the client could (conceivably) ask for the contents of a specific part by part number.
* Print "part" markers for each MIME part (with Content-type).Carl Worth2009-11-02
| | | | | This can allow for the client to hide undesired MIME parts such as text/html.
* notmuch show: Use GMime to decode messages.Carl Worth2009-11-02
| | | | We now actually get text content rather than blocks of BASE64, etc.
* Add a simple manual page for notmuch.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.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.Carl Worth2009-10-31
| | | | Shorter naming without being any less clear. A definite win.
* notmuch: Reference help, don't print it for unknown commands.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.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 outputCarl 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.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.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.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)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.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.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 operatorsCarl 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.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 helpCarl 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.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"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).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.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.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.Carl Worth2009-10-26
|/ | | | | The code was just a little messy here with three parallel conditions testing for message == NULL.