]> git.notmuchmail.org Git - notmuch/log
notmuch
12 years agoversion: bump to 0.6
David Bremner [Fri, 1 Jul 2011 18:12:23 +0000 (15:12 -0300)]
version: bump to 0.6

The release machinery in the build system depends on this file
being correct.
(cherry picked from commit 6bd02fb4dbee9e0fc372661af573a2ac380fed8a)

12 years agoNEWS: Update for release 0.6
David Bremner [Fri, 1 Jul 2011 16:59:15 +0000 (13:59 -0300)]
NEWS: Update for release 0.6

Fix some typos, add some notes on python bindings, "improve" the folder searching
description, expand the discussion of crypto changes.

This includes the changes from
id:"1309541202-4938-1-git-send-email-dmitry.kurochkin@gmail.com"

Thanks to Sebastian, Austin, and Uwe, Dmitry for the editing help.
(cherry picked from commit 74d00bb0e847a1aa785b9cae2e8242a7789bf8b3)

12 years agodebian: add changelog stanza for release 0.6, install upstream docs referred to.
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)

12 years agodebian: move vim directory creation to notmuch-vim binary package
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.

12 years agoNEWS: Add notes for (imminent) notmuch 0.6 release
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.

12 years agoemacs: Fix to unconditionally display subject changes in collapsed thread view
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).

12 years agodebian: changelog stanza for first "official" release candidate
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.

12 years agodebian: don't install zsh completion files into /usr/share/zsh
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

12 years agonew: Improved workaround for mistaken new directories
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.

12 years agotest: document test_expect_equal_file
Jameson Graef Rollins [Wed, 29 Jun 2011 17:06:32 +0000 (10:06 -0700)]
test: document test_expect_equal_file

This test was not properly documented when it was originally added (my
bad).

12 years agolib/Makefile.local: remove leftover debugging output.
David Bremner [Wed, 29 Jun 2011 10:42:02 +0000 (07:42 -0300)]
lib/Makefile.local: remove leftover debugging output.

The removed "echo $(libnotmuch_modules)" was strictly for debugging.

Thanks to Austin Clements for the hint.

12 years agotest: Nix increment_mtime.
Austin Clements [Wed, 29 Jun 2011 07:10:55 +0000 (03:10 -0400)]
test: Nix increment_mtime.

With the fix for the mtime race, this workaround is no longer
necessary.

12 years agonew: Don't update DB mtime if FS mtime equals wall-clock time.
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.

12 years agotest: revert non-intentional changes introduced in eb4cf465
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.

Signed-off-by: Pieter Praet <pieter@praet.org>
12 years agoFix folder: coherence issue
Mark Anderson [Wed, 29 Jun 2011 20:04:45 +0000 (14:04 -0600)]
Fix folder: coherence issue

Add removal of all ZXFOLDER terms to removal of all XFOLDER terms for
each message filename removal.

The existing filename-list reindexing will put all the needed terms
back in.  Test search-folder-coherence now passes.

Signed-off-by:Mark Anderson <ma.skies@gmail.com>

12 years agotest: Use increment_mtime rather than sleep
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.

12 years agotest:Folder tags shouldn't match after removal of file in given folder
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.

