summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAge
* 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.
* lib: Implement versioning in the database and provide upgrade function.Carl Worth2010-01-07
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Prefer READ_ONLY consistently over READONLY.Carl Worth2010-01-07
| | | | | | 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.
* lib: Consolidate checks for read-only database.Carl Worth2010-01-07
| | | | | | | | | | | 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).
* lib: Clarify internal documentation of _notmuch_database_filename_to_direntryCarl Worth2010-01-07
| | | | | | | 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.
* notmuch_message_get_filename: Support old-style filename storage.Carl Worth2010-01-07
| | | | | | | | | | | 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.
* lib: Treat NULL as a valid (and empty) notmuch_filenames_t iterator.Carl Worth2010-01-06
| | | | | This will be convenient to avoid some special-casing in higher-level code.
* lib: Indicate whether notmuch_database_remove_message removed anything.Carl Worth2010-01-06
| | | | | | | | 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).
* lib: Update documentation of notmuch_database_add_message.Carl Worth2010-01-06
| | | | | | | 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.
* Index content from citations and signatures.Carl Worth2010-01-06
| | | | | | | | 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).
* Makefiles: Use .DEFAULT to support arbitrary targets from sub directories.Carl Worth2010-01-06
| | | | | Taking advantage of the .DEFAULT construct means that we won't need to explicitly list targets such as "clean", etc. in each sub-Makefile.
* Add missing comment for NOTMUCH_STATUS_READONLY_DATABASE.Carl Worth2010-01-06
| | | | And adjust the string representation of the same to match.
* lib: Implement new notmuch_directory_t API.Carl Worth2010-01-06
| | | | | | | 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.
* Revamp the proposed directory-tracking API slightly.Carl Worth2010-01-06
| | | | | | | | 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).
* Prototypes for directory trackingKeith Packard2010-01-06
| | | | | There's no functionality here yet---just a sketch of what the interface could look like.
* database: Add new, public notmuch_database_remove_messageCarl Worth2010-01-06
| | | | | | 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".
* database: Add new find_doc_ids_for_term interface.Carl Worth2010-01-06
| | | | | | | | 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.
* database: Make find_unique_doc_id enforce uniqueness (for a debug build)Carl Worth2010-01-06
| | | | | Catching any violation of this unique-ness constraint is very much in line with similar, existing INTERNAL_ERROR cases.
* database: Abstract _filename_to_direntry from _add_messageCarl Worth2010-01-06
| | | | | | 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 .