Thomas Jost [Wed, 20 Jul 2011 23:31:37 +0000 (01:31 +0200)]
libnotmuch: only build symbols list after the modules are built
If the notmuch.sym target does not explicitly depend on $(libnotmuch_modules),
gen-version-script.sh may be run before all the .o files are created, for
example when doing a parallel build on a machine with many cores.
David Bremner [Sun, 17 Jul 2011 14:18:10 +0000 (11:18 -0300)]
build-system: tag debian-version as part of the release target
This allows, e.g. gitpkg debian/0.x-1 to do the right thing. It also
helps enforce the convention that Debian upload -1 is identical to the
release tarball.
David Bremner [Sun, 17 Jul 2011 14:11:57 +0000 (11:11 -0300)]
debian: use 3.0 (quilt) source format.
This generates a seperate notmuch-0.x.debian.tar.gz containing
./debian.
In the initial release this is redundant, but for Debian only updates
between releases, this allows updating the contents of ./debian, and
using the rest of the release tarball.
David Bremner [Mon, 4 Jul 2011 11:39:04 +0000 (08:39 -0300)]
build-system: guard parts irrevokable parts of release target with REALLY_UPLOAD
This supports both testing and use by non-upload privileged
users. Along with previous commits in the series, this lets one do a
dry run of the release process and created a tarball, signature file,
and release announcement to inspect before uploading.
David Bremner [Sun, 17 Jul 2011 12:52:05 +0000 (09:52 -0300)]
build-system: run make clean before testing.
The reasoning is that we might have some error in the build system
that causes something not to be rebuilt; this would potentially have
the tests run on the wrong version of the code.
David Bremner [Sun, 3 Jul 2011 18:18:30 +0000 (15:18 -0300)]
build-system: replace use of ssh with wget for checking the website
The idea is to see if the version we are already releasing exists on
the notmuch website. Using wget allows more people to run this target,
and also allows people with ssh access to run it without access to
their keys.
David Bremner [Sun, 17 Jul 2011 13:42:53 +0000 (10:42 -0300)]
debian: use a non-native version number.
There is concensus to use non-native version number for updates that
contain only Debian changes. Unfortunately changing back and forth
between native and non-native packages has the potential for
confusion, since the archive will end up with notmuch-0.x.tar.gz and
notmuch-0.x.orig.tar.gz. So we use non-native numbering from the
beginning.
David Bremner [Sat, 16 Jul 2011 18:59:44 +0000 (15:59 -0300)]
libnotmuch: export Xapian typeinfo symbols
The lack of such exporting seems to cause problems catching
exceptions, as suggested by
http://gcc.gnu.org/wiki/Visibility
This manifested in the symbol-hiding test failing when notmuch was
compile with gcc 4.4.5. On i386, this further manifested as notmuch
new failing to run (crashing with an uncaught exception on first run).
Jason Woofenden [Mon, 11 Jul 2011 05:40:09 +0000 (01:40 -0400)]
vim: fix (hack) cig/cit parsing within multipart/*
The vim front-end isn't written to handle nested parts.
This patch doesn't change that, it just changes the code to pretend that
multipart/* sections end immediately. This makes the parsing code think that
all sections are top-level, and are thus parsed well enough.
The lovely result of this is that citation folds and signature folds now work
in text/plain parts that are within multipart/* sections. Also, all mime
section starts are now shown correctly (before some were not parsed and showed
the ugly ^L and an ID and so on from notmuch.)
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Jason Woofenden [Mon, 11 Jul 2011 05:40:07 +0000 (01:40 -0400)]
vim: fix from list reformatting in search view
This patch rewrites the reformatting of the from list so it shows full
capitalized names when available (without truncating them as the old code did)
and removes the pipe characters that appear between some names.
The old code appears to assume from list (the list of senders in the thread)
coming from notmuch would be e-mail addresses, but in this version it is mostly
full names. Also in this version, the names are sometimes separated by pipe
instead of comma.
For consistency with old versions, names are still truncated at the first
period. Perhaps they shouldn't be though.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
vim: skip trailing slash for g:notmuch_compose_temp_file_dir
With the trailing slash I get
Error detected while processing function <SNR>10_NM_new_mail..<SNR>10_NM_cmd_compose..<SNR>10_NM_newComposeBuffer..<SNR>10_NM_newFileBuffer:
line 3:
E739: Cannot create directory: /home/ukleinek/.notmuch/compose/
when hitting 'm' to compose a new mail. strace shows:
stat("/home/ukleinek/.notmuch/compose/", 0x7fffee314a10) = -1 ENOENT (No such file or directory)
stat("/home/ukleinek/.notmuch/compose/", 0x7fffee314e30) = -1 ENOENT (No such file or directory)
stat("/home/ukleinek/.notmuch/compose", 0x7fffee315270) = -1 ENOENT (No such file or directory)
stat("/home/ukleinek/.notmuch", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
mkdir("/home/ukleinek/.notmuch/compose", 0755) = 0
mkdir("/home/ukleinek/.notmuch/compose/", 0755) = -1 EEXIST (File exists)
so it seems vim's mkdir() isn't able to handle a trailing slash.
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Sebastian Spaeth [Mon, 11 Jul 2011 13:02:12 +0000 (15:02 +0200)]
python: represent message tags as unicode instances
Rather than returning simply strings and having to guess their encoding,
return explicit unicode() strings for the tags. Xapian stores UTF8, so
we know that they come as UTF8 encoded string.
Note: I tried to directly use the c_wchar_p type of the ctypes library
which translates directly into an unicode type, but that did not work
out so well, so we take c_char_p and .decode() them manually.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
Sebastian Spaeth [Mon, 11 Jul 2011 09:39:42 +0000 (11:39 +0200)]
python: Encode query string as a utf-8 byte array
If we pass in an unicode instance as query string, we would probably get
weird behavior (and indeed do so, see mail
id:"20110707113700.GA16347@megatron"). If a unicode instance is passed
in, make sure we encode it properly to an utf-8 encoded byte string.
Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
debian: strictly depend on the same version of libnotmuch
It took quite some time to debug why folder: searches didn't work for me
though I had notmuch 0.6~rc1 installed. amdragon in #notmuch found out
that I still had libnotmuch1 0.5+nmu3 installed.
To prevent the same problem in the future let notmuch depend on the same
version of libnotmuch1.
Reviewed-By: David Bremner <david@tethera.net>
The underlying issue is that the libnotmuch interface is not
entirely captured by the set of exported symbols. In particular the
query syntax can change without being visible to the linker at all.
A stupid typo was preventing this from ever working and it was not
detected until now. Patrick noted the typo and proposed the fix in mail
id:"20110704203926.GA20238@brick.lan".
Patch-by: Patrick Totzke <patricktotzke@googlemail.com> Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
David Bremner [Fri, 1 Jul 2011 14:48:01 +0000 (11:48 -0300)]
debian: add changelog stanza for release 0.6, install upstream docs referred to.
This perhaps breaks the "one thing at a time rule", but seems better
than leaving the changelog pointing to nothing.
(cherry picked from commit 8c5129bb510b9f4f7acc9752cc61a457eceb6f01)
David Bremner [Thu, 30 Jun 2011 14:38:28 +0000 (11:38 -0300)]
debian: move vim directory creation to notmuch-vim binary package
This step was missed during the package split of notmuch to notmuch,
notmuch-emacs, and notmuch-vim.
It seems mostly harmless in this case, but it is silly for non-vim
users to have those directories.
(cherry picked from commit 4b5875d81ef80dd7138e178f59ac67f66d5fe0ab)
Carl Worth [Fri, 1 Jul 2011 10:14:03 +0000 (03:14 -0700)]
NEWS: Add notes for (imminent) notmuch 0.6 release
By skimming through "git log 0.5..origin/release" late at
night. Hopefully everything here is accurate.
(cherry picked from commit d173069ad9cf042458f16af00729867cb13bb3b7)
Carl Worth [Fri, 1 Jul 2011 08:44:39 +0000 (01:44 -0700)]
emacs: Fix to unconditionally display subject changes in collapsed thread view
The feature to show subject changes in the collapsed thread view was
originally added (8ab433607) with an option
(notmuch-show-always-show-subject) to display the subject
for all messages, even when there was no change.
The subsequent commit (4f04d273) changed the sense of the test (or to
and) and the name of the controlling variable
(notmuch-show-elide-same-subject).
But this commit is broken in a few ways:
1. The original definition of notmuch-show-always-show-subject was
left around
But the variable isn't actually used in the code at all, so it
just adds clutter and confusion to the customization interface.
2. The name and description of the controlling variable doesn't
match the implementation
The name suggests that setting the variable to t will cause
repeated subjects to be elided, (suggesting that when it is nil
all subjects will be shown).
However, when the variable is nil, no subjects are shown. So a
correct name for the variable in this sense would be
notmuch-show-subject-changes.
Showing subject changes is a useful feature, and should be on by
default. (We don't want to bury generally useful features behind
customizations that users have to find).
Rather than fixing the name of the variable and changing its default
value, here we remove the condition entirely, such that the feature is
enabled unconditionally.
So both the currently-used variable and the stale definition of the
formerly-used are removed.
Also, the one relevant test-suite result is updated, (showing the
intial subject of a collapsed thread, and no subject display for later
messages that do not change the subject).
(cherry picked from commit 580de27177de5cd6c5cbc9cc3759ce320216dd5b)
Carl Worth [Fri, 1 Jul 2011 08:44:39 +0000 (01:44 -0700)]
emacs: Fix to unconditionally display subject changes in collapsed thread view
The feature to show subject changes in the collapsed thread view was
originally added (8ab433607) with an option
(notmuch-show-always-show-subject) to display the subject
for all messages, even when there was no change.
The subsequent commit (4f04d273) changed the sense of the test (or to
and) and the name of the controlling variable
(notmuch-show-elide-same-subject).
But this commit is broken in a few ways:
1. The original definition of notmuch-show-always-show-subject was
left around
But the variable isn't actually used in the code at all, so it
just adds clutter and confusion to the customization interface.
2. The name and description of the controlling variable doesn't
match the implementation
The name suggests that setting the variable to t will cause
repeated subjects to be elided, (suggesting that when it is nil
all subjects will be shown).
However, when the variable is nil, no subjects are shown. So a
correct name for the variable in this sense would be
notmuch-show-subject-changes.
Showing subject changes is a useful feature, and should be on by
default. (We don't want to bury generally useful features behind
customizations that users have to find).
Rather than fixing the name of the variable and changing its default
value, here we remove the condition entirely, such that the feature is
enabled unconditionally.
So both the currently-used variable and the stale definition of the
formerly-used are removed.
Also, the one relevant test-suite result is updated, (showing the
intial subject of a collapsed thread, and no subject display for later
messages that do not change the subject).
David Bremner [Thu, 30 Jun 2011 13:04:57 +0000 (10:04 -0300)]
debian: changelog stanza for first "official" release candidate
The last upload to experimental was really a release candidate too.
Switch versioning to ~rc1 as counting commits is confusing when
building from the release branch.
(cherry picked from commit 117852a5f1269e77a7f76c53236220a9ec89eba6)
David Bremner [Thu, 30 Jun 2011 13:04:57 +0000 (10:04 -0300)]
debian: changelog stanza for first "official" release candidate
The last upload to experimental was really a release candidate too.
Switch versioning to ~rc1 as counting commits is confusing when
building from the release branch.
David Bremner [Thu, 30 Jun 2011 11:29:07 +0000 (08:29 -0300)]
debian: don't install zsh completion files into /usr/share/zsh
as of version 4.3.12, perhaps earlier, the Debian zsh package now
ships /usr/share/zsh/functions/Completion/Unix/_notmuch, so we
shouldn't install that ourselves anymore.
My understanding is that letting zsh ship the completion scripts is
the standard thing to do.
David Bremner [Thu, 30 Jun 2011 11:29:07 +0000 (08:29 -0300)]
debian: don't install zsh completion files into /usr/share/zsh
as of version 4.3.12, perhaps earlier, the Debian zsh package now
ships /usr/share/zsh/functions/Completion/Unix/_notmuch, so we
shouldn't install that ourselves anymore.
My understanding is that letting zsh ship the completion scripts is
the standard thing to do.
The script is still shipped in /usr/share/doc/notmuch/examples
Carl Worth [Wed, 29 Jun 2011 21:08:04 +0000 (14:08 -0700)]
debian/changelog: Add note that notmuch-vim description is in (bug #631974)
This note will automatically cause the bug entry to be closed as fixed when
the next package (including this change) is uploaded.
(cherry picked from commit 04b9ffa56f54976f6a3324a3673915a036646ea6)
Carl Worth [Wed, 29 Jun 2011 21:11:38 +0000 (14:11 -0700)]
test: Use increment_mtime rather than sleep
The sleep was to force the directory's mtime to advance between the
previous notmuch new and the subsequent rm;notmuch new.
The current convention is to use the existing increment_mtime function
for this purpose, (which avoids the test suite being slowed down by
calls to sleep).
Mark Anderson [Mon, 27 Jun 2011 17:12:24 +0000 (11:12 -0600)]
test:Folder tags shouldn't match after removal of file in given folder
Test for bug. Current stemming support for notmuch adds extra terms
to the DB which aren't removed when the file renames are detected.
When folder tags are added to a message, Xapian terms for both XFOLDER
and ZXFOLDER are generated. When one of the filenames are
renamed/removed, only the XFOLDER tags are removed, leaving it possible
for a match on a folder: tag that was previously but is no longer a
match in the maildir.
(cherry picked from commit 86e0baeb6df5509393832488c0de3520a1a5bdcb)
Mark Anderson [Fri, 24 Jun 2011 23:26:55 +0000 (17:26 -0600)]
search --output=files: Output all filenames for each matching message
Messages in the database can have multiple files associated with a
single message-id, but until now only one filename for each message
has been reported by "notmuch search --output=files"
Austin Clements [Wed, 29 Jun 2011 23:00:01 +0000 (19:00 -0400)]
new: Improved workaround for mistaken new directories
Currently, notmuch new assumes any directory with a database mtime of
0 is new, but we don't set the mtime until after processing messages
and subdirectories in that directory. Hence, anything that prevents
the mtime update (such as an interruption or the wall-clock logic
introduced in 8c39e8d6) will cause the next notmuch new to think the
directory is still new.
We work around this by setting the new directory's database mtime to
-1 before scanning anything in the new directory. This also obviates
the need for the workaround used in 8c39e8d6.
Austin Clements [Wed, 29 Jun 2011 07:10:54 +0000 (03:10 -0400)]
new: Don't update DB mtime if FS mtime equals wall-clock time.
This fixes a race where multiple message deliveries in the same second
with an intervening notmuch new could result in messages being ignored
by notmuch (at least, until a later delivery forced a rescan).
Because mtimes only have second granularity, later deliveries in the
same second won't change the directory mtime, and hence won't trigger
notmuch new to rescan the directory. This situation can only occur
when notmuch new is being run at the same second as the directory's
modification time, so simply don't update the saved mtime in this
case.
This very race happens all over the test suite, and is currently
compensated for with increment_mtime (and, occasionally, luck). With
this change, increment_mtime becomes unnecessary.
Pieter Praet [Wed, 29 Jun 2011 20:23:47 +0000 (22:23 +0200)]
test: revert non-intentional changes introduced in eb4cf465
eb4cf465 introduces changes which weren't part of the submitted
patch (id:"87liwlip2j.fsf@gmail.com"), presumably made during
resolving merge conflicts.
The first one causes the title of a test to be printed a second time,
in place of the correct title:
PASS Message with .. in Message-Id:
PASS Message with .. in Message-Id:
instead of:
PASS Message with .. in Message-Id:
PASS Sending a message via (fake) SMTP
The second one is simply the insertion of a line break, so no harm there.
This commit reverts both changes, as they were clearly accidental.
Carl Worth [Wed, 29 Jun 2011 21:11:38 +0000 (14:11 -0700)]
test: Use increment_mtime rather than sleep
The sleep was to force the directory's mtime to advance between the
previous notmuch new and the subsequent rm;notmuch new.
The current convention is to use the existing increment_mtime function
for this purpose, (which avoids the test suite being slowed down by
calls to sleep).
Thanks to Austin Clements for noticing this undesired sleep.
Mark Anderson [Mon, 27 Jun 2011 17:12:24 +0000 (11:12 -0600)]
test:Folder tags shouldn't match after removal of file in given folder
Test for bug. Current stemming support for notmuch adds extra terms
to the DB which aren't removed when the file renames are detected.
When folder tags are added to a message, Xapian terms for both XFOLDER
and ZXFOLDER are generated. When one of the filenames are
renamed/removed, only the XFOLDER tags are removed, leaving it possible
for a match on a folder: tag that was previously but is no longer a
match in the maildir.
Dmitry Kurochkin [Sat, 28 May 2011 22:03:47 +0000 (02:03 +0400)]
Add part filename and content-id in notmuch show output if available.
Before the change, notmuch show output had filename only for
parts with "Content-Disposition: attachment". But parts with
inline disposition may have filename as well.
The patch makes notmuch show always output filename if available,
independent of Content-Disposition. Both JSON and text output
formats are changed.
Also, the patch adds Content-id to text output format of notmuch
show.
The main goal of these changes is to have filenames on Emacs
buttons for inline attachments. In particular, this is very
helpful for inline patches.
Note: text format changes may require updates in clients that use
it. The changes are:
Dmitry Kurochkin [Tue, 28 Jun 2011 04:56:17 +0000 (08:56 +0400)]
test: use emacsclient(1) for Emacs tests
Before the change, every Emacs test ran in a separate Emacs
instance. Starting Emacs many times wastes considerable time and
it gets worse as the test suite grows. The patch solves this by
using a single Emacs server and emacsclient(1) to run multiple
tests. Emacs server is started on the first test_emacs call and
stopped when test_done is called. We take care not to leave
orphan Emacs processes behind when test is terminated by whatever
reason: Emacs server runs a watchdog that periodically checks
that the test is still running.
Some tests need to provide user input. Before the change, this
was done using echo(1) to Emacs stdin. This no longer works and
instead `standard-input' variable is set accordingly to make
`read' return the appropriate string.
Carl Worth [Wed, 29 Jun 2011 00:06:15 +0000 (17:06 -0700)]
test: Increment mtime when delivering a message with emacs_deliver_message
Without this, mail messages delivered by emacs_deliver_message might
not be seen by the next invocation of "notmuch new", (which can lead
to test-suite failures if emacs_deliver_message is fast enough).
Dmitry Kurochkin [Tue, 28 Jun 2011 04:45:09 +0000 (08:45 +0400)]
test: set variables using `let' instead of `setq' in Emacs tests
Using `setq' for setting variables in Emacs tests affect other
tests that may run in the same Emacs environment. Currently it
works because each test is run in a separate Emacs instance. But
in the future multiple tests will run in a single Emacs instance.
The patch changes all variables to use `let', so the scope of the
change is limited to a single test.
Dmitry Kurochkin [Tue, 28 Jun 2011 04:45:07 +0000 (08:45 +0400)]
test: remove some sed(1) calls in Emacs tests
Few Emacs tests used sed(1) to remove unexpected output in the
beginning to avoid getting confused by messages such as "Parsing
/home/cworth/.mailrc... done". This is no longer needed since
tests are run in a temporary home directory instead of the user's
one. So remove these sed(1) calls.
Dmitry Kurochkin [Tue, 28 Jun 2011 04:45:06 +0000 (08:45 +0400)]
test: save buffer content to file instead of printing it in Emacs tests
Before the change, the common Emacs test scheme was to print
buffer content to stdout and redirect it to a file or capture it
in a shell variable. This does not work if we switch to using
emacsclient(1) for running the tests, because you can not print
to the stdout in this case. (Actually, you can print to stdout
from Emacs server, but you can not capture the output on
emacsclient(1)).
The patch introduces new Emacs test auxiliary functions:
`test-output' and `test-visible-output'. These functions are
used to save buffer content to a file directly from Emacs. For
most tests the changes are trivial, because Emacs stdout output
was redirected to a file anyway. But some tests captured the
output in a shell variable and compare it with the expected
output using test_expect_equal. These tests are changed to use
files and test_expect_equal_file instead.
Note: even if we do not switch Emacs tests to emacsclient(1), the
patch makes tests cleaner and is an improvement.
Dmitry Kurochkin [Tue, 28 Jun 2011 04:45:05 +0000 (08:45 +0400)]
test: wrap and indent test_emacs calls
Most test_emacs calls have long arguments that consist of many
expressions. Putting them on a single line makes it hard to read
and produces poor diff when they are changed. The patch puts
every expression in test_emacs calls on a separate line.
Dmitry Kurochkin [Tue, 28 Jun 2011 04:45:02 +0000 (08:45 +0400)]
test: fix argument order of test_expect_equal_file in few tests
Few Emacs tests had test_expect_equal_file arguments in the wrong
order: the first argument should be the test output and the
second one should be the expected.
David Bremner [Mon, 27 Jun 2011 01:08:52 +0000 (22:08 -0300)]
libnotmuch: build symbols list without relying on gcc -aux-info.
Carl reports "gcc -aux-info notmuch.aux lib/notmuch.h" does not
generate notmuch.aux for him with Debian gcc 4.6.0-8. A small
modification of the original sed regular expression allows us to work
directly from lib/notmuch.h, rather than preprocessing with gcc.
As with most such simple regex based "parsing", this is quite
sensitive to the input format, and needs that each symbol to be
exported from libnotmuch should
- start with "notmuch_"
- be the first non-whitespace token on the line
- be followed by an open parenthesis.
(Cherry-picked from 51b7ab69687, with conflicts resolved by db)
Mark Anderson [Fri, 24 Jun 2011 23:26:55 +0000 (17:26 -0600)]
search --output=files: Output all filenames for each matching message
Messages in the database can have multiple files associated with a
single message-id, but until now only one filename for each message
has been reported by "notmuch search --output=files"
Mark Anderson [Fri, 24 Jun 2011 22:36:40 +0000 (16:36 -0600)]
test:Expect multiple filenames for message with multiple files
Update the test mail corpus to have two files with the same content to
expose the bug where a single message with multiple filenames only
reports a single filename.
Update expected results for search --output=files to match new
behavior for multiple files corresponding to a single message
Carl Worth [Tue, 28 Jun 2011 18:42:29 +0000 (11:42 -0700)]
Makefile: Make emacs compilation depend on global dependencies.
We call these "global_deps" for a reason, after all!
Without this, emacs compilation would proceed even if the configure script
failed, (such as for a missing dependency). That's undesirable as it can
cause the helpful error messages from the configure failure to scroll away.
David Bremner [Mon, 27 Jun 2011 01:08:52 +0000 (22:08 -0300)]
libnotmuch: build symbols list without relying on gcc -aux-info.
Carl reports "gcc -aux-info notmuch.aux lib/notmuch.h" does not
generate notmuch.aux for him with Debian gcc 4.6.0-8. A small
modification of the original sed regular expression allows us to work
directly from lib/notmuch.h, rather than preprocessing with gcc.
As with most such simple regex based "parsing", this is quite
sensitive to the input format, and needs that each symbol to be
exported from libnotmuch should
- start with "notmuch_"
- be the first non-whitespace token on the line
- be followed by an open parenthesis.