12 years agodebian/changelog: Add note that notmuch-vim description is in (bug #631974)
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.

12 years agoTODO: Add note to fix race condition with directory mtime.
Carl Worth [Wed, 29 Jun 2011 21:07:06 +0000 (14:07 -0700)]
TODO: Add note to fix race condition with directory mtime.

I recently discussed fixing this with Austin, but want to record it
here just in case we don't remember to fix it right away.

12 years agotest: fix tests after notmuch show output changes related to filenames
Dmitry Kurochkin [Sat, 28 May 2011 22:03:48 +0000 (02:03 +0400)]
test: fix tests after notmuch show output changes related to filenames

Adding the filename propery alongside ID and Content-type.

This makes the test suite pass again after the recent change.

12 years agoAdd part filename and content-id in notmuch show output if available.
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:

* text part header format changed from:

    ^Lpart{ ID: 2, Content-type: text/x-diff

  to:

    ^Lpart{ ID: 2, Filename: cool-feature.patch, Content-type: text/x-diff

* attachment format changed from:

    ^Lattachment{ ID: 4, Content-type: application/octet-stream
    Attachment: data.tar.bz2 (application/octet-stream)
    Non-text part: application/octet-stream
    ^Lattachment}

  to:

    ^Lattachment{ ID: 4, Filename: data.tar.bz2, Content-type: application/octet-stream
    Non-text part: application/octet-stream
    ^Lattachment}

12 years agotest: use emacsclient(1) for Emacs tests
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.

12 years agotest: Increment mtime when delivering a message with emacs_deliver_message
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).

12 years agotest:Improve test behaviors when --root is used
Mark Anderson [Tue, 28 Jun 2011 22:11:32 +0000 (16:11 -0600)]
test:Improve test behaviors when --root is used

Change add_email_corpus, emacs_deliver_message and tests to use
$TEST_DIRECTORY instead of '..'.

This improves the behavior of the usage of --root=<dir>, as the
assumption of what '..' means will usually be incorrect.

Document -root option in README and update valgrind to work with
-root.

12 years agotest: generate run_emacs script once on test startup
Dmitry Kurochkin [Tue, 28 Jun 2011 04:45:10 +0000 (08:45 +0400)]
test: generate run_emacs script once on test startup

Instead of generating auxiliary run_emacs script every time
test_emacs is run, do it once in the beginning of the test.

Also, use absolute paths in the script to make it more robust.

12 years agotest: set variables using `let' instead of `setq' in Emacs tests
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.

12 years agotest: use emacs_deliver_message in Emacs SMTP send test
Dmitry Kurochkin [Tue, 28 Jun 2011 04:45:08 +0000 (08:45 +0400)]
test: use emacs_deliver_message in Emacs SMTP send test

Minor changes to expected results of other Emacs tests were
needed because the message Date header changed.

12 years agotest: remove some sed(1) calls in Emacs tests
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.

12 years agotest: save buffer content to file instead of printing it in Emacs tests
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.

12 years agotest: wrap and indent test_emacs calls
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.

12 years agotest: cleanup test_emacs
Dmitry Kurochkin [Tue, 28 Jun 2011 04:45:04 +0000 (08:45 +0400)]
test: cleanup test_emacs

Move auxiliary function definition and configuration from command
line to test-lib.el.

12 years agotest: do not set `message-signature' in test_emacs
Dmitry Kurochkin [Tue, 28 Jun 2011 04:45:03 +0000 (08:45 +0400)]
test: do not set `message-signature' in test_emacs

It is no longer needed since tests are run in a temporary home
directory instead of the user's one.

12 years agotest: fix argument order of test_expect_equal_file in few tests
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.

12 years agoTODO: Clarify note about changing the way the emacs '*' command works.
Carl Worth [Tue, 28 Jun 2011 19:49:31 +0000 (12:49 -0700)]
TODO: Clarify note about changing the way the emacs '*' command works.

Additional detail is available in this mail message:

id:8739itagad.fsf@yoom.home.cworth.org

12 years ago.gitignore: Ignore the notmuch.sym file.
Carl Worth [Tue, 28 Jun 2011 19:21:41 +0000 (12:21 -0700)]
.gitignore: Ignore the notmuch.sym file.

This is a generated file, so will not be under git control.

12 years agosearch --output=files: Output all filenames for each matching message
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"

Signed-off-by: Mark Anderson <ma.skies@gmail.com>
12 years agotest:Expect multiple filenames for message with multiple 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

Signed-off-by: Mark Anderson <ma.skies@gmail.com>
12 years agoMakefile: Make emacs compilation depend on global dependencies.
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.

12 years agolibnotmuch: build symbols list without relying on gcc -aux-info.
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.

12 years agolibnotmuch: fix typos in CLEAN setting, add file
David Bremner [Sat, 25 Jun 2011 12:45:58 +0000 (09:45 -0300)]
libnotmuch: fix typos in CLEAN setting, add file

c0961e6 introduced a missing slash between $(dir)$(LIBNAME) and missing
  $(dir) in front of libnotmuch.a
cdf1c70a created a file $(dir)/notmuch.h.gch and neglected to
  add it to CLEAN

12 years agopython: Do not implicitely call maildir_flags_to_tags etc
Sebastian Spaeth [Fri, 24 Jun 2011 06:44:06 +0000 (08:44 +0200)]
python: Do not implicitely call maildir_flags_to_tags etc

In order to remain consistent with the underlying C API, we do not
automatically synchronize notmuch tags and maildir flags anymore.

The underlying functions Message.maildir_flags_to_tags and
Message.tags_to_maildir_flags still exist and are available to the user.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
12 years agoMerge remote-tracking branch 'origin/master'
David Bremner [Fri, 24 Jun 2011 00:54:50 +0000 (21:54 -0300)]
Merge remote-tracking branch 'origin/master'

12 years agotest: remove useless test_emacs call from an emacs FCC test
Dmitry Kurochkin [Thu, 23 Jun 2011 23:59:33 +0000 (03:59 +0400)]
test: remove useless test_emacs call from an emacs FCC test

This was inadvertently left over when debugging an early version of
this commit. -Carl Worth <cworth@cworth.org>

12 years agodebian: fix installation of notmuch-vim README
David Bremner [Thu, 23 Jun 2011 23:39:29 +0000 (20:39 -0300)]
debian: fix installation of notmuch-vim README

There was a leftover override, installing it into the wrong package.

12 years agoAdd dir-locals style variables for C++, Elisp, and shell code.
Austin Clements [Fri, 10 Jun 2011 01:28:51 +0000 (21:28 -0400)]
Add dir-locals style variables for C++, Elisp, and shell code.

Also, slightly reformat dir-locals.el so that the settings align and
to make it friendlier for future additions.

12 years agofix sum moar typos [test-case data]
Pieter Praet [Mon, 20 Jun 2011 20:14:21 +0000 (22:14 +0200)]
fix sum moar typos [test-case data]

Various typo fixes in some test-case data.

Signed-off-by: Pieter Praet <pieter@praet.org>
Edited-by: Carl Worth <cworth@cworth.org> Restricted to just
test-case data.

12 years agofix sum moar typos [error messages]
Pieter Praet [Mon, 20 Jun 2011 20:14:21 +0000 (22:14 +0200)]
fix sum moar typos [error messages]

Various typo fixes in error messages within the source code.

Signed-off-by: Pieter Praet <pieter@praet.org>
Edited-by: Carl Worth <cworth@cworth.org> Restricted to just error messages.
12 years agofix sum moar typos [user-visible documentation in code]
Pieter Praet [Mon, 20 Jun 2011 20:14:21 +0000 (22:14 +0200)]
fix sum moar typos [user-visible documentation in code]

Various typo fixes in documentation within the code that can be made
available to the user, (emacs function help strings, "notmuch help"
output, notmuch man page, etc.).

Signed-off-by: Pieter Praet <pieter@praet.org>
Edited-by: Carl Worth <cworth@cworth.org> Restricted to just
documentation and fixed fix of "comman" to "common" rather than
"command".

12 years agofix sum moar typos [comments in source code]
Pieter Praet [Mon, 20 Jun 2011 20:14:21 +0000 (22:14 +0200)]
fix sum moar typos [comments in source code]

Various typo fixes in comments within the source code.

Signed-off-by: Pieter Praet <pieter@praet.org>
Edited-by: Carl Worth <cworth@cworth.org> Restricted to just
source-code comments, (and fixed fix of "descriptios" to "descriptors"
rather than "descriptions").

12 years agofix sum moar typos [build scripts, Makefiles]
Pieter Praet [Mon, 20 Jun 2011 20:14:21 +0000 (22:14 +0200)]
fix sum moar typos [build scripts, Makefiles]

Various typo fixes in comments within the Makefile and other build scripts.

Signed-off-by: Pieter Praet <pieter@praet.org>
Edited-by: Carl Worth <cworth@cworth.org> Restricted to just build files.
12 years agostart new changelog stanza
David Bremner [Thu, 23 Jun 2011 22:41:28 +0000 (19:41 -0300)]
start new changelog stanza

12 years agofix sum moar typos [text files]
Pieter Praet [Mon, 20 Jun 2011 20:14:21 +0000 (22:14 +0200)]
fix sum moar typos [text files]

Various typo fixes in auxiliary text files included with the source,
(README, TODO, etc.).

Signed-off-by: Pieter Praet <pieter@praet.org>
Edited-by: Carl Worth <cworth@cworth.org> Restricted to just text files.
12 years agoRevert "debian: Override RPATH_LDFLAGS"
David Bremner [Thu, 23 Jun 2011 22:35:35 +0000 (19:35 -0300)]
Revert "debian: Override RPATH_LDFLAGS"

This reverts commit fc126d89b2baa479d98c864fbef4174b6da707c0.

This override of the make variable RPATH_LDFLAGS should no longer
be required since the auto-configuration was fixed

12 years agoFix wrong-type-argument lisp error in `notmuch-fcc-header-setup'
Dmitry Kurochkin [Sat, 28 May 2011 21:51:49 +0000 (14:51 -0700)]
Fix wrong-type-argument lisp error in `notmuch-fcc-header-setup'

This error occurs when `notmuch-fcc-dirs' is set to a list.  The error
was in the `notmuch-fcc-dirs' format check which was changed in an
incompatible way from 0.4 to 0.5.

The fix was extracted from a bigger patch series by David
Edmondson id:"1290682750-30283-2-git-send-email-dme@dme.org".

Signed-off-by: Jameson Graef Rollins <jrollins@finestructure.net>
12 years agotest: Test emacs message composing with various values for notmuch-fcc-dirs
Carl Worth [Thu, 23 Jun 2011 22:10:31 +0000 (15:10 -0700)]
test: Test emacs message composing with various values for notmuch-fcc-dirs

We exercise each of the documented values (nil, a string, and a
list). For the list, we test matching a specific entry, matching a
catch-all regular expression, and no match at all (in which case there
is no FCC set).

12 years agodebian: Set conflicts from package split to point to an existing version.
David Bremner [Thu, 23 Jun 2011 17:42:15 +0000 (14:42 -0300)]
debian: Set conflicts from package split to point to an existing version.

The previous version was harmless, since there were no versions
uploaded between ~237 and ~254, but this is less confusing.

12 years agodebian: fix typo in short description of notmuch-vim
David Bremner [Thu, 23 Jun 2011 17:37:29 +0000 (14:37 -0300)]
debian: fix typo in short description of notmuch-vim

Thanks to Dirk Eddelbuettel for noticing.

12 years agodebian: update changelog for upload 0.6~254, bump standards version to 3.9.2 debian/0.6_254
David Bremner [Mon, 20 Jun 2011 22:05:53 +0000 (19:05 -0300)]
debian: update changelog for upload 0.6~254, bump standards version to 3.9.2

12 years agodebian: remove Xapian exceptions symbols from libnotmuch1.symbols
David Bremner [Wed, 22 Jun 2011 00:49:39 +0000 (21:49 -0300)]
debian: remove Xapian exceptions symbols from libnotmuch1.symbols

These were never intended to be public, since the library exports only
a C API.

12 years agodebian: split off vim interface to its own package
David Bremner [Tue, 21 Jun 2011 17:31:21 +0000 (14:31 -0300)]
debian: split off vim interface to its own package

So far the package does notthing fancy with vim-addon-manager.

12 years agodebian: split off emacs interface into its own package.
David Bremner [Tue, 21 Jun 2011 01:00:44 +0000 (22:00 -0300)]
debian: split off emacs interface into its own package.

- rename emacsen-install/remove files, and change embedded package
  name

- split notmuch.install, notmuch.dirs

- add Breaks/Replaces for previous notmuch packages with overlapping
  files.

12 years agodebian: Build depend on emacs-nox instead of emacs.
David Bremner [Mon, 20 Jun 2011 21:52:58 +0000 (18:52 -0300)]
debian: Build depend on emacs-nox instead of emacs.

Nothing in the build process needs X, and the number of dependencies
that need to be installed is much smaller.

12 years agodebian: build package for python-bindings.
David Bremner [Sun, 19 Jun 2011 18:09:46 +0000 (15:09 -0300)]
debian: build package for python-bindings.

This uses dh_python2 (included with sufficiently recent versions of
the python/python-all packages). python-all brings in all of the
supported versions of python. The double calls to dh_auto_install and
friends are to avoid looping over python versions ourselves.

12 years agotests: add a test for symbol hiding side effects
David Bremner [Wed, 22 Jun 2011 11:58:01 +0000 (08:58 -0300)]
tests: add a test for symbol hiding side effects

The worry here is that a binary linking with libnotmuch might lose
access to Xapian::Error symbols because libnotmuch hides them.

We are careful here to create ./fakedb/.notmuch in order to trigger a
Xapian exception, and not just a missing file check.

Thanks to jrollins and amddragon for suggestions.
(cherry picked from commit 66f37f5f6864a988f94ddb893e3a176af57f6c8e)

12 years agolibnotmuch: add linker script to declare only notmuch_* symbols as global.
David Bremner [Wed, 22 Jun 2011 00:25:06 +0000 (21:25 -0300)]
libnotmuch: add linker script to declare only notmuch_* symbols as global.

This is closely tied to gcc and particularly gnu ld, but I guess the
shared library linking code would need to be adjusted to work on a
non-gnu linker anyay.

I had to make a few not-obviously related changes to the
lib/Makefile.local to make this work: libnotmuch_modules is defined
with := and used in place of $^
(cherry picked from commit 014bf85b1c06ff49be2bde5a26433d2cf376cf70)

12 years agodebian: add changlog stanza for new snapshot 0.6~237
David Bremner [Sat, 18 Jun 2011 13:14:53 +0000 (10:14 -0300)]
debian: add changlog stanza for new snapshot 0.6~237
(cherry picked from commit 17daa480e435ad4c1d8f4f18447eff1ff36dbe00)

12 years agodebian: Changelog stanza for new git snapshot 0.6~215
David Bremner [Sat, 4 Jun 2011 11:52:20 +0000 (08:52 -0300)]
debian: Changelog stanza for new git snapshot 0.6~215
(cherry picked from commit b85a415a7bd91c360c0acd453ead39be854f63f7)

12 years agodebian: update symbols file for libnotmuch1
David Bremner [Wed, 1 Jun 2011 00:45:35 +0000 (21:45 -0300)]
debian: update symbols file for libnotmuch1

One of the Xapian exception symbols has gone missing.  Hopefully this
doesn't mean we should be bumping the SONAME.
(cherry picked from commit e8260d63f1f5a37094801ecd5d110bf48f22ee45)

12 years agodebian: Changelog stanza for new snapshot 0.6~180
David Bremner [Wed, 1 Jun 2011 00:17:40 +0000 (21:17 -0300)]
debian: Changelog stanza for new snapshot 0.6~180
(cherry picked from commit 54a3983d3c38830e2b609be0a96c5cf6dc6de054)

12 years agodebian: update symbols file for libnotmuch1
David Bremner [Sat, 28 May 2011 11:53:03 +0000 (08:53 -0300)]
debian: update symbols file for libnotmuch1

This re-exports three symbols from Xapian.
(cherry picked from commit f36c36ddd13486d1e38b4dd0efa717108f56c4f9)

12 years agodebian: Override RPATH_LDFLAGS
David Bremner [Sat, 28 May 2011 11:48:34 +0000 (08:48 -0300)]
debian: Override RPATH_LDFLAGS

Probably there is a nicer way to do this; perhaps it should be a
configure option.
(cherry picked from commit 387dc520dd68cc805e390f3a1399f85b5d5bd83a)

12 years agodebian: Add changelog stanza for new snapshot 0.6~171
David Bremner [Sat, 28 May 2011 10:26:50 +0000 (07:26 -0300)]
debian: Add changelog stanza for new snapshot 0.6~171

After some debate, we settled on 0.6~$num as a snapshot version
number, at least until 0.6 is released. This has the needed property
of sorting after 0.5+nmu$num.
(cherry picked from commit 54f7766febc3fa3c9dc475f6ec6718c5e87a189e)

12 years agodebian: Add myself (David Bremner) as an uploader
David Bremner [Sat, 28 May 2011 16:31:26 +0000 (13:31 -0300)]
debian: Add myself (David Bremner) as an uploader

This avoids having to mark every upload as a non-maintainer upload.
(cherry picked from commit e849851d2d38cbf985f3fd884226100b93f3044f)

12 years agodebian: Incorporate changelog entries from post 0.5 uploads
David Bremner [Sat, 28 May 2011 10:03:31 +0000 (07:03 -0300)]
debian: Incorporate changelog entries from post 0.5 uploads

These uploads added the timeout to the tests to fix build failures.
(cherry picked from commit 0901faabd90a689728d8079b3163bd76b29d29aa)

12 years agoemacs: Show all multipart/alternative parts by default.
Jameson Graef Rollins [Thu, 23 Jun 2011 01:14:12 +0000 (18:14 -0700)]
emacs: Show all multipart/alternative parts by default.

This is patch is a temporary work-around for a slight regression that
popped up in the part handling reorganization.  Currently, text/plain
parts are always preferred, if present, over other non-text/plain
parts in multipart/alternative.  However, this means that if there is
a blank text/plain part, no content will be displayed.

One way to get around this is to set the
"notmuch-show-all-multipart/alternative-parts" customization variable
to True ('t'), which will cause all parts to always be displayed.

Since we want to move forward with the next release, we're going to
set this variable true by default, to make sure that no content is
unretrievably hidden from the user.  Once we come up with a better
solution for easy display of hidden parts we can set this back to a
default value of 'nil'.

12 years agosmtp-dummy: Prefer return rather than exit() in main.
Carl Worth [Tue, 21 Jun 2011 21:54:10 +0000 (14:54 -0700)]
smtp-dummy: Prefer return rather than exit() in main.

The main() function should be written as just another function with a
return value. This allows for more reliable code reuse. Imagine that
main() grows too large and needs to be factored into multiple
functions. At that point, exit() is probably the wrong thing, yet can
also be hard to notice as it's in less-frequently-tested exceptional
cases.

12 years agoFix compilation warnings in test/smtp-dummy.c.
Dmitry Kurochkin [Thu, 16 Jun 2011 10:32:08 +0000 (14:32 +0400)]
Fix compilation warnings in test/smtp-dummy.c.

* Remove unused variables in main(): buf, bytes and greeting.
* Replace return with no value in main() with exit(3).

12 years agodebian: Generate version from debian/changelog
David Bremner [Tue, 21 Jun 2011 12:03:19 +0000 (09:03 -0300)]
debian: Generate version from debian/changelog

This avoids patching the version file once per Debian upload.
Original version file is saved and restored.
(cherry picked from commit 2938a98bf4c4abe0426caee4555d889d655bc0df)

12 years agotests: Add optional use of timeout utility, if present.
David Bremner [Sat, 28 May 2011 09:50:11 +0000 (06:50 -0300)]
tests: Add optional use of timeout utility, if present.

Each top level test (basic, corpus, etc...) is run with a fixed
timeout of 2 minutes.

The goal here is to treat a hung test as a failure. The emacs test for
sending mail is known to be problematic on the Debian
autobuilders. This is both a bandaid fix for that, and a sensible long
term feature.
(cherry picked from commit 5f99c80e02736c90495558d9b88008a768876b29)

12 years agoDo not import notmuch in setup.py.
David Bremner [Sun, 19 Jun 2011 19:53:43 +0000 (16:53 -0300)]
Do not import notmuch in setup.py.

Importing notmuch loads the notmuch shared library. When building
without a system install of notmuch, this requires e.g. setting
LD_LIBRARY_PATH for building and fails completely for cleaning.

12 years agoSimplify (& fix) Message().__str__()
Sebastian Spaeth [Thu, 16 Jun 2011 15:33:47 +0000 (17:33 +0200)]
Simplify (& fix) Message().__str__()

We were still using len(self.get_replies()) for the __str__ summary of a
mail, but 1) len(Messages()) has just gone away 2) the number of replies
can not be retrieved when we got the message via search_messages()
anyway, and 3) it is likely quite expensive to pull all replies for all
messages that we display a summary of.

