aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2009-11-19reply: Pointer mismatch.Chris Wilson
Apparently typeof (size_t) != unsigned int on my x86-64.
2009-11-19Makefile: evaluate pkg-config onceChris Wilson
Currently the same `pkg-config ...` is executed for every target, so just store the results in a variable.
2009-11-18Make reply/show/tag all require at least one search termKeith Packard
In particular, notmuch tag -inbox "" tended to take a long time to run, happened if you hit 'a' on a blank line in the search view and probably didn't have the desired effect. Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-18Have git ignore etags fileKeith Packard
2009-11-18Filter out carriage-returns in show and reply output.Keith Packard
Thanks, windows mail clients. Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-18We use the message mail system for new mail, let emacs know.Keith Packard
This makes things like the goto-address system bring up the right message composition window. Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-18Create a default notmuch-show-hook that highlights URLs and uses word-wrapKeith Packard
I created the notmuch-show-hook precisely so I could add these two options, but I suspect most people will want them, so I just made them the default. If you don't want them, you can use remove-hook to get rid of this. Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-18Set truncate-lines variable for search buffers.Keith Packard
This keeps them from wrapping. Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-18Add notmuch-show-hook to allow customization of show windowsKeith Packard
I wanted to enable got-address-mode and visual-line-mode in my show windows to make messages easier to read and URLs easier to follow. This hook allows the user to run arbitrary code each time a message is shown. Signed-off-by: Keith Packard <keithp@keithp.com>
2009-11-18count_files: sort directory in inode order before stattingStewart Smith
Carl says: This has similar performance benefits as the previous patch, and I fixed similar style issues here as well, (including missing more of a commit message than the one-line summary).
2009-11-18Minor style fixups for the previous fix.Carl Worth
Use consistent whitespace, a slightly less abbreviated identifier, and avoid a C99 declaration after statement.
2009-11-18Read mail directory in inode number orderStewart Smith
This gives a rather decent reduction in number of seeks required when reading a Maildir that isn't in pagecache. Most filesystems give some locality on disk based on inode numbers. In ext[234] this is the inode tables, in XFS groups of sequential inode numbers are together on disk and the most significant bits indicate allocation group (i.e inode 1,000,000 is always after inode 1,000). With this patch, we read in the whole directory, sort by inode number before stat()ing the contents. Ideally, directory is sequential and then we make one scan through the file system stat()ing. Since the universe is not ideal, we'll probably seek during reading the directory and a fair bit while reading the inodes themselves. However... with readahead, and stat()ing in inode order, we should be in the best place possible to hit the cache. In a (not very good) benchmark of "how long does it take to find the first 15,000 messages in my Maildir after 'echo 3 > /proc/sys/vm/drop_caches'", this patch consistently cut at least 8 seconds off the scan time. Without patch: 50 seconds With patch: 38-42 seconds. (I did this in a previous maildir reading project and saw large improvements too)
2009-11-18Make '?" bring up a list of bindings.Carl Worth
Just using describe-mode for now, (though something more specialized would be better).
2009-11-18Fix linking with gcc to use g++ to link in C++ libs.Stewart Smith
Previously, Ubuntu 9.10, gcc 4.4.1 was getting: /usr/bin/ld: lib/notmuch.a(database.o): in function global constructors keyed to BOOLEAN_PREFIX_INTERNAL:database.cc(.text+0x3a): error: undefined reference to 'std::ios_base::Init::Init()'
2009-11-18notmuch main(): Remove stale comment.Carl Worth
The code this comment was referring to has since been deleted.
2009-11-18notmuch help: Print to stdout, not to stderr.Lars Kellogg-Stedman
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.
2009-11-18notmuch search: Avoid infinite stream of exceptions from "notmuch search"Carl Worth
That is, give a nice error message and exit if no search terms are provided. Thanks to Priit Laes <plaes@plaes.org> for reporting the error and providing an early version of the fix.
2009-11-18README: Mention the actual mailing list address now that it exists.Carl Worth
Much better than telling people to mail me individually.
2009-11-18TypsosIngmar Vanhassel
2009-11-18Older versions of install do not support -C.Jan Janak
Do not use -C cmdline option of install, older versions, commonly found in distributions like Debian, do not seem to support it. Running make install on such systems (tested on Debian Lenny) fails. Signed-off-by: Jan Janak <jan@ryngle.com>
2009-11-18linke_message: Avoid segfault when In-Reply-to header is empty.Carl Worth
This was recently introduced in commit: 64c03ae97f2f5294c60ef25d7f41849864e6ebd3 which was adding extra checks to avoid adding a self-referencing message. How many times am I going to fix a dumb regression like this and say "we really need a test suite" before I actually sit down and write the test suite?
2009-11-18notmuch-completion.bash: Update for new commands and help.Carl Worth
Would be nice to add the options for "notmuch search" too.
2009-11-17notmuch help: Update documentation (following recent text from notmuch.1)Carl Worth
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.
2009-11-17notmuch.1: Fix a couple of typos.Carl Worth
Little things I noticed while using this text as reference for the "notmuch help" documentation.
2009-11-17man.1: A big update of the notmuch manual page.Carl Worth
I set out merely to add documentation for the recently-added options for "notmuch search" (--first, --max-threads, and --sort), but ended up revamping a lot. A significant change is a new SEARCH SYNTAX section separate from "notmuch search" that is referred to in the documentation of search, show, reply, and tag. Also many sections were updated to reflect recent changes, (such as the dropping of the NOTMUCH_BASE environment variable, the addition of the .notmuch-config file, etc.)
2009-11-17Makefile: Fix missing dependency for notmuch.1 manual page.Carl Worth
The Makefile was failing to regnerate the notmuch.1.gz file when notmuch.1 was updated, (so stale documentation could potentially be installed).
2009-11-17notmuch search: Change default search order to be newest messages first.Carl Worth
This is what most people want for a _search_ command. It's often different for actually reading mail in an inbox, (where it makes more sense to have results displayed in chronological order), but in such a case, ther user is likely using an interface that can simply pass the --sort=oldest-first option to "notmuch search". Here we're also change the sort enum from NOTMUCH_SORT_DATE and NOTMUCH_SORT_DATE_REVERSE to NOTMUCH_SORT_OLDEST_FIRST and NOTMUCH_SORT_NEWEST_FIRST. Similarly we replace the --reverse option to "notmuch search" with two options: --sort=oldest-first and --sort=newest-first. Finally, these changes are all tracked in the emacs interface, (which has no change in its behavior).
2009-11-17notmuch search: Return first 100 results as quickly as possible.Carl Worth
This is one of those cases where total time is not the metric of interest. We increase the total time of the search, (by doing some redundant work for the initial threads). But more significantly, we give the user *some* results nearly instantaneously, (so that the user might see the result of interest without ever even waiting for the complete results to come in).
2009-11-17Add some const correctness to talloc 'ctx' parameter.Carl Worth
The tentacles of const just keep reaching out.
2009-11-17database: Make _parse_message_id static once again.Carl Worth
We had exposed this to the internal implementation for a short time, (only while we had the silly code fetching In-Reply-To values from message files instead of from the database). Make this private again as it should be.
2009-11-17database: Add "replyto" to the database schema documentation.Carl Worth
Maybe ths lack of this documentation is why I forgot we were actually storing this and wrote the ugly code to fetch In-Reply-To from message files rather than from the database.
2009-11-17database: Rename "ref" prefix name to "reference"Carl Worth
Which is more consistent with the XREFERENCE prefix used in the terms in the database. Also remove some stale documentation describing the removal of resolved references from the database (we no longer do this).
2009-11-17message_file_get_header: Use break where more clear than continue.Carl Worth
Calling continue here worked only because we set a flag before the continue, and, check the flag at the beginning of the loop, and *then* break. It's much more clear to just break in the first place.
2009-11-17Fix "too many open files" bug by closing message files when done with them.Keith Packard
The message file header parsing code parses only enough of the file to find the desired header fields, then it leaves the file open until the next header parsing call or when the message is no longer in use. If a large number of messages end up being active, this will quickly run out of file descriptors. Here, we add support to explicitly close the message file within a message, (_notmuch_message_close) and call that from thread construction code. Signed-off-by: Keith Packard <keithp@keithp.com> Edited-by: Carl Worth <cworth@cworth.org>: Many portions of Keith's original patch have since been solved other ways, (such as the code that changed the handling of the In-Reply-To header). So the final version is clean enough that I think even Keith would be happy to have his name on it.
2009-11-17notmuch show: Detect an internal error if a thread has no messages.Carl Worth
This really should be impossible---if there are no messages, then what was the thread object created from? During recent debugging, it was useful to have this error detected and reported.
2009-11-17add_message: Don't add any self-references to the database.Carl Worth
In our scheme it's illegal for any message to refer to itself, (nor would it be useful for anything anyway). Cut these self-references off at the source, before they trip up any internal errors.
2009-11-17message_get_thread_id: Generate internal error if message has no thread ID.Carl Worth
This case was happening when a message had its own message ID in its In-Reply-To header. The thread-resolution code would find the partially constructed message, (with no thread ID yet), get garbage from this function, and then march right along with that garbage. With this commit, a self-cyclic message like this will now trigger an internal error rather than marching along silienty. (And a subsequent commit will remove the call to this function in this case.)
2009-11-17Remove the talloc_owner argument from create_for_message_id.Carl Worth
This function has only one caller, and that one caller was passing the same value for both talloc_owner and the notmuch database. Dropping the redundant argument simplifies the documentation of this function considerably.
2009-11-17get_in_reply_to: Implement via the database, not by opening mail file.Carl Worth
This reduces our reliance on open message_file objects, (so is a step toward fixing the "too many open files" bug), but more importantly, it means we don't load a self-referencing in-reply-to header, (since we weed those out before adding any replyto terms to the database).
2009-11-17Makefile: Manual pages shouldn't be executableIngmar Vanhassel
2009-11-17Makefile: Change default install prefix from /usr to /usr/local, reallyIngmar Vanhassel
2009-11-17Makefile: Change default install prefix from /usr to /usr/localCarl Worth
We'll be a much more polite package this way. And the user can change the prefix by editing Makefile.config. Still to be done is to make configure write out Makefile.config and to add a --prefix option to configure.
2009-11-17Makefile: Prefer directories as the target for install commands.Carl Worth
I was confusing myself with some rules installing to directories and some installing to files. We do still install to a filename when simultaneously renaming, (such as notmuch-completion.bash to notmuch).
2009-11-17Update .gitignore, add objects and static archivesIngmar Vanhassel
2009-11-17Makefile: Create installation directories explicitlyIngmar Vanhassel
Previously, notmuch.1.gz was installed as /usr/share/man/man1 (a file).
2009-11-17Deal with situation where sysconf(_SC_GETPW_R_SIZE_MAX) returns -1Alexander Botero-Lowry
2009-11-17Fix broken commit.Carl Worth
Oops. I should have actually compiled before pushing.
2009-11-17Include <stdint.h> to get uint32_t in C++ file with gcc 4.4Mikhail Gusarov
Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2009-11-17Close message file after parsing message headersMikhail Gusarov
Keeping unused files open helps to see "Too many open files" often. Signed-off-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2009-11-17add_message: Avoid a memory leak when user holds on to message return.Carl Worth
When this function was originally written, the 'message' object was always destroyed locally, so I thought it would be good to use a NULL talloc context to make it more obvious if there was any leak. Since then, however, this function has been changed to optionally return the added message, and in that case we *don't* free the message locally, so let's let the database be the talloc context.