aboutsummaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* notmuch.el: Add an 'm' binding to start composing a new mail.Carl Worth2009-11-13
| | | | Available from either the "search" or the "show" view.
* notmuch.el: Use require instead of load to get the cl functions.Carl Worth2009-11-13
| | | | | Not only is "load" probably the wrong thing, but loading cl-seq befoe cl can cause complaints anyway.
* notmuch reply: Prefer "Reply-To" header over "From" for choosing recipient.Carl Worth2009-11-13
| | | | | | There are still open questions about how to correctly compute the intended list of recipients. We'll probably need separate "reply to sender" and "reply to all" commands at some point (unfortunately).
* notmuch new/tag: Flush all changes to database when interrupted.Keith Packard2009-11-13
| | | | | | By installing a signal handler for SIGINT we can ensure that no work that is already complete will be lost if the user interrupts a "notmuch new" run with Control-C.
* notmuch.el: Add a binding ('o') and command to toggle current search order.Carl Worth2009-11-12
| | | | | This ended up being a bit easier than I thought. Just flip the controlling variable and then run `notmuch-search-refresh-view'.
* notmuch search: Fix thread dates to come only from matched messages.Carl Worth2009-11-12
| | | | | | We were properly sorting the threads based only on matched messages, but we were displaying the date based on the total messages in the thread, which led to inconsistent and very confusing results.
* notmuch.el: Hook up support for different search orders.Carl Worth2009-11-12
| | | | | | | | | | | | | This gives us two different default search orders: The inbox view that comes up from "M-x notmuch" is sorted in chronological order (oldest threads first). A new global search "M-x notmuch-search" will instead be in reverse chronological order (newest threads first). Any filtered searches retain the sort order of the search being filtered. There's not yet any interface for changing the sort order of a search after it is constructed.
* notmuch search: Add support for a --reverse option to reverse sort order.Carl Worth2009-11-12
| | | | | | | | | | | | | | Note that the difference between thread results in date order and thread results in reverse-date order is not simply a matter of reversing the final results. When sorting in date order, the threads are sorted by the oldest message in the thread. When sorting in reverse-date order, the threads are sorted by the newest message in the thread. This difference means that we might want an explicit option in the interface to reverse the order, (even though the default will be to display the inbox in date order and global searches in reverse-date order).
* Makefile: Fix dependency generation for files in sub-directories.Carl Worth2009-11-12
| | | | | | | | | | | | | | | | | | | | Otherwise, things in the lib sub-directory weren't getting recompiled even when lib/notmuch.h was changed. The original rule we were using came from the GNU Makefile manual, but only handled files in the current directory, not file in sub-directories as we use here with our non-recursive Makefile. So the .deps files being created were being put in the right place, (such as .deps/lib/database.d), but the compiler was generating a dependency for "database.o" rather than "lib/database.o" like we want. We were already trying to do a sed job on that name to add a dependency for the .d file as well. But the sed job was failing since the expected pattern wasn't there, (the directory name was missing). So the fix is simply to use basename to construct the search pattern, and then use the name with the directory in the replacement (rather than the back-reference).
* notmuch search: Print the number of matched/total messages for each thread.Carl Worth2009-11-12
| | | | | | | | | | | | | | | | | | | Note that we don't print the number of *unread* messages, but instead the number of messages that matched the search terms. This is in keeping with our philosophy that the inbox is nothing more than a search view. If we search for messages with an inbox tag, then that's what we'll get a count of. (And if somebody does want to see unread counts, then they can search for the "unread" tag.) Getting the number of matched messages is really nice when doing historical searches. For example in a search like: notmuch search tag:sent (where the "sent" tag has been applied to all messages originating from the user's email address)---here it's really nice to be able to see a thread where the user just mentioned one point [1/13] vs. really getting involved in the discussion [10/29].
* Use $(MAKE) when invoking make from make.Carl Worth2009-11-12
| | | | Without this, things like MAKEFLAGS=-j4 can't work.
* notmuch search: Avoid printing duplicate author names.Carl Worth2009-11-12
| | | | | | | | We add a hash to the thread object so that we can detect author names that have already been added to the list, and avoid adding them redundantly. This avoids the giant chain of "bugzilla-daemon, bugzilla-daemon, bugzilla-daemon, bugzilla-daemon, ..." author lists that we would get otherwise, for example.
* notmuch search: Print all authors contributing to a thread.Carl Worth2009-11-12
| | | | | | | | We've now expanded the notmuch_thread_create function to fire off a secondary database query to find all the messages that belong to this particular thread. This allows us to now have the complete authors' list for the thread, and will also make it trivial to print accurate message counts for threads in the future.
* notmuch search: Add --first and --max-threads options for incremental search.Carl Worth2009-11-12
| | | | | | | | | | | | | This time, things are actually tested. The current results aren't exactly the same as previous results since the incremental search doesn't necessarily see all the new messages that pertain to the thread. This means that some author names are missing. I plan to fix this by doing an additional database search for all messages in each thread. Of course, this will also be different than before since now the result will display *all* authors in the thread (rather than only those that matched the search) but that's probably what we really want to display anyway.
* notmuch_query_search_threads: Avoid returning more threads than asked for.Carl Worth2009-11-12
| | | | | | | | | I thought it would be safe enough to return a few extra threads, (since we happened to already get the relevant messages out of the database). The problem is that then requires the caller to carefully read the number of threads returned and adjust its next "first" value accordingly. The interface is much simpler to use if we simply return exactly what is asked for and no more.
* notmuch search: Fix a second bug in the change to support incremental searches.Carl Worth2009-11-12
| | | | | | | The search was dropping the first thread from the results. When am I going to break down and write a test suite? It's long overdue now.
* notmuch search: Fix to actually return something.Carl Worth2009-11-12
| | | | | | | This serves me right for committing untested code. The notmuch_query_search_threads was totally broken, (it didn't properly treat -1 as being unlimited and instead returned no threads in that case).
* libnotmuch: Underlying support for doing partial-results searches.Carl Worth2009-11-12
| | | | | | The library interface now allows the caller to do incremental searches, (such as one page of results at a time). Next we'll just need to hook this up to "notmuch search" and the emacs interface.
* notmuch.el: Remove functions to show/hide thread IDs.Carl Worth2009-11-12
| | | | | | I wrote these originally jsut for debugging. They've never been hooked up to any keybinding and the existing "M-x visible-mode" does what's needed anyway.
* notmuch reply: Add Bcc to the user's primary email address.Carl Worth2009-11-12
| | | | | The user really wants a copy of all outbound messages to come back in.
* notmuch show: Display "Subject: " before the subject.Carl Worth2009-11-12
| | | | I think I was being uselessly terse when I dropped that. Put it back.
* notmuch search: Print the names of author of matched emails.Carl Worth2009-11-12
| | | | | | | It's important to have the names present for determining whether a thread is worth reading or not. We may want to think about abbreviating the list somehow if it is excessively long (or redundant as in bugzilla-daemon, bugzilla-daemon, bugzilla-daemon, etc.).
* Don't create "contact" terms in the database.Carl Worth2009-11-12
| | | | | | | | | | | We never did export any interface to get at these, and when I went to use these, I found them inadequate, (because I wanted to distinguish address found in from: from those found in To:). Meanwhile, it was easy enough to extract addresses with a search like: notmuch show tag:sent | grep ^To: so the storage of contact terms was just wasting space. Stop that.
* TODO: Add note on making "notmuch new" interruptible.Carl Worth2009-11-12
| | | | | | | | | This note was described in the previous commit message, but mistakenly not committed: The note about making "notmuch setup" faster is now rewritten to apply to "notmuch new" since "notmuch setup" no longer does any mail indexing.
* TODO: Update based on recent additions.Carl Worth2009-11-12
| | | | | | | | | We recently added support for "notmuch reply" and also made (most of) the hidden components self documenting. The note about making "notmuch setup" faster is now rewritten to apply to "notmuch new" since "notmuch setup" no longer does any mail indexing.
* notmuch new: Don't ignore files with mtime of 0.Carl Worth2009-11-12
| | | | | | | | | I recently discovered that mb2md has the annoying bug of creating files with mtime of 0, and notmuch then promptly ignored them, (thinking that its timestamps initialized to 0 were just as new). We fix notmuch to not exclude messages based on a database timestamp of 0.
* notmuch show: Avoid segmentation for message with no subject.Carl Worth2009-11-11
| | | | | It's safer to return an empty string rather than NULL for missing header values.
* Initialize count of new files to zero.Keith Packard2009-11-11
| | | | | | | Leaving this variable uninitialized caused notmuch to display a random number while counting files for the new database. Signed-off-by: Keith Packard <keithp@keithp.com>
* notmuch.el: Switch to using "notmuch reply" rather than message-reply.Carl Worth2009-11-11
| | | | | | This way we get to take advantage of the configuration of the user's email addresses in notmuch, (rather than expecting the user to configure all of their email addresses in message mode as well).
* notmuch reply: Fish out user's address from recipient list to use as From.Carl Worth2009-11-11
| | | | | | That is, if mail was addresses to one of the "other" addresses in the configuration file, then the reply will have its "From" header set to that same address rather than the primary address.
* notmuch reply: Don't reply to address belonging to the user.Carl Worth2009-11-11
| | | | | | Here's our first real advantage of having a configuration system. We get to omit our own addresses from the recipient list of any replies.
* Unbreak several notmuch commands after the addition of configuration.Carl Worth2009-11-11
| | | | | | | | | | | | | | | | | | | | | | All of the following commands: notmuch dump notmuch reply notmuch restore notmuch search notmuch show notmuch tag were calling notmuch_database_open with an argument of NULL. This was a legitimate call until the recent addition of configuration, after which it is expected that all commands will lookup the correct path in the configuration file. So fix all these commands to do that. Also, while touching all of these commands, we fix them to use the talloc context that is passed in rather than creating a local talloc context. We also switch from using goto for return values, to doing direct returns as soon as an error is detected, (which can be leak free thanks to talloc).
* 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 setup: Add some comments when creating a .notmuch-config file.Carl Worth2009-11-11
| | | | | The "notmuch setup" command is nice and all, but we also want to allow users to conveniently edit the configuration file directly.
* 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 setup: Break the implementation up into manageable functions.Carl Worth2009-11-11
| | | | | The notmuch_setup_command function was getting entirely unwieldy. Break it up into smaller functions for better maintainability.
* 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.el: Add a binding ('r') to reply to the current message.Carl Worth2009-11-10
| | | | | | | We were just starting to get "notmuch reply" into shape in order to provide the needed functionality here, but then I realized that the message-reply function built into emacs is already more functional, (at least for the case of replying to a single message).
* notmuch reply: Process headers a bit more accurately.Carl Worth2009-11-10
| | | | | | We know take the original From: and all recipients and put them on the To: line. We also add a "Re: " to the subject, and we add In-Reply-To: and References: headers.
* notmuch.el: Simplify get-message-idCarl Worth2009-11-10
| | | | | We were stripping off the "id:" portion of the identifier, only to put it back on again in all cases. Stop this madness.
* 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.
* .gitignore: Ignore .deps directory.Carl Worth2009-11-10
| | | | | We recently moved dependencies from a single .depends file to a directory named .deps with many files, but neglected to update our .gitignore rules.
* Makefile: Change default flags to -O2.Carl Worth2009-11-10
| | | | | We've now verified that it's reliable for the user to override CFLAGS on the command line, so just make the user do to get a debug build.
* Makefile: Make the top-level Makefile a little more independent.Carl Worth2009-11-10
| | | | | | | Previously, the top-level Makefile was explicitly adding -I./lib to the compiler flags. However, that's something that's much better done from within the Makefile.local fragment within the lib directory itself.
* Makefile: Simplify setting of CFLAGS, etc.Carl Worth2009-11-10
| | | | | | | | | | We were previously using separate CFLAGS and NOTMUCH_CFLAGS variables in an attempt to allow the user to specify CFLAGS on the command-line. However, that's just a lot of extra noise in the Makefile when we can instead let the user specify what is desired for CFLAGS and then use an override to append the things we require. So our Makefile is much neater now.
* Makefile: Fix dependency generation to make .d files themselves dependent.Carl Worth2009-11-10
| | | | | | | | | | | | | | | I saw this recommendation in the implementation notes for "Recursive Make Considered Harmful" and then the further recommendation for implementing the idea in the GNU make manual. The idea is that if any of the files change then we need to regenerate the dependency file before we regenerate any targets. The approach from the GNU make manual is simpler in that it just uses a sed script to fix up the output of an extra invocation of the compiler, (as opposed to the approach in the implementation notes from the paper's author which use a wrapper script for the compiler that's always invoked rather than the compiler itself).
* Implement a non-recursive make.Carl Worth2009-11-10
| | | | | | | | | | | | The idea here is that every Makefile at each lower level will be an identical, tiny file that simply defers to a top-level make. Meanwhile, the Makefile.local file at each level is a Makefile snippet to be included at the top-level into a large, flat Makefile. As such, it needs to define its rules with the entire relative directory to each file, (typically in $(dir)). The local files can also append to variables such as SRCS and CLEAN for files to be analyzed for dependencies and to be cleaned.