So we fix this by simplifying str(Message()) to omit the number of replies.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
12 years agopython: Bulletproof Database() path parameter
Sebastian Spaeth [Thu, 16 Jun 2011 13:51:13 +0000 (15:51 +0200)]
python: Bulletproof Database() path parameter

libnotmuch (and python) crashed when I accidently passed in an invalid
value as path argument to the Database() instantiation.

Therefore, we now check via assert that the handed in path is actually a
real string (or None).

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
12 years agopython: Improve API documentation
Sebastian Spaeth [Thu, 16 Jun 2011 13:41:48 +0000 (15:41 +0200)]
python: Improve API documentation

Various API doc cleanups and improvements. No code change.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
12 years agoImplement Message.tags_to_maildir_flags
Sebastian Spaeth [Thu, 16 Jun 2011 12:41:02 +0000 (14:41 +0200)]
Implement Message.tags_to_maildir_flags

and also maildir_flags_to_tags. The methods will be invoked by
db.add_message() and also (if not overridden via function parameter) by
add|remove_tag and remove_all_tags. Documentation on the usage has been
updated.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
12 years agopython: Improve documentation
Sebastian Spaeth [Wed, 15 Jun 2011 19:36:26 +0000 (21:36 +0200)]
python: Improve documentation

Improve the documentation with regard to the new __cmp__ and __hash__
methods and the implications of doing set arithmetic with Messages()
objects.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
12 years agoFix indentation in guess_from_received_header().
Dmitry Kurochkin [Wed, 15 Jun 2011 11:12:14 +0000 (15:12 +0400)]
Fix indentation in guess_from_received_header().

