aboutsummaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAge
* lib: search_threads: Fix nested search to handle original search of "*"Carl Worth2010-04-15
| | | | | | | | | | | | | | 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.
* Makefile: Add library version information on OS X.Carl Worth2010-04-14
| | | | | | | 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).
* Makefile: Fix library linking command for OS XCarl Worth2010-04-14
| | | | | | | | | 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
* Add infrastructure for building shared library on OS X.Aaron Ecay2010-04-14
| | | | | | | | 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>
* Makefile: Move compat sources from the client code to the library.Carl Worth2010-04-14
| | | | Since the library code needs these as well.
* Do not segfault on empty mime partsmartin f. krafft2010-04-13
| | | | | | | | | | | | | | | | | 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>
* Fix typo in notmuch.h documentation regarding database open modesMichael Forney2010-04-13
| | | | | | | | | | 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.
* lib: Remove condition regarding a NULL parent_thread_id.Carl Worth2010-04-12
| | | | | 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.
* lib: Always add reference terms to the database.Carl Worth2010-04-12
| | | | | | | | 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.
* lib: Document the metadata stored within the Xapian database.Carl Worth2010-04-12
| | | | | We are currently storing "version", "last_thread_id", and "thread_id_*" values so document how each of these are used.
* lib: Fix line-wrapping in _notmuch_database_link_message.Carl Worth2010-04-12
| | | | | | This function had some excessively long lines due to nested expressions. It's simple enough to un-nest these and have readable line lengths.
* lib: Fix internal documentation of _notmuch_database_link_messageCarl Worth2010-04-12
| | | | | | 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.
* lib: Simplify code flow in _resolve_message_id_to_thread_idCarl Worth2010-04-12
| | | | | | 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.
* lib: Fix internal documentation of _resolve_message_id_to_thread_idCarl Worth2010-04-12
| | | | | We no longer return NULL, but instead generate a new thread ID for messages that we haven't seen yet.
* Store thread ids for messages that we haven't seen yetJames Westby2010-04-12
| | | | | | | | | | | | | | | | 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.
* lib: Handle "*" as a query string to match all messages.Carl Worth2010-04-09
| | | | | | 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).
* fix obvious cut and paste errorDirk Hohndel2010-04-06
| | | | | | the wrong variable is checked for success of an allocation Signed-off-by: Dirk Hohndel <hohndel@infradead.org>
* fix notmuch_message_file_get_headerDirk Hohndel2010-04-06
| | | | | | | 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>
* Avoid needlessly linking final notmuch binary against libXapian.Carl Worth2010-04-06
| | | | | | 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.)
* configure: Add support for a --includedir optionCarl Worth2010-04-06
| | | | Very similar to the existing --libdir option.
* Makefiles: Eliminate the useless quiet_* functions.Carl Worth2010-04-06
| | | | | | | | | | | | | | | | | | 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.
* RELEASING: Add this file describing the steps to make a release.Carl Worth2010-04-05
| | | | | These steps might be changing a bit as we work on making the initial 0.1 release.
* Makefile.local: Automatically use makefile modeDavid Edmondson2010-04-03
| | | | | | | | | 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.
* Compile a static notmuch binary (but only install the shared version)Carl Worth2010-04-01
| | | | | | | | 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.
* Makefile: Create include directory when installing headersMichal Sojka2010-04-01
| | | | | | 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.
* lib: Switch to a 3-part version number for the library interface.Carl Worth2010-04-01
| | | | | With a carefully documented description of how to increment the various version components.
* Makefiles: Make the install rules quiet like the compilation rules.Carl Worth2010-03-31
| | | | | The output from make is looking better all the time, (though the columns still aren't lined up).
* Move installation of library from top-level to lib/Makefile.localCarl Worth2010-03-31
| | | | | | 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).
* Fix target dependencies for multiple jobsSaleem Abdulrasool2010-03-31
| | | | Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org>
* Build and link against notmuch shared library, install notmuch.hBen Gamari2010-03-31
| | | | Signed-off-by: Ingmar Vanhassel <ingmar@exherbo.org>
* emacs: Fix the notmuch-search-authors-width variable.Carl Worth2010-03-31
| | | | This variable existed previously, but wasn't actually used for anything.
* Clarify documentation of notmuch_database_add_message.Carl Worth2010-03-31
| | | | | | 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.
* Makefile: Fix Makefiles to depend on all child Makefile fragments.Carl Worth2010-03-10
| | | | | | | | | | | | | | 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.
* Add is:<tag> as a synonym for tag:<tag> in search terms.Carl Worth2010-03-09
| | | | | I like the readability of this, it provides compatibility with people trained in this syntax by sup, and it even saves one character.
* lib: Silence a compiler warning.Carl Worth2010-03-09
| | | | | The original code was harmless, but apparently some compilers aren't able to think deep enough to catch that.
* Fix a few documentation typos in notmuch.hFernando Carrijo2010-03-09
| | | | | | Fix a few documentation typos in notmuch.h Signed-off-by: Fernando Carrijo <fcarrijo@yahoo.com.br>
* Update documentation of notmuch_query_createFernando Carrijo2010-03-09
| | | | | | | | | | | 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.
* lib: Document what move_to_next does at the end of the list.Carl Worth2010-03-09
| | | | | Explicitly mention that there's an invalid position after the last item in the list.
* lib: Rename iterator functions to prepare for reverse iteration.Carl Worth2010-03-09
| | | | | | | | 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'.
* Fix printf for when uint64_t != unsigned long long intCarl Worth2010-02-09
| | | | | | | | 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
* Switch from random to sequential thread identifiers.Carl Worth2010-02-09
| | | | | | | | | | | | | 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).
* notmuch.h: Fix a couple of typos in the documentation.Carl Worth2010-02-05
| | | | | Obviously, the spell-checker isn't able to catch every mistake I make.
* Eliminate some useless gobject boilerplate.Carl Worth2010-02-04
| | | | | | 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.
* notmuch new: Don't index uuencoded data.Carl Worth2010-02-04
| | | | | | | | | | | | | | 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.
* notmuch new: Print upgrade progress report as a percentage.Carl Worth2010-01-09
| | | | | | | | | | | | 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.
* lib: Add non-content terms with a WDF value of 0.Carl Worth2010-01-09
| | | | | | | | | | | | | | | | | | 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.
* lib: Explicitly set BoolWeight when searching.Carl Worth2010-01-09
| | | | | | | 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.
* lib: Split the database upgrade into two phases for safer operation.Carl Worth2010-01-09
| | | | | | | | | 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.
* lib: Delete stale timestamp documents during database upgrade.Carl Worth2010-01-08
| | | | | Once we move the timestamp to the new directory document, we don't need the old one anymore.
* notmuch new: Fix progress notification on database upgrade.Carl Worth2010-01-07
| | | | | This was firing continuously rather than just once per second as intended.