summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2010-04-15lib: search_threads: Fix nested search to handle original search of "*"Carl Worth
When constructing a thread, we usually run a nested query to find all messages in the thread that match the original search string. However, we need to have special-case handling of an original search string of "*" now that that is a supported means of specifying all messages. The special-case ends up bein quite simple---we do less work, (just skipping the nested search since we know that all messages must match). I had been wanting to write this identical code to more efficiently handle "notmuch search thread:<foo>" which was previously running two identical searches. So that case is now more efficient as well.
2010-04-14Makefile: Add library version information on OS X.Carl Worth
This encodes the library version into the library, where the linking binary can pick it up, and the linker can even enforce mismatches in the minor release, (such as linking a binary against version 1.2 and then attempting to run it against version 1.1).
2010-04-14Makefile: Fix library linking command for OS XCarl Worth
I'm not sure which system Aaron used, but on the machine I have access to, (Darwin 8.11.0), the -shared and -dylib_install_name options are not recognized. Instead I use -dynamic_lib and -install_name as documented here: http://www.finkproject.org/doc/porting/shared.php
2010-04-14Add infrastructure for building shared library on OS X.Aaron Ecay
This patch adds a configure check for OS X (actually Darwin), and sets up the Makefiles to build a proper shared library on that platform. Signed-off-by: Aaron Ecay <aaronecay@gmail.com>
2010-04-14Makefile: Move compat sources from the client code to the library.Carl Worth
Since the library code needs these as well.
2010-04-13Do not segfault on empty mime partsmartin f. krafft
notmuch previously unconditionally checked mime parts for various properties, but not for NULL, which is the case if libgmime encounters an empty mime part. Upon encounter of an empty mime part, the following is printed to stderr (the second line due to my patch): (process:17197): gmime-CRITICAL **: g_mime_message_get_mime_part: assertion `GMIME_IS_MESSAGE (message)' failed Warning: Not indexing empty mime part. This is probably a bug that should get addressed in libgmime, but for not, my patch is an acceptable workaround. Signed-off-by: martin f. krafft <madduck@madduck.net>
2010-04-13Fix typo in notmuch.h documentation regarding database open modesMichael Forney
Reviewed-by: Carl Worth <cworth@cworth.org>: The original proposal for having different open modes used the name WRITABLE. I didn't like that name, (easy to misspell as WRITEABLE even for native English speakers). So we renamed it to READ_WRITE immediately, but apparently some of the documentation held the old name for a while.
2010-04-12lib: Remove condition regarding a NULL parent_thread_id.Carl Worth
A recent change guaranteed that a message ID can never be resolved to a NULL thread ID, so we don't need this extra case.
2010-04-12lib: Always add reference terms to the database.Carl Worth
Previously, we were only adding the reference terms for cases where the referenced message did not yet exist in the database. For thread presentation, it's useful to have the connection information provided by the references, even when the messages are present. So add this term unconditionally.
2010-04-12lib: Document the metadata stored within the Xapian database.Carl Worth
We are currently storing "version", "last_thread_id", and "thread_id_*" values so document how each of these are used.
2010-04-12lib: Fix line-wrapping in _notmuch_database_link_message.Carl Worth
This function had some excessively long lines due to nested expressions. It's simple enough to un-nest these and have readable line lengths.
2010-04-12lib: Fix internal documentation of _notmuch_database_link_messageCarl Worth
This function was recently modified, (to include a metadata lookup for a message's thread ID before looking for parent/child thread IDs), but the documentation wasn't updated. Fix that.
2010-04-12lib: Simplify code flow in _resolve_message_id_to_thread_idCarl Worth
There are two primary cases in this function, (the message exists in the database or it does not). Previously the code for these two cases was split and intermingled with goto-spaghetti connections.
2010-04-12lib: Fix internal documentation of _resolve_message_id_to_thread_idCarl Worth
We no longer return NULL, but instead generate a new thread ID for messages that we haven't seen yet.
2010-04-12Store thread ids for messages that we haven't seen yetJames Westby
This allows us to thread messages even when we receive them out of order, or never receive the root. The thread ids for messages that aren't present but are referred to are stored as metadata in the database and then retrieved if we ever get that message. When determining the thread id for a message we also check for this metadata so that we can thread descendants of a message together before we receive it. Edited by Carl Worth <cworth@cworth.org>: Split this portion of the commit from the earlier-applied portion adding test cases.
2010-04-09lib: Handle "*" as a query string to match all messages.Carl Worth
This seems like a generally useful thing to support, (but the previous support through an empty string was not convenient for some users, (such as the command-line client).
2010-04-06fix obvious cut and paste errorDirk Hohndel
the wrong variable is checked for success of an allocation Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
2010-04-06fix notmuch_message_file_get_headerDirk Hohndel
fix notmuch_message_file_get_header to always return the first instance of the header you are looking for Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
2010-04-06Avoid needlessly linking final notmuch binary against libXapian.Carl Worth
The libnotmuch.so library already does, so we don't need to do it again. (Thanks to a Debian debhelper warning for pointing this out.)
2010-04-06configure: Add support for a --includedir optionCarl Worth
Very similar to the existing --libdir option.
2010-04-06Makefiles: Eliminate the useless quiet_* functions.Carl Worth
With the original quiet function, there's an actual purpose (hiding excessively long compiler command lines so that warnings and errors from the compiler can be seen). But with things like quiet_symlink there's nothing quieter. In fact "SYMLINK" is longer than "ln -sf". So all this is doing is hiding the actual command from the user for no real benefit. The only actual reason we implemented the quiet_* functions was to be able to neatly right-align the command name and left-align the arguments. Let's give up on that, and just left-align everything, simplifying the Makefiles considerably. Now, the only instances of a captialized command name in the output is if there's some actually shortening of the command itself.
2010-04-05RELEASING: Add this file describing the steps to make a release.Carl Worth
These steps might be changing a bit as we work on making the initial 0.1 release.
2010-04-03Makefile.local: Automatically use makefile modeDavid Edmondson
We add a magic line to the beginning of each Makefile.local file to help the editor know that it should use makefile mode for editing the file, (even though the filename isn't exactly "Makefile"). Edited-by: Carl Worth <cworth@cworth.org>: Expand treatment from emacs/Makefile.local to each instance of Makefile.local.
2010-04-01Compile a static notmuch binary (but only install the shared version)Carl Worth
The idea here is to allow a new user of notmuch to be able to run notmuch immediately after compiling, (without having to install the shared library first). This also ensures that the test suite tests the locally compiled library, and not whatever installled version of the library the dynamic linker happens to find.
2010-04-01Makefile: Create include directory when installing headersMichal Sojka
When I wanted to create a debian package from the current master, make install failed because of non-existent include directory. This patch fixes this minor issue.
2010-04-01lib: Switch to a 3-part version number for the library interface.Carl Worth
With a carefully documented description of how to increment the various version components.
2010-03-31Makefiles: Make the install rules quiet like the compilation rules.Carl Worth
The output from make is looking better all the time, (though the columns still aren't lined up).
2010-03-31Move installation of library from top-level to lib/Makefile.localCarl Worth
We had a fairly ugly violation of modularity with the top-level Makefile.local isntalling everything, (even when the build commands for the library were down in lib/Makefile.local).
2010-03-31Fix target dependencies for multiple jobsSaleem Abdulrasool
Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org>
2010-03-31Build and link against notmuch shared library, install notmuch.hBen Gamari
Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org>
2010-03-31emacs: Fix the notmuch-search-authors-width variable.Carl Worth
This variable existed previously, but wasn't actually used for anything.
2010-03-31Clarify documentation of notmuch_database_add_message.Carl Worth
For the case of adding a file that already exist, (with the same filename). In this case, nothing will happen to the database, but that wasn't clear before.
2010-03-10Makefile: Fix Makefiles to depend on all child Makefile fragments.Carl Worth
We were previously maintaining two lists of the child Makefile fragments---one for the includes and another for the dependencies. So, of course, they drifted and the dependency list wasn't up to date. We fix this by adding a single subdirs variable, and then using GNU Makefile substitution to generate both the include and the dependency lists. Some side effect of this change caused the '=' assignment of the dir variable to not work anymore. I'm not sure why that is, but using ':=' makes sense here and fixes the problem.
2010-03-09Add is:<tag> as a synonym for tag:<tag> in search terms.Carl Worth
I like the readability of this, it provides compatibility with people trained in this syntax by sup, and it even saves one character.
2010-03-09lib: Silence a compiler warning.Carl Worth
The original code was harmless, but apparently some compilers aren't able to think deep enough to catch that.
2010-03-09Fix a few documentation typos in notmuch.hFernando Carrijo
Fix a few documentation typos in notmuch.h Signed-off-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
2010-03-09Update documentation of notmuch_query_createFernando Carrijo
Commit cd467caf renamed notmuch_query_search to notmuch_query_search_messages. Commit 1ba3d46f created notmuch_query_search_threads. We better keep the docs of notmuch_query_create consistent with those changes. Signed-off-by: Fernando Carrijo <fcarrijo@yahoo.com.br> Edited-by: Carl Worth to explicitly list the full name of each function being referenced.
2010-03-09lib: Document what move_to_next does at the end of the list.Carl Worth
Explicitly mention that there's an invalid position after the last item in the list.
2010-03-09lib: Rename iterator functions to prepare for reverse iteration.Carl Worth
We rename 'has_more' to 'valid' so that it can function whether iterating in a forward or reverse direction. We also rename 'advance' to 'move_to_next' to setup parallel naming with the proposed functions 'move_to_first', 'move_to_last', and 'move_to_previous'.
2010-02-09Fix printf for when uint64_t != unsigned long long intCarl Worth
Thanks to Michal Sojka <sojkam1@fel.cvut.cz> for pointing out the correct fix, which I verified in the freely-available WG14/N1124 draft (from the C99 working group) which is available here: http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf
2010-02-09Switch from random to sequential thread identifiers.Carl Worth
The sequential identifiers have the advantage of being guaranteed to be unique (until we overflow a 64-bit unsigned integer), and also take up half as much space in the "notmuch search" output (16 columns rather than 32). This change also has the side effect of fixing a bug where notmuch could block on /dev/random at startup (waiting for some entropy to appear). This bug was hit hard by the test suite, (which could easily exhaust the available entropy on common systems---resulting in large delays of the test suite).
2010-02-05notmuch.h: Fix a couple of typos in the documentation.Carl Worth
Obviously, the spell-checker isn't able to catch every mistake I make.
2010-02-04Eliminate some useless gobject boilerplate.Carl Worth
If we had external users of this filter then they might expect some of these macros to exist. But since this is just internal, that's just unneeded noise.
2010-02-04notmuch new: Don't index uuencoded data.Carl Worth
With modern MIME attachments, we're already avoiding indexing the attachments. But for old-school uuencoded data in the mail, we have been directly indexing the encoded data as terms, (which is not useful at all---nobody will ever ytry to search based on the seemingly random uuencoded data). Additionally, indexing a modestly large uuencoded file seems to make Xapian go insane, (consuming *lots* of memory). We fix both problems by detecting uuencoded content and not performing any indexing of it.
2010-01-09notmuch new: Print upgrade progress report as a percentage.Carl Worth
Previously we were printing a number of messages upgraded so far. The original motivation for this was to accurately reflect the fact that there are two passes, (so each message is processed twice and it's not accurate to represent with a single count). But as it turns out, the second pass takes zero time (relatively speaking) so we're still not accounting for it. If nothing else, the percentage-based reporting makes for a cleaner API for the progress_notify function.
2010-01-09lib: Add non-content terms with a WDF value of 0.Carl Worth
The WDF is the "within-document frequency" value for a particular term. It's intended to provide an indication of how frequent a term is within a document, (for use in computing relevance). Xapian's term generator already computes WDF values when we use that, (which we do for indexing all mail content). We don't use the term generator when adding single terms for things that don't actually appear in the mail document, (such as tags, the filename, etc.). In this case, the WDF value for these terms doesn't matter much. But Xapian's flint backend can be more efficient with changes to terms that don't affect the document "length". So there's a performance advantage for manipulating tags (with the flint backend) if the WDF of these terms is 0.
2010-01-09lib: Explicitly set BoolWeight when searching.Carl Worth
All notmuch searches currently sort by value (either date or message ID) so it's just wasted effort for Xapian to compute relevance values for each result. We now explicitly tell Xapian that we're uninterested in the relevance values.
2010-01-09lib: Split the database upgrade into two phases for safer operation.Carl Worth
The first phase copies data from the old format to the new format without deleting anything. This allows an old notmuch to still use the database if the upgrade process gets interrupted. The second phase performs the deletion (after updating the database version number). If the second phase is interrupted, there will be some unused data in the database, but it shouldn't cause any actual harm.
2010-01-08lib: Delete stale timestamp documents during database upgrade.Carl Worth
Once we move the timestamp to the new directory document, we don't need the old one anymore.
2010-01-07notmuch new: Fix progress notification on database upgrade.Carl Worth
This was firing continuously rather than just once per second as intended.