12 years agoFix memory leak in guess_from_received_header().
Dmitry Kurochkin [Wed, 15 Jun 2011 11:12:13 +0000 (15:12 +0400)]
Fix memory leak in guess_from_received_header().

Mta variable was not free()d in one case.

12 years agoFix double free in guess_from_received_header().
Dmitry Kurochkin [Wed, 15 Jun 2011 11:12:12 +0000 (15:12 +0400)]
Fix double free in guess_from_received_header().

Before the change, the last loop in guess_from_received_header()
did not reset domain and tld variables to NULL.  This leads to
double free error in some cases and possibly other bugs.

12 years agoSimplify message and headers visibility code in notmuch-show view.
Dmitry Kurochkin [Wed, 25 May 2011 22:10:16 +0000 (02:10 +0400)]
Simplify message and headers visibility code in notmuch-show view.

Before the change, headers and message visibility functions took
extra care to correctly set `buffer-invisibility-spec'.  This was
needed because headers overlay `invisible' property had only
headers' invisibility spec.  So visibility of headers was
determined only by the headers invisibility spec.  The patch sets
headers overlay `invisible' property a list with both the headers
and the message invisibility spec.  This makes headers invisible
if either of them is added to the `buffer-invisibility-spec' and
allows to simplify the code.

12 years agoSet higher priority for headers and hidden citation overlays.
Dmitry Kurochkin [Wed, 25 May 2011 22:10:15 +0000 (02:10 +0400)]
Set higher priority for headers and hidden citation overlays.

