summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
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.
2010-01-07lib: Implement versioning in the database and provide upgrade function.Carl Worth
The recent support for renames in the database is our first time (since notmuch has had more than a single user) that we have a database format change. To support smooth upgrades we now encode a database format version number in the Xapian metadata. Going forward notmuch will emit a warning if used to read from a database with a newer version than it natively supports, and will refuse to write to a database with a newer version. The library also provides functions to query the database format version: notmuch_database_get_version to ask if notmuch wants a newer version than that: notmuch_database_needs_upgrade and a function to actually perform that upgrade: notmuch_database_upgrade
2010-01-07Prefer READ_ONLY consistently over READONLY.Carl Worth
Previously we had NOTMUCH_DATABASE_MODE_READ_ONLY but NOTMUCH_STATUS_READONLY_DATABASE which was ugly and confusing. Rename the latter to NOTMUCH_STATUS_READ_ONLY_DATABASE for consistency.
2010-01-07lib: Consolidate checks for read-only database.Carl Worth
Previously, many checks were deep in the library just before a cast operation. These have now been replaced with internal errors and new checks have instead been added at the beginning of all top-levelentry points requiring a read-write database. The new checks now also use a single function for checking and printing the error message. This will give us a convenient location to extend the check, (such as based on database version as well).
2010-01-07lib: Clarify internal documentation of _notmuch_database_filename_to_direntryCarl Worth
The original wording made it sound like this function was just doing some string manipulation. But this function actually creates new directory documents as a side effect. So make that explicit in its documentation.
2010-01-07notmuch_message_get_filename: Support old-style filename storage.Carl Worth
When a notmuch database is upgraded to the new database format, (to support file rename and deletion), any message documents corresponding to deleted files will not currently be upgraded. This means that a search matching these documents will find no filenames in the expected place. Go ahead and return the filename as originally stored, (rather than aborting with an internal error), in this case.
2010-01-06lib: Treat NULL as a valid (and empty) notmuch_filenames_t iterator.Carl Worth
This will be convenient to avoid some special-casing in higher-level code.
2010-01-06lib: Indicate whether notmuch_database_remove_message removed anything.Carl Worth
Similar to the return value of notmuch_database_add_message, we now enhance the return value of notmuch_database_remove_message to indicate whether the message document was entirely removed (SUCCESS) or whether only this filename was removed and the document exists under other filenamed (DUPLICATE_MESSAGE_ID).
2010-01-06lib: Update documentation of notmuch_database_add_message.Carl Worth
Previously, adding a filename with the same message ID as an existing message would do nothing. But we recently fixed this to instead add the new filename to the existing message document. So update the documentation to match now.
2010-01-06Index content from citations and signatures.Carl Worth
In the presentation we often omit citations and signatures, but this is not content that should be omitted from the index, (especially when the citation detection is wrong---see cases where a line beginning with "From" is corrupted to ">From" by mail processing tools).
2010-01-06Makefiles: Use .DEFAULT to support arbitrary targets from sub directories.Carl Worth
Taking advantage of the .DEFAULT construct means that we won't need to explicitly list targets such as "clean", etc. in each sub-Makefile.
2010-01-06Add missing comment for NOTMUCH_STATUS_READONLY_DATABASE.Carl Worth
And adjust the string representation of the same to match.
2010-01-06lib: Implement new notmuch_directory_t API.Carl Worth
This new directory ojbect provides all the infrastructure needed to detect when files or directories are deleted or renamed. There's still code needed on top of this (within "notmuch new") to actually do that detection.
2010-01-06Revamp the proposed directory-tracking API slightly.Carl Worth
This commit contains my changes to the API proposed by Keith. Nothing is dramatically different. There are minor things like changing notmuch_files_t to notmuch_filenames_t and then various things needed for completeness as noticed while implementing this, (such as notmuch_directory_destroy and notmuch_directory_set_mtime).
2010-01-06Prototypes for directory trackingKeith Packard
There's no functionality here yet---just a sketch of what the interface could look like.
2010-01-06database: Add new, public notmuch_database_remove_messageCarl Worth
This will allow applications to support the removal of messages, (such as when a file is deleted from the mail store). No removal support is provided yet in commands such as "notmuch new".
2010-01-06database: Add new find_doc_ids_for_term interface.Carl Worth
The existing find_doc_ids function is convenient when the caller doesn't want to be bothered constructing a term. But when the caller *does* have the term already, that interface is just wasteful. So we export a lower-level interface that maps a pre-constructed term to a document-ID iterators.
2010-01-06database: Make find_unique_doc_id enforce uniqueness (for a debug build)Carl Worth
Catching any violation of this unique-ness constraint is very much in line with similar, existing INTERNAL_ERROR cases.
2010-01-06database: Abstract _filename_to_direntry from _add_messageCarl Worth
The code to map a filename to a direntry is something that we're going to want in a future _remove_message function, so put it in a new function _notmuch_database_filename_to_direntry .
2010-01-06database: Allowing storing multiple filenames for a single message ID.Carl Worth
The library interface is unchanged so far, (still just notmuch_database_add_message), but internally, the old _set_filename function is now _add_filename instead.
2010-01-06database: Store mail filename as a new 'direntry' term, not as 'data'.Carl Worth
Instead of storing the complete message filename in the data portion of a mail document we now store a 'direntry' term that contains the document ID of a directory document and also the basename of the message filename within that directory. This will allow us to easily store multple filenames for a single message, and will also allow us to find mail documents for files that previously existed in a directory but that have since been deleted.
2010-01-06database: Split _find_parent_id into _split_path and _find_directory_idCarl Worth
Some pending commits want the _split_path functionality separate from mapping a directory to a document ID. The split_path function now returns the basename as well as the directory name.