David Bremner [Wed, 19 Feb 2014 01:05:14 +0000 (21:05 -0400)]
debian: update ruby binary extension install path
From Christian Hofstaedler, Debian bug 739120:
When ruby-defaults > 1:2.0 will be uploaded to sid, the version of
Ruby provided by the 'ruby' and 'ruby-dev' packages will change to
version 2.0. This version change includes a change to the path for
binary extensions.
This patch works for Ruby 1.9.1 as well as Ruby 2.0, so it's safe to
apply now.
David Bremner [Sat, 11 Jan 2014 17:25:39 +0000 (13:25 -0400)]
test/emacs: replace the use of process-attributes with signal-process
In some environments (at least Hurd), process-attributes is
unimplimented and always returns nil. This ends up causing test
failures (see e.g. id:87a9ffofsc.fsf@zancas.localnet).
Historically and according to POSIX 1003.1-2001, a signal of 0 can be
used to check the validity of a pid. This seems less heinous than
parsing the output of ps(1).
David Bremner [Sun, 12 Jan 2014 03:05:33 +0000 (23:05 -0400)]
debian: update notmuch-emacs for emacs policy 2.0.6
This involves
- the meta-flavour emacs has gone away
- a compat file is needed (also installed by dh_installemacsen)
- a conflict with pre-2.0.0 emacsen-common
- manually managing the "installed" semaphore file
Tomi Ollila [Wed, 4 Dec 2013 19:31:58 +0000 (21:31 +0200)]
devel/release-checks.sh: adjust to LIBNOTMUCH version checks
NOTMUCH_VERSION_* macros in lib/notmuch.h are replaced with
LIBNOTMUCH_VERSION_* macros. Check that the values of those
match the LIBNOTMUCH_*_VERSION values in lib/Makefile.local.
Austin Clements [Mon, 23 Dec 2013 20:20:36 +0000 (15:20 -0500)]
test: Fix transient error in 'new' test
This fixes a non-deterministic failure in "Ignore files and
directories specified in new.ignore (multiple occurrences)". The test
assumed that all directories would be scanned, even though nothing
updated the mtime of ${MAIL_DIR}. It *usually* worked nevertheless
because the tests run quickly enough that the directory mtime is
usually the same as the current time, so notmuch new does not update
the mtime in the database (because more changes could occur in the
same second). However, when it occasionally did update the mtime in
the database, the notmuch new call in this test would (correctly) skip
"pass 2" of scanning ${MAIL_DIR}, causing it to skip the following
expected lines:
This patch fixes this problem by touching ${MAIL_DIR} to ensure it
gets scanned and by rearranging the test to ensure the directories are
touched immediately before the main notmuch new call in the test.
David Bremner [Sat, 14 Dec 2013 14:49:43 +0000 (22:49 +0800)]
test: remove call to notmuch-hello from emacs_deliver_message
There is an obscure bug in notmuch-hello that very occasionally causes
emacs_deliver_message to fail. Since it it doesn't serve any actual
purpose in the function we delete it, and leave tracking down the the
bug for another day.
David Bremner [Sat, 14 Dec 2013 14:39:54 +0000 (22:39 +0800)]
test: add emacs_fcc_message that does not use smtp-dummy
Most of the tests previously using emacs_deliver_message do not use
the actual transmitted message, so we replace it with a simpler (and
presumably more reliable function) that only saves (and indexes) an
fcc copy of the message.
David Bremner [Sun, 8 Dec 2013 15:29:38 +0000 (23:29 +0800)]
test: give unique timestamps to messages
The choice of decreasing timestamps is a hack which reduces the number
of existing tests which fail. This can be changed to increasing
if/when somebody wants update another 47 tests.
David Bremner [Sun, 8 Dec 2013 08:41:34 +0000 (16:41 +0800)]
test: sanitize Date and timestamp fields in json
Eventually we want test messages to have distinct dates to avoid
reproducability problems. This sanitization will prevent some test
failures when that change is made.
Replace the use of a local function in maildir-sync with
notmuch_json_show_sanitize
Austin Clements [Wed, 4 Dec 2013 16:19:46 +0000 (11:19 -0500)]
lib: Bump library version from 3.0.0 to 3.1.0
This version of the library introduces LIBNOTMUCH_CHECK_VERSION and
the *_VERSION macros. Bumping the version number is also necessary to
make the comment on LIBNOTMUCH_CHECK_VERSION no longer a lie.
Austin Clements [Wed, 4 Dec 2013 16:19:45 +0000 (11:19 -0500)]
lib: Replace NOTMUCH_*_VERSION with LIBNOTMUCH_*_VERSION
This makes it clear that these macros refer to the *library* version,
and not to the notmuch application-level release. Since there are no
consumers of these macros yet, this is now or never.
Austin Clements [Wed, 4 Dec 2013 16:19:44 +0000 (11:19 -0500)]
lib: Make VERSION macros agree with soname version
We have two distinct "library version" numbers: the soname version and
the version macros. We need both for different reasons: the version
macros enable easy compile-time version detection (and conditional
compilation), while the soname version enables runtime version
detection (which includes the version checking done by things like the
Python bindings).
However, currently, these two version numbers are different, which is
unnecessary and can lead to confusion (especially in things like
Debian, which include the soname version in the package name). This
patch makes them the same by bumping the version macros up to agree
with the soname version.
(We should probably keep the version number in just one place so they
can't get out of sync, but that can be done in another patch.)
David Bremner [Wed, 27 Nov 2013 15:35:46 +0000 (11:35 -0400)]
test/crypto: disable gpg version printing
This was causing test failures because version strings varied in
length between GNU/Linux and GNU/KFreeBSD. One can also imagine
different versions of gnupg causing the same failure.
David Bremner [Sun, 24 Nov 2013 21:29:42 +0000 (17:29 -0400)]
lib: fix byte order test in libsha1.c
Previously PLATFORM_BYTE_ORDER and IS_LITTLE_ENDIAN were not defined,
so the little endian code was always compiled in.
This will have the effect that the "SHA1s" on big endian architectures
will change (i.e. become actual sha1s). So someone re-indexing their
database could conceivable lose tags on messages without a message-id
header.
David Bremner [Sun, 24 Nov 2013 22:51:37 +0000 (18:51 -0400)]
debian: disable gdb as a build-dependency on s390x
Gdb is currently broken on s390x buildd's and porterboxes (see #728705).
By removing it as a build-dep, we disable the (failing) atomicity test on this
architecture
David Bremner [Sat, 23 Nov 2013 11:01:16 +0000 (07:01 -0400)]
test: replace $PWD with YYY in emacs & emacs-show tests
When executed command line is written to *Notmuch errors* buffer,
shell-quote-argument will backslash-escape any char that is not in
"POSIX filename characters" (i.e. matching "[^-0-9a-zA-Z_./\n]").
Currently in two emacs tests shell has expanded $PWD as part of
emacs variable, which will later be fed to #'shell-quote-argument
and finally written to ERROR file. If $PWD contained non-POSIX
filename characters, data in ERROR file will not match $PWD when
later comparing in shell. Therefore, in these two particular cases
the escaped $PWD is replaced with YYY in ERROR file and expected
content is adjusted accordingly.
Mark Walters [Mon, 18 Nov 2013 21:10:33 +0000 (21:10 +0000)]
emacs: show: stop stderr appearing in buffer
In emacs 24.3+ the stdout/stderr from externally displaying an
attachment gets inserted into the show buffer. This is caused by
changes in mm-display-external in mm-decode.el.
Ideally, we would put this output in the notmuch errors buffer but the
handler is called asynchronously so we don't know when the output will
appear. Thus if we put it straight into the errors buffer it could get
interleaved with other errors. Also we can't easily tell when we
have got all the error output so can't wait until the process is complete.
One solution would be to create a new buffer for the stderr of each
attachment viewed. Again, since we can't tell when the process has
finished, we can't close these buffers automatically so this will
leave lots of buffers around.
Thus we add a debug variable notmuch-show-attachment-debug: it this is
non-nil we create a new buffer for each viewer; if this variable is
nil we just use a temp buffer which means all error output is
discarded (this is the same behaviour as with emacs pre 24.3).
Mark Walters [Sun, 17 Nov 2013 12:04:09 +0000 (12:04 +0000)]
emacs: do not put quoted reply in primary selection
In current emacs (24.3) select-active-regions is set to t by
default. The reply insertion code sets the region to the quoted
message to make it easy to delete (kill-region or C-w). These two
things combine to put the quoted message in the primary selection.
This is not what the user wanted and is a privacy risk (accidental
pasting of the quoted message). We can avoid some of the problems
by let-binding select-active-regions to nil. This fixes if the
primary selection was previously in a non-emacs window but not if
it was in an emacs window. To avoid the problem in the latter case
we deactivate mark.
One key test (which fails under many simpler "fixes") is: open emacs
24.3 with notmuch, open 2 windows (viewing different notmuch buffers),
highlight some text in one, and then reply to a message in the
other. In many of my earlier attempts to fix this big this test fails.
Tomi Ollila [Thu, 14 Nov 2013 22:03:26 +0000 (00:03 +0200)]
compact: unconditionally remove old wip database compact directory
In case previous notmuch compact has been interrupted there is old
work-in-progress database compact directory partially filled. Remove
it just before starting to fill the directory with new files.
Tomi Ollila [Thu, 14 Nov 2013 22:03:25 +0000 (00:03 +0200)]
compact: preserve backup database until compacted database is in place
It is less error prone and window of failure opportunity is smaller
if the old (backup) database is always renamed (instead of sometimes
rmtree'd) before new (compacted) database is put into its place.
Finally rmtree() old database in case old database backup is not kept.
Tomi Ollila [Wed, 13 Nov 2013 17:02:44 +0000 (19:02 +0200)]
compact: catch Xapian::Error consistently
catch Xapian::Error in compact code in lib/database.cc to be consistent
with other code in addition to not making software crash on uncaught
other Xapian error.
Mark Walters [Tue, 12 Nov 2013 20:10:59 +0000 (20:10 +0000)]
emacs: tree: use remap for the over-ridden global bindings
Following a suggestion by Austin in id:20130915153642.GY1426@mit.edu
we use remap for the over-riding bindings in pick. This means that if
the user modifies the global keymap these modifications will happen in
the tree-view versions of them too.
[tree-view overrides these to do things like close the message pane
before doing the action, so the functionality is very close to the
original common keymap function.]
Mark Walters [Tue, 12 Nov 2013 20:10:58 +0000 (20:10 +0000)]
emacs: help: add a special function to deal with remaps
remaps are a rather unusual keymap consisting of "first key" 'remap
and then "second-key" the remapped-function. Thus we do the
documentation for it separately.
Mark Walters [Tue, 12 Nov 2013 20:10:57 +0000 (20:10 +0000)]
emacs: help: add base-keymap
To support key remapping in emacs help we need to know the base keymap
when looking at the remapping. keep track of this while we recurse
down the sub-keymaps in help.
Mark Walters [Tue, 12 Nov 2013 20:10:56 +0000 (20:10 +0000)]
emacs: help: split out notmuch-describe-key as a function
The actual documentation function notmuch-describe-keymap was getting
rather complicated so split out the code for a single key into its own
function notmuch-describe-key.
Mark Walters [Tue, 12 Nov 2013 20:10:55 +0000 (20:10 +0000)]
emacs: help: remove duplicate bindings
If the user (or a mode) overrides a keybinding from the common keymap
in one of the modes then both help lines appear in the help screen
even though only one of them is applicable.
Fix this by checking if we already have that key binding. We do this
by constructing an list of (key . docstring) pairs so it is easy to
check if we have already had that binding. Then the actual print help
routine changes these pairs into strings "key \t docstring"
Mark Walters [Tue, 12 Nov 2013 20:10:54 +0000 (20:10 +0000)]
emacs: help: save-match-data
The routines that construct the help page in notmuch-lib rely on
match-data being preserved across some fairly complicated code. This
is currently valid but will not be when this series is finished. Thus
place everything between the string-match and replace-match inside a
save-match-data.
Austin Clements [Wed, 13 Nov 2013 03:49:53 +0000 (22:49 -0500)]
emacs: Correct documentation of `notmuch-poll-script'
The functions referred to in the documentation for this variable were
replaced by the unified `notmuch-poll-and-refresh-this-buffer' in 21474f0e. Update the documentation to reflect the new function.
New defines NOTMUCH_MAJOR_VERSION, NOTMUCH_MINOR_VERSION and
NOTMUCH_MICRO_VERSION were added to lib/notmuch.h.
Check that these match the current value defined in ./version.
Austin Clements [Thu, 24 Oct 2013 15:19:11 +0000 (11:19 -0400)]
emacs: Fix search tagging races
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.
Austin Clements [Thu, 24 Oct 2013 15:19:10 +0000 (11:19 -0400)]
emacs: Add known-broken tests for search tagging races
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.
Austin Clements [Thu, 24 Oct 2013 15:19:08 +0000 (11:19 -0400)]
search: Add stable queries to thread search results
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.
Austin Clements [Thu, 24 Oct 2013 15:19:07 +0000 (11:19 -0400)]
emacs: Use notmuch tag --batch for large tag queries
(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!)
Austin Clements [Thu, 24 Oct 2013 15:19:06 +0000 (11:19 -0400)]
emacs: Support passing input via `notmuch-call-notmuch-*'
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.
Austin Clements [Thu, 24 Oct 2013 15:19:05 +0000 (11:19 -0400)]
emacs: Move `notmuch-call-notmuch-process' to notmuch-lib
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.
Austin Clements [Thu, 24 Oct 2013 15:19:02 +0000 (11:19 -0400)]
cli: Separate current and deprecated format version
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.
Austin Clements [Thu, 24 Oct 2013 15:19:01 +0000 (11:19 -0400)]
schemata: Disambiguate non-terminal names
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_".
Jani Nikula [Wed, 6 Nov 2013 19:01:41 +0000 (21:01 +0200)]
lib: add library version check macro
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.