Before the patch, message, headers and hidden citation overlays
had zero priority.  All these overlay have `invisible' property.
Emacs documentation says that we should not make assumptions
about which overlay will prevail when they have the same priority
[1].  It happens to work as we need, but we should not rely on
undocumented behavior.

[1] http://www.gnu.org/s/emacs/manual/html_node/elisp/Overlay-Properties.html

12 years agoFix hiding a message while some citations are shown in notmuch-show view.
Dmitry Kurochkin [Wed, 25 May 2011 22:10:14 +0000 (02:10 +0400)]
Fix hiding a message while some citations are shown in notmuch-show view.

Before the change, message and citation invisibility overlays
conflicted: if some citation is made visible and then the whole
message is hidden, that citation remained visible.  This happened
because the citation's overlay has an invisible property which
takes priority over the message overlay.  The message
invisibility spec does not affect citation visibility, it is
determined solely by the citation overlay invisibility spec.
Hence, if citation is made visible, it is not hidden by message
invisibility spec.

The patch changes citation overlay invisibility property to be a
list which contains both the citation and the message
invisibility specs.  This makes the citation invisible if either
of them is added to the `buffer-invisibility-spec'.  Note that
all citation visibility states are "restored" when the message
hidden and shown again.

12 years agoSet message invisibility spec properties before inserting the body.
Dmitry Kurochkin [Wed, 25 May 2011 22:10:13 +0000 (02:10 +0400)]
Set message invisibility spec properties before inserting the body.

