aboutsummaryrefslogtreecommitdiffhomepage
Commit message (Collapse)AuthorAge
* emacs: Fix search tagging racesGravatar Austin Clements2013-11-08
| | | | | | | | | | | | | | This fixes races in thread-local and global tagging in notmuch-search (e.g., "+", "-", "a", "*", etc.). Previously, these would modify tags of new messages that arrived after the search. Now they only operate on the messages that were in the threads when the search was performed. This prevents surprises like archiving messages that arrived in a thread after the search results were shown. This eliminates `notmuch-search-find-thread-id-region(-search)' because these functions strongly encouraged racy usage. This fixes the two broken tests added by the previous patch.
* emacs: Add known-broken tests for search tagging racesGravatar Austin Clements2013-11-08
| | | | | | These tests check that both thread-local and global search tagging operations are race-free. They are currently known-broken because they aren't race-free.
* Add TODO about more efficient stable thread queriesGravatar Austin Clements2013-11-08
|
* search: Add stable queries to thread search resultsGravatar Austin Clements2013-11-08
| | | | | | | | | | | | | | These queries will match exactly the set of messages currently in the thread, even if more messages later arrive. Two queries are provided: one for matched messages and one for unmatched messages. This can be used to fix race conditions with tagging threads from search results. While tagging based on a thread: query can affect messages that arrived after the search, tagging based on stable queries affects only the messages the user was shown in the search UI. Since we want clients to be able to depend on the presence of these queries, this ushers in schema version 2.
* emacs: Use notmuch tag --batch for large tag queriesGravatar Austin Clements2013-11-08
| | | | | | (Unfortunately, it's difficult to first demonstrate this problem with a known-broken test because modern Linux kernels have argument length limits in the megabytes, which makes Emacs really slow!)
* emacs: Support passing input via `notmuch-call-notmuch-*'Gravatar Austin Clements2013-11-08
| | | | | | | This adds support for passing a string to write to notmuch's stdin to `notmuch-call-notmuch-process' and `notmuch-call-notmuch-sexp'. Since this makes both interfaces a little more complicated, it also unifies their documentation better.
* emacs: Move `notmuch-call-notmuch-process' to notmuch-libGravatar Austin Clements2013-11-08
| | | | | | | Previously, this was in notmuch.el, but all of the other notmuch call wrappers were in notmuch-lib.el. Move `notmuch-call-notmuch-process' to live with its friends. This happens to fix a missing dependency from notmuch-tag.el, which required notmuch-lib, but not notmuch.
* test: Fix missing erase-buffer in emacs testGravatar Austin Clements2013-11-08
| | | | | The first subprocess error exit code test assumed the *Notmuch errors* buffer would be empty. Rather than assuming, make it so.
* lib: Document extent of some return valuesGravatar Austin Clements2013-11-08
| | | | | | This documents the extent of the notmuch_messages_t* pointers returned by notmuch_thread_get_toplevel_messages and notmuch_thread_get_messages.
* cli: Separate current and deprecated format versionGravatar Austin Clements2013-11-08
| | | | | | | | | | | Previously, the CLI would print a deprecation warning if a client requested any format version other than the current one. However, if we add fields that are backwards-compatible, but want clients to be able to depend on, we need to bump the version, but that doesn't make the older version deprecated. Hence, separate out the "minimum active" version and only print a warning for requests below this version number.
* schemata: Disambiguate non-terminal namesGravatar Austin Clements2013-11-08
| | | | | | | | Previously, the show schema and the search schema used different "thread" non-terminals. While these schemata don't interact, this is still confusing, so rename search's "thread" to "thread_summary". To further limit confusion, prefix all top-level search non-terminals now begin with "search_".
* man: document notmuch compact --quiet and --backup=DIRECTORY optionsGravatar Jani Nikula2013-11-07
|
* cli: add compact --quiet option and silence output with itGravatar Jani Nikula2013-11-07
| | | | Provide a way to silence the output.
* lib: add library version check macroGravatar Jani Nikula2013-11-07
| | | | | | | | | There have been some plans for making build incompatible changes to the library API. This is inconvenient, but it is much more so without a way to easily conditional build against multiple versions of notmuch. The macro has been lifted from glib.
* emacs: move the show entry to tree into show.elGravatar Mark Walters2013-11-07
| | | | Move the keybinding and show specific helper from tree.el to show.el
* emacs: add z to common keymapGravatar Mark Walters2013-11-07
| | | | Add the main entry "z" to notmuch-tree to the common keymap.
* emacs: move search based tree functions to notmuch.elGravatar Mark Walters2013-11-07
| | | | | Move a couple of the search mode specifc caller helpers for tree from tree into notmuch.el.
* test: tree: remove require from testsGravatar Mark Walters2013-11-07
| | | | | Now tree is included by default we don't need to "require it" in the test.
* emacs: minimal change to load notmuch-tree by defaultGravatar Mark Walters2013-11-07
| | | | | | | | | | We want to load notmuch-tree when notmuch is loaded, so include it as a require in notmuch.el. To avoid circular dependency we need to move one keybinding from notmuch-tree.el to notmuch.el: it makes sense for it to be defined there anyway. Since tree is now loaded by default there is no need to print a message when it is loaded.
* emacs: tree: remove test for emacs from tree testGravatar Mark Walters2013-11-07
| | | | Now the test is in mainline we can remove the check that emacs exists.
* test: move emacs-tree test into mainlineGravatar Mark Walters2013-11-07
| | | | | We move the emacs-tree test and associated files into the main test directory and add the test to the list in notmuch-test.
* emacs: add tree to the makefileGravatar Mark Walters2013-11-07
|
* emacs: move notmuch-tree from contrib to mainlineGravatar Mark Walters2013-11-07
|
* emacs: tree: remove unneeded declarationsGravatar Mark Walters2013-11-07
| | | | | | There are some crufty declare-functions and requires in notmuch-tree: since it requires notmuch.el itself this all works but in preparation for the move to mainline tidy this up.
* emacs: move notmuch-help to libGravatar Mark Walters2013-11-07
| | | | | | notmuch-help is in notmuch.el not notmuch-lib.el and this is incovenient for the way pick/tree uses it. I think lib makes more sense anyway so move it there.
* cli: add compact --backup=DIRECTORY option, don't backup by defaultGravatar Jani Nikula2013-11-07
| | | | | It's the user's decision. The recommended way is to do a database dump anyway. Clean up the relevant printfs too.
* cli: return error status if compaction failsGravatar Jani Nikula2013-11-07
| | | | As is customary for any tool.
* lib: use the compaction backup path provided by the callerGravatar Jani Nikula2013-11-07
| | | | | | | | The extra path component added by the lib is a magic value that the caller just has to know. This is demonstrated by the current code, which indeed has "xapian.old" both sides of the interface. Use the backup path provided by the lib caller verbatim, without adding anything to it.
* lib: update documentation of callback functions for database_compact and ↵Gravatar David Bremner2013-11-07
| | | | | | | database_upgrade. Compact was missing callback documentation entirely, and upgrade did not discuss the closure parameter.
* lib: add closure parameter to compact status update callbackGravatar Jani Nikula2013-11-07
| | | | This provides much more flexibility for the caller.
* lib: do not leak the database in compactionGravatar Jani Nikula2013-11-07
| | | | | Destroy instead of close the database after compaction, and also on error path, to not leak the database.
* lib: check talloc success in compactGravatar Jani Nikula2013-11-06
| | | | In line with the allocation checks all around.
* lib: construct compactor within try block to catch any exceptionsGravatar Jani Nikula2013-11-06
| | | | Constructors may also throw exceptions. Catch them.
* test: fix compact backup / restore testGravatar David Bremner2013-11-06
| | | | | | It was looking in completely the wrong place for the backup and the (test) xapian database. Unfortunately test_begin_subtest hides the relevant errors.
* query: bind queries to database objectsGravatar Felipe Contreras2013-11-02
| | | | | | | | The queries don't really work after a database is closed, and we would like them to be freed if the database is destroyed. Acknowledged-by: David Bremner <david@tethera.net> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
* test: Add compact testGravatar Ben Gamari2013-10-31
| | | | Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>
* lib: fix build on !HAVE_XAPIAN_COMPACTGravatar Jani Nikula2013-10-30
| | | | | Minimal change to build notmuch against xapian that doesn't have compaction support.
* pick: rename test emacs-pick to emacs-treeGravatar Mark Walters2013-10-29
| | | | Also fixup run-tests.sh
* pick: rename test outputs from pick to treeGravatar Mark Walters2013-10-29
| | | | | | Rename all the test output files to tree rather than pick, move the containing directory to a tree.expected-output and fix up the references in the test.
* pick: Change the test names and print out for pick testsGravatar Mark Walters2013-10-29
| | | | Change from the pick name to the tree name
* contrib: pick: move lisp names from pick to treeGravatar Mark Walters2013-10-29
| | | | | | This changes all the lisp names from pick to tree (variables, functions etc). It also changes the lisp in the emacs-pick test files to match the new names.
* new: Don't scan unchanged directories with no sub-directoriesGravatar Austin Clements2013-10-28
| | | | | | This can substantially reduce the cost of notmuch new in some situations, such as when the file system cache is cold or when the Maildir is on NFS.
* emacs: Add a space after completed tag operationsGravatar Austin Clements2013-10-27
| | | | | | | | | | | | | | Previously, when a user fully completed a tag operation, they had to press space to begin entering another tag operation. This is different from, say, shell file name completion, which typically inserts a space after an unambiguous completion under the assumption that the user will want to enter more input. This patch tweaks `notmuch-read-tag-changes' to act more like shell file name completion: after an unambiguous tag completion, it now inserts a space, ready and waiting for another tagging operation from the user. This is backwards-compatible with old habits, since there's no harm in putting an extra space.
* emacs: Sanitize authors and subjects in search and showGravatar Austin Clements2013-10-27
| | | | | | Authors and subjects can contain embedded, encoded control characters like "\n" and "\t" that mess up display. Transform control characters into spaces everywhere we display them in search and show.
* emacs: Remove interactive behavior of `notmuch-tag'Gravatar Austin Clements2013-10-25
| | | | | | | We no longer use this, since we've lifted all interactive behavior to the appropriate interactive entry points. Because of this, `notmuch-tag' also no longer needs to return the tag changes list, since the caller always passes it in.
* pick: Use interactive specifications for tag changesGravatar Austin Clements2013-10-25
|
* pick: Use list form of tag-changes in testGravatar Austin Clements2013-10-25
| | | | | | Currently we support both string and list forms of tag-changes for historical reasons. This is about to change, so fix pick's tests that use the legacy string form of tag-changes.
* pick: Fix incorrect use of `notmuch-pick-tag'Gravatar Austin Clements2013-10-25
| | | | | | | `notmuch-pick-tag' takes a list of tag changes, but `notmuch-pick-archive-message' passes it a &rest argument. This happens to work if `notmuch-archive-tags' contains a single tag (which it usually does), but will break if it does not.
* emacs: Use interactive specifications for tag changes in searchGravatar Austin Clements2013-10-25
| | | | | | | | | | This is similar to the previous commit, but applies to search. Search is somewhat more complicated because its tagging operations can also apply to a region. Hence, this lifts interactive prompting into a helper function. This also takes advantage of the new ability to provide a prompt to distinguish tagging a single thread from tagging a region of threads.
* emacs: Use interactive specifications for tag changes in showGravatar Austin Clements2013-10-25
| | | | | | | | | | | | | | | This modifies all tagging operations in show to call `notmuch-read-tag-changes' in their interactive specification to input tag changes, rather than depending on lower-level functions to prompt for tag changes regardless of their calling context. Besides being more Elispy and providing a more consistent programmatic API, this enables callers to provide two call site-specific pieces of information: an appropriate prompt, and the set of visible tags. The prompt lets us differentiate * from +/-. Providing visible tags enables a more consistent user experience than retrieving the (potentially different) tags from the database, and avoids a round-trip to the CLI and database.