This would allow body-inserting code (in particular, wash
button-inserting code) to use message invisibility specs.

12 years agoPass message to the `notmuch-show-insert-text/plain-hook' hook.
Dmitry Kurochkin [Wed, 25 May 2011 22:10:12 +0000 (02:10 +0400)]
Pass message to the `notmuch-show-insert-text/plain-hook' hook.

Before the change, the `notmuch-show-insert-text/plain-hook' was
given only the `depth' argument.  The patch adds another one -
the message.  Currently, the new message argument is not used by
any on the hooks.  But it will be used later to get access to
message invisibility specs when wash buttons are inserted.

12 years agoWorkaround for Emacs bug #8721.
Dmitry Kurochkin [Sat, 28 May 2011 01:29:17 +0000 (05:29 +0400)]
Workaround for Emacs bug #8721.

The emacs bug is that isearch cannot search through invisible text
when the 'invisible' property is a list.

The patch adds `notmuch-isearch-range-invisible' function which
is the same as `isearch-range-invisible' but with fixed Emacs bug
 #8721.  Advice added for `isearch-range-invisible' which calls
`notmuch-isearch-range-invisible' instead of the original
`isearch-range-invisible' when in `notmuch-show-mode'.

12 years agotest emacs: Add tests for hiding messages in notmuch-show view
Dmitry Kurochkin [Thu, 26 May 2011 21:38:34 +0000 (01:38 +0400)]
test emacs: Add tests for hiding messages in notmuch-show view

This test is expected to fail as it exposes a current bug, (which we
hope to fix soon).

12 years agopython: Implement Message.__cmp__ and __hash__
Sebastian Spaeth [Wed, 15 Jun 2011 13:05:47 +0000 (15:05 +0200)]
python: Implement Message.__cmp__ and __hash__

We can now do: if msg1 == msg2, and we can use set arithmetic on
Messages():
  s1, s2= msgs1, msgs2
  s1.union(s2)
  s2 -= s1

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
12 years agopython: Remove Messages().__len__
Sebastian Spaeth [Wed, 15 Jun 2011 12:25:33 +0000 (14:25 +0200)]
python: Remove Messages().__len__

Messages.__len__() exhausted the iterator and list() inherently calls
len(), so we could not invoke list(msgs) without getting errors. Fix
this by implementing __nonzero__ but removing __len__ on Messages.

Use Query.count_messages() or len(list(msgs)) if you need to know the
number.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
12 years agotest: Fix from-guessing to actually span Received headers over multiple lines
Carl Worth [Sat, 11 Jun 2011 00:18:27 +0000 (17:18 -0700)]
test: Fix from-guessing to actually span Received headers over multiple lines

The intent was always to make these Received headers span multiple
lines. But the escapes were causing the shell to ignore the newlines,
so that the result instead was long Received headers on a single line
each.

Fixing the intent here doesn't actually change the test-suite results
at all.

12 years agoFix appending of Received headers
Stewart Smith [Tue, 17 May 2011 02:10:32 +0000 (12:10 +1000)]
Fix appending of Received headers

We're not properly concatenating the Received headers if we parse them
while requesting a header that isn't Received.

this fixes notmuch-reply address detection in a bunch of situations.

12 years agotest: Extend from-guessing test with a test with multiple Received headers
Carl Worth [Fri, 10 Jun 2011 23:53:45 +0000 (16:53 -0700)]
test: Extend from-guessing test with a test with multiple Received headers

This is much more realistic, as most messages in the wild will have multiple
Received headers. Also, this demonstrates a current bug in the Received
header parsing, (multiple Received headers are not properly concatenated
depending on the order in which headers are parsed in a message).