]> rtime.felk.cvut.cz Git - notmuch.git/log
notmuch.git
13 years agocrypto: fix internal variable/function names for consistency crypto jrollins/crypto
Jameson Rollins [Wed, 9 Mar 2011 17:39:57 +0000 (09:39 -0800)]
crypto: fix internal variable/function names for consistency

13 years agocrypto: break out encstatus button from notmuch-show.el
Jameson Rollins [Wed, 9 Mar 2011 18:04:30 +0000 (10:04 -0800)]
crypto: break out encstatus button from notmuch-show.el

13 years agocrypto: break out low-level crypto function into a separate crypto library
Jameson Rollins [Wed, 9 Mar 2011 08:58:54 +0000 (00:58 -0800)]
crypto: break out low-level crypto function into a separate crypto library

There is a fairly clean feature separation here, and there will be
more crypto functions to come, so this seemed logical.

13 years agocrypto: change customization variable name again
Jameson Rollins [Wed, 9 Mar 2011 08:49:16 +0000 (00:49 -0800)]
crypto: change customization variable name again

I sweat this is the last time.  I realized that it makes more sense to
scope the name space a bit, as I now realize there will be more crypto
function and customizations to come.  This commit precedes the
breaking out of the existing crypto functions in to their own
libraries.

13 years agoemacs: change name of notmuch-process-crypto-mime variable
Jameson Rollins [Sat, 5 Mar 2011 23:40:44 +0000 (15:40 -0800)]
emacs: change name of notmuch-process-crypto-mime variable

This changes the customization variable from "notmuch-process-pgpmime"
to "notmuch-process-crypto-mime".  There is indication that gmime will
soon support crypto operations on s/mime parts, with the same crypto
context that is currently being used for pgp/mime.  This means we
should be able to support s/mime crypto operations with the same code.
For this reason it's better to use a more general name for this
variable.

Sorry to the early adopters!

13 years agofix test suite for signed/encrypted tags
Jameson Rollins [Sat, 5 Mar 2011 07:59:19 +0000 (23:59 -0800)]
fix test suite for signed/encrypted tags

13 years agotag signed/encrypted during notmuch new
Jameson Rollins [Sat, 5 Mar 2011 07:55:33 +0000 (23:55 -0800)]
tag signed/encrypted during notmuch new

This patch adds the tag "signed" to messages with any multipart/signed
parts, and the tag "encrypted" to messages with any
multipart/encrypted parts.  This only occurs when messages are indexed
during notmuch new, so a database rebuild is required to have old
messages tagged.

Breaks test suite until next commit.

13 years agoemacs: add comment to notmuch-process-pgpmime help
Jameson Rollins [Sat, 5 Mar 2011 07:54:36 +0000 (23:54 -0800)]
emacs: add comment to notmuch-process-pgpmime help

13 years agotest: reduce "greediness" of regexp match in notmuch_json_show_sanitize function
Jameson Rollins [Tue, 8 Feb 2011 09:06:06 +0000 (01:06 -0800)]
test: reduce "greediness" of regexp match in notmuch_json_show_sanitize function

13 years agomajor improvements to crypto tests
Jameson Rollins [Tue, 8 Feb 2011 01:49:14 +0000 (17:49 -0800)]
major improvements to crypto tests

Reworked crypto tests to use encrypted/signed messages generated by
emacs, and added tests for:

* signing/verification
* signing/verification with full owner trust
* verification with signer key unavailable
* encryption/decryption
* decryption failure with missing key
* encryption/decryption + signing/verfifying
* reply to encrypted message
* verification of signature from revoked key

13 years agoemacs: cleanup sig/encstatus parsing
Jameson Rollins [Fri, 4 Feb 2011 20:41:58 +0000 (12:41 -0800)]
emacs: cleanup sig/encstatus parsing

No functional change.

13 years agoemacs: don't show sigstatus button for encrypted messages with no sigstatus
Jameson Rollins [Fri, 4 Feb 2011 20:36:30 +0000 (12:36 -0800)]
emacs: don't show sigstatus button for encrypted messages with no sigstatus

13 years agoemacs: add support for decrypting messages in reply
Jameson Rollins [Fri, 4 Feb 2011 19:46:14 +0000 (11:46 -0800)]
emacs: add support for decrypting messages in reply

13 years agoemacs: rename conf var to be "notmuch-process-pgpmime"
Jameson Rollins [Fri, 4 Feb 2011 19:43:12 +0000 (11:43 -0800)]
emacs: rename conf var to be "notmuch-process-pgpmime"

This changes the conf variable for pgp/mime processing from
"notmuch-show-process-pgpmime" to "notmuch-process-pgpmime".  This is
done to make the scope of the variable widier so that it can be more
easily used in other modes other than show (such as reply).

Sorry to the early adopters for this change!

13 years agosmall tweak to man page formatting
Jameson Rollins [Fri, 4 Feb 2011 19:37:27 +0000 (11:37 -0800)]
small tweak to man page formatting

13 years agodecrypt encrypted messages in reply
Jameson Rollins [Fri, 4 Feb 2011 19:24:53 +0000 (11:24 -0800)]
decrypt encrypted messages in reply

This adds a new option to notmuch-reply to support decrypting
encrypted messages that are being replied to.

13 years agomoved gmime session boilerplate out to its own file for easier re-use
Daniel Kahn Gillmor [Thu, 3 Feb 2011 21:57:51 +0000 (16:57 -0500)]
moved gmime session boilerplate out to its own file for easier re-use

13 years agoemacs: add support for PGP/MIME verification/decryption
Jameson Rollins [Wed, 2 Feb 2011 23:49:12 +0000 (15:49 -0800)]
emacs: add support for PGP/MIME verification/decryption

This adds a new emacs configuration variable
"notmuch-show-process-pgpmime".  When this is set true, notmuch-query
will use the notmuch show --decrypt flag to decrypt encrypted messages
and/or calculate the sigstatus of signed messages.  If sigstatus is
available, notmuch-show will place a specially color-coded header at
the begining of the signed message.

Also included is the ability to switch decryption/verification on/off
on the fly, which is bound to M-RET in notmuch-search-mode.

13 years agooutput signer user ID if validity is full or ultimate
Jameson Rollins [Wed, 2 Feb 2011 23:24:01 +0000 (15:24 -0800)]
output signer user ID if validity is full or ultimate

This means that if the userid is included in the json output then it
has full or ultimate validity.  If the userid is not included that
means the userid has less than full validity, and we should be doing
something else to determine validity (probably of the From: name of
the message).

13 years agoAdd man page entries for --verify and --decrypt
Jameson Rollins [Wed, 2 Feb 2011 19:22:48 +0000 (11:22 -0800)]
Add man page entries for --verify and --decrypt

13 years agoadd signature-verification and decryption tests ("crypto")
Jameson Rollins [Wed, 2 Feb 2011 19:15:00 +0000 (11:15 -0800)]
add signature-verification and decryption tests ("crypto")

This adds a new "crypto" test script to the test suite to test
PGP/MIME signature verification and message decryption.  Included here
is a test GNUPGHOME with a test secret key (passwordless).  Two test
messages are generated: one signed by this key, and another encrypted
to this key (also with signature).  The test then checks the output of
"--format=json --verify" and "--format=json --decrypt" respectively.

13 years agoadd decryption/verification of PGP/MIME-encrypted mails to notmuch show --format...
Jameson Rollins [Mon, 31 Jan 2011 20:23:59 +0000 (12:23 -0800)]
add decryption/verification of PGP/MIME-encrypted mails to notmuch show --format=json

If specified, the format_part_json function will decrypt the encrypted
part, check signature validity, and run format_part_json on the newly
decrypted part and return.  The decryption status is reported in a new
"decstatus" json field.

NOTE: If the decrypted part is itself multipart then the decrypted
message will have a *different* number of parts than the undecrypted
message.

No support in the emacs UI yet.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agorename "verifyctx" parameter to be "cryptoctx"
Jameson Rollins [Mon, 31 Jan 2011 20:14:57 +0000 (12:14 -0800)]
rename "verifyctx" parameter to be "cryptoctx"

This parameter can (and will) be used for decryption as well, so we
give it a more general name.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agorepurpose verify_part_json function to instead act on GMimeSignatureValidity
Jameson Rollins [Mon, 31 Jan 2011 20:05:51 +0000 (12:05 -0800)]
repurpose verify_part_json function to instead act on GMimeSignatureValidity

The sig validity checking and error handling is moved outside of the
function, and the renamed function ("format_sigstatus_json") now just
handles formatting the sigstatus output.

This is in preparation for decryption handling, which handles
signature checking slightly differently but can now also use this
repurposed function.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agoremove errant newline from json --verify output
Jameson Rollins [Mon, 20 Dec 2010 04:25:10 +0000 (23:25 -0500)]
remove errant newline from json --verify output

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agoadds signature verification for PGP/MIME-signed mails to notmuch show --format=json...
Daniel Kahn Gillmor [Sat, 27 Nov 2010 19:06:37 +0000 (14:06 -0500)]
adds signature verification for PGP/MIME-signed mails to notmuch show --format=json (emacs frontend cannot yet interpret them)

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agoadded local coding style rules for emacs
Daniel Kahn Gillmor [Wed, 24 Nov 2010 05:45:43 +0000 (00:45 -0500)]
added local coding style rules for emacs

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agoupdate help text for notmuch show
Daniel Kahn Gillmor [Wed, 24 Nov 2010 05:23:36 +0000 (00:23 -0500)]
update help text for notmuch show

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agoadjusted test emacs output to show the mime structure now that we have MIME structure...
Daniel Kahn Gillmor [Wed, 24 Nov 2010 00:57:19 +0000 (19:57 -0500)]
adjusted test emacs output to show the mime structure now that we have MIME structure in the JSON.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agoclean up expected emacs output to reflect cleaner from lines introduced in 78d6c196d90
Daniel Kahn Gillmor [Wed, 24 Nov 2010 00:07:20 +0000 (19:07 -0500)]
clean up expected emacs output to reflect cleaner from lines introduced in 78d6c196d90

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agonormalizing id numbers across json and text formats from notmuch show
Daniel Kahn Gillmor [Tue, 23 Nov 2010 23:43:39 +0000 (18:43 -0500)]
normalizing id numbers across json and text formats from notmuch show

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agoremove extra newlines in json output
Daniel Kahn Gillmor [Tue, 23 Nov 2010 23:37:00 +0000 (18:37 -0500)]
remove extra newlines in json output

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agoemacs: Fix message/rfc822 insertion to match updated multipart
David Edmondson [Wed, 26 May 2010 13:45:50 +0000 (14:45 +0100)]
emacs: Fix message/rfc822 insertion to match updated multipart
       implementation.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agonotmuch: Replace the `part' command with `show --format=part'.
David Edmondson [Wed, 19 May 2010 13:17:14 +0000 (14:17 +0100)]
notmuch: Replace the `part' command with `show --format=part'.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agomultipart: Fix part counting.
David Edmondson [Wed, 19 May 2010 11:07:24 +0000 (12:07 +0100)]
multipart: Fix part counting.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agoemacs: Show cleaner `From:' addresses in the summary line.
David Edmondson [Wed, 19 May 2010 10:21:05 +0000 (11:21 +0100)]
emacs: Show cleaner `From:' addresses in the summary line.

Remove double quotes and flatten "foo@bar.com <foo@bar.com>" to
"foo@bar.com".

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agoemacs: Add `notmuch-show-elide-same-subject', controlling the
David Edmondson [Wed, 19 May 2010 09:41:08 +0000 (10:41 +0100)]
emacs: Add `notmuch-show-elide-same-subject', controlling the
appearance of collapse messages in notmuch-show mode.

Remove `notmuch-show-always-show-subject'.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agoemacs: Add `notmuch-show-always-show-subject', allowing control over
David Edmondson [Tue, 18 May 2010 08:36:58 +0000 (09:36 +0100)]
emacs: Add `notmuch-show-always-show-subject', allowing control over
the display of collapsed messages.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agoemacs: Allow the primary renderer of multipart/related parts access to
David Edmondson [Mon, 17 May 2010 12:43:51 +0000 (13:43 +0100)]
emacs: Allow the primary renderer of multipart/related parts access to
non-primary parts.

Typically used to allow a `text/html' renderer access to images which
are sent along with the HTML.

Not enabled by default, run `notmuch-show-setup-w3m' for it to take
effect.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agoemacs: Optionally show all parts in multipart/alternative.
David Edmondson [Mon, 17 May 2010 12:41:12 +0000 (13:41 +0100)]
emacs: Optionally show all parts in multipart/alternative.

Add a variable `notmuch-show-all-multipart/alternative-parts' that
allows the user to indicate that all candidate sub-parts of a
multipart/alternative part should be shown rather than just the
preferred part. The default is `nil', showing only the preferred part.

This is mostly a debugging aid.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agonotmuch: Add the content-id of a part to the JSON output if it is known.
David Edmondson [Mon, 17 May 2010 12:38:06 +0000 (13:38 +0100)]
notmuch: Add the content-id of a part to the JSON output if it is known.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agomultipart: Recurse through multiparts when generating a reply.
David Edmondson [Thu, 13 May 2010 08:41:17 +0000 (09:41 +0100)]
multipart: Recurse through multiparts when generating a reply.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agomultipart: Don't JSON quote strings in text output.
David Edmondson [Thu, 13 May 2010 08:40:56 +0000 (09:40 +0100)]
multipart: Don't JSON quote strings in text output.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agoemacs: Render text/x-vcalendar parts.
David Edmondson [Wed, 12 May 2010 08:07:49 +0000 (09:07 +0100)]
emacs: Render text/x-vcalendar parts.

Use code from icalendar.el to convert text/x-vcalendar parts to
something suitable for use with the Emacs diary.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agomultipart: Allow indentation of multipart children.
David Edmondson [Mon, 10 May 2010 10:15:30 +0000 (11:15 +0100)]
multipart: Allow indentation of multipart children.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agomultipart: Add `notmuch-show-multipart/alternative-discouraged'.
David Edmondson [Mon, 10 May 2010 10:03:08 +0000 (11:03 +0100)]
multipart: Add `notmuch-show-multipart/alternative-discouraged'.
multipart: Improved implementation of indication of which parts are
not shown.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agomultipart: Remove spurious double Subject: from JSON output.
David Edmondson [Mon, 10 May 2010 09:42:07 +0000 (10:42 +0100)]
multipart: Remove spurious double Subject: from JSON output.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agomultipart: Fix text output.
David Edmondson [Mon, 10 May 2010 09:41:49 +0000 (10:41 +0100)]
multipart: Fix text output.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agomultipart: Catch up with the extra argument to show_part functions.
David Edmondson [Mon, 10 May 2010 09:41:31 +0000 (10:41 +0100)]
multipart: Catch up with the extra argument to show_part functions.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agoImproved MIME support.
David Edmondson [Mon, 10 May 2010 09:25:15 +0000 (10:25 +0100)]
Improved MIME support.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
13 years agopython: Remove completed TODO item amdragon/master jrollins/master origin/HEAD origin/master t/emacs-what-is-in-your-inbox t/tag-by-list-id
James Vasile [Wed, 16 Mar 2011 09:13:26 +0000 (10:13 +0100)]
python: Remove completed TODO item

Really just a left-over TODO item in the code, nothing spectacular to
see here.

Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>
13 years agoemacs: Define notmuch-search-process-filter-data before first use.
Carl Worth [Fri, 11 Mar 2011 01:59:53 +0000 (17:59 -0800)]
emacs: Define notmuch-search-process-filter-data before first use.

To avoid a wraning about a reference to a free variable when compiling.

13 years agoemacs: Don't drop error messages from "notmuch search"
Carl Worth [Fri, 11 Mar 2011 00:53:46 +0000 (16:53 -0800)]
emacs: Don't drop error messages from "notmuch search"

With the previous commit, unexpected output before or between search results
would be displayed. However, trailing junk from the "notmuch search" output
would still be silently swallowed.

The most common case for an error message from "notmuch search" would be
an invalid command-line, and in that case, there would be no search results
and the trailing error message would get swallowed.

We fix the process sentinel to check for leftover data and add it to the
final buffer. We also add a test case to ensure this works.

13 years agoemacs: Fix notmuch-search-process-filter to handle incomplete lines
Carl Worth [Thu, 10 Mar 2011 23:29:24 +0000 (15:29 -0800)]
emacs: Fix notmuch-search-process-filter to handle incomplete lines

This fixes the recently-added emacs-large-search-buffer test. This is
as simple as saving any trailing input and then pre-prepending it on
the next call.

MAny thanks to Thomas Schwinge <thomas@schwinge.name> for tracking
down this problem and contributing a preliminary version of this fix.

13 years agoemacs: Display any unexpected output from notmuch search
Carl Worth [Thu, 10 Mar 2011 23:18:40 +0000 (15:18 -0800)]
emacs: Display any unexpected output from notmuch search

Rather than silently swallowing unexpected output, the emacs interface will now
display it. This will allow error messages to actually arrive at the emacs
interface (though not in an especially pretty way). This also allows for easier
investigation of the inadvertent swallowing of search results that span page
boundaries (as demonstrated by the recent added emacs-large-search-buffer test).

The page-boundary bug has been present since a commit from 2009-11-24:
93af7b574598637c2766dd1f8ef343962c9a8efb

Many thanks to Thomas Schwinge for tracking that bug down and
contributing the test for it.

13 years agoRename/rewrite the new emacs-forgetfulness test (to emacs-large-search-buffer)
Carl Worth [Thu, 10 Mar 2011 21:22:04 +0000 (13:22 -0800)]
Rename/rewrite the new emacs-forgetfulness test (to emacs-large-search-buffer)

The new name is more descriptive of the bug being tested. Also, the test
is rewritten slightly so that it's much more plain to see how the bug
manifests itself, (that messages are droped from the emacs result at
regular intervals). Primarily, this is by collapsing the large blobs
used to inflate the message subjects.

13 years agoNew test: Emacs' forgetfulness.
Thomas Schwinge [Wed, 2 Feb 2011 23:56:38 +0000 (00:56 +0100)]
New test: Emacs' forgetfulness.

Signed-off-by: Thomas Schwinge <thomas@schwinge.name>
13 years agonew: Update comments for add_files_recursive
Carl Worth [Thu, 10 Mar 2011 19:56:16 +0000 (11:56 -0800)]
new: Update comments for add_files_recursive

The most recent commit optimized the implementation of this
function. This commit simply updates the relevant comments to match
the new implementation.

13 years agonew: read db_files and db_subdirs only if mtime changed
Karel Zak [Fri, 4 Feb 2011 21:44:31 +0000 (22:44 +0100)]
new: read db_files and db_subdirs only if mtime changed

The db_files and db_subdirs are unnecessary for unchanged directories.

maildir with 10000 e-mails:

old version:
$ time ./notmuch new
No new mail.

real    0m0.053s
user    0m0.028s
sys     0m0.026s

new version:
$ time ./notmuch new
No new mail.

real    0m0.032s
user    0m0.009s
sys     0m0.023s

Signed-off-by: Karel Zak <kzak@redhat.com>
Reviewed-by: Austin Clements <amdragon@mit.edu>
Looks good (faster than, but provably equivalent to the original code!
notmuch_directory_get_child_* are side-effect free,
db_files/db_subdirs aren't used between where they were set in the old
code and where they are set in the new code, and db_files/db_subdirs
are initialized to NULL when declared).

Another timing data point:
Old code: ./notmuch new  0.77s user 0.28s system 99% cpu 1.051 total
New code: ./notmuch new  0.09s user 0.27s system 98% cpu 0.368 total

13 years agobuild: Save configure options and re-use them for automatic runs of configure
Carl Worth [Thu, 10 Mar 2011 19:30:06 +0000 (11:30 -0800)]
build: Save configure options and re-use them for automatic runs of configure

This supports the case of a user running "configure --prefix=/foo" then later
updating the soruce (including the configure script) and re-running make.

In this case, the make invocation will re-run configure. Before this change,
this run of configure would lose the user's carefully chosen prefix. This
is now fixed so that configrue is re-run with the user's options.

13 years agobuild: Fix a plain "make" to automatically run configure.
Carl Worth [Thu, 10 Mar 2011 19:29:13 +0000 (11:29 -0800)]
build: Fix a plain "make" to automatically run configure.

The recent change to support non-source-directory builds broke this case.

13 years agoMerge remote branch 'amdragon/search-perf-3'
Carl Worth [Thu, 10 Mar 2011 19:05:49 +0000 (11:05 -0800)]
Merge remote branch 'amdragon/search-perf-3'

13 years agobuild: Add support for non-source-directory builds.
Carl Worth [Wed, 9 Mar 2011 23:02:42 +0000 (15:02 -0800)]
build: Add support for non-source-directory builds.

Such as:

     mkdir build
     cd build
     ../configure
     make

This is implemented by having the configure script set a srcdir
variable in Makefile.config, and then sprinkling $(srcdir) into
various make rules. We also use vpath directives to convince GNU make
to find the source files from the original source directory.

13 years agoTODO: Add item for the build system to support a non-source-dir build
Carl Worth [Sun, 30 Jan 2011 19:30:07 +0000 (05:30 +1000)]
TODO: Add item for the build system to support a non-source-dir build

This would be a handy feature that many people would expect to just
work.

13 years agojson: Fix search result with no matches to be a valid json object.
Carl Worth [Sun, 30 Jan 2011 19:26:04 +0000 (05:26 +1000)]
json: Fix search result with no matches to be a valid json object.

In the original json code, search matching nothing would return a
valid, empty json array (that is, "[]"). I broke this in commit
6dcb7592e32ed5140ea0c0357ce78d6a37af6066 when adding support for
--output=threads|messages|tags. This time, while fixing the bug also
add a test to the test suite to help avoid future regressions.

13 years agotest: Rename and clarify the search-lwn test
Carl Worth [Fri, 28 Jan 2011 20:21:25 +0000 (06:21 +1000)]
test: Rename and clarify the search-lwn test

Now that we understand the bug here, we rename this test to
search-insufficient-from-quoting to clarify the bug being exercised,
(which occurs when the From: line contains an unquoted '.' character).

We also mark these tests as expected failures until the bug gets fixed.

13 years agosearch: Move lwn tests into their own file.
Carl Worth [Fri, 28 Jan 2011 19:39:21 +0000 (05:39 +1000)]
search: Move lwn tests into their own file.

Since it's much easier to debug and fix these if they can be run on
their own.

13 years agoAdd a few tests for searching LWN emails.
Thomas Schwinge [Thu, 27 Jan 2011 10:31:49 +0000 (03:31 -0700)]
Add a few tests for searching LWN emails.

These tests should pass -- but they currently don't.

Signed-off-by: Thomas Schwinge <thomas@schwinge.name>
13 years agoupdate for go-release-2011-02-01:
Sebastien Binet [Thu, 3 Feb 2011 08:36:58 +0000 (09:36 +0100)]
update for go-release-2011-02-01:
  * M bindings/go/cmds/notmuch-addrlookup.go
    log.Exitf -> log.Fatalf

13 years agoruby: Add generated files to .gitignore
Ali Polatel [Wed, 2 Feb 2011 23:40:38 +0000 (01:40 +0200)]
ruby: Add generated files to .gitignore

13 years agoSimplify _notmuch_doc_id_set_init interface. amdragon/search-perf-3
Austin Clements [Mon, 31 Jan 2011 02:01:56 +0000 (21:01 -0500)]
Simplify _notmuch_doc_id_set_init interface.

Don't require the caller of _notmuch_doc_id_set_init to pass in a
correct bound; instead compute it from the array.  This simplifies the
caller and makes this interface easier to use correctly.

13 years agoRemove code repetition in the doc ID bitmap code.
Austin Clements [Mon, 31 Jan 2011 01:58:27 +0000 (20:58 -0500)]
Remove code repetition in the doc ID bitmap code.

Remove the repeated "sizeof (doc_ids->bitmap[0])" that bothered cworth
by instead defining macros to compute the word and bit offset of a
given bit in the doc ID set bitmap.

13 years agoClarify usage of `additional_headers' in test/test-lib.sh:generate_message. rtime/master rtime/top-bases/t/Fix-broken-headers-from-pandora.cz rtime/top-bases/t/emacs-what-is-in-your-inbox rtime/top-bases/t/reply-to-sender-only rtime/top-bases/t/tag-by-list-id
Thomas Schwinge [Thu, 27 Jan 2011 09:17:21 +0000 (02:17 -0700)]
Clarify usage of `additional_headers' in test/test-lib.sh:generate_message.

Signed-off-by: Thomas Schwinge <thomas@schwinge.name>
13 years agoemacs: send notmuch-query stderr to /dev/null
Jameson Rollins [Wed, 26 Jan 2011 20:57:50 +0000 (12:57 -0800)]
emacs: send notmuch-query stderr to /dev/null

The call-process to notmuch in notmuch-query.el was previously sending
stderr into the output buffer.  This means that if there is any stderr
the JSON parsing breaks.  Unfortunately call-process does not support
sending stderr to a separate buffer or to the minibuffer [0], but it
does support sending it to /dev/null.  So we do that here instead.

[0] a bug was filed against emacs (#7842)

13 years agonew: Print progress estimates only when we have sufficient information
Michal Sojka [Wed, 26 Jan 2011 13:06:57 +0000 (14:06 +0100)]
new: Print progress estimates only when we have sufficient information

Without this patch, it might happen that the remaining time or processing
rate were calculated just after start where nothing was processed yet.
This resulted into division by a very small number (or zero) and the
printed information was of little value.

Instead of printing nonsenses we print only that the operation is in
progress. The estimates will be printed later, after there is enough data.

13 years agoMakefile: Quote variables used as filenames in shell commands
Carl Worth [Wed, 26 Jan 2011 13:29:15 +0000 (23:29 +1000)]
Makefile: Quote variables used as filenames in shell commands

This allows support for filenames with spaces in them.

13 years agoconfigure: Drop global setting of IFS (without space in it).
Michal Sojka [Wed, 26 Jan 2011 13:13:21 +0000 (23:13 +1000)]
configure: Drop global setting of IFS (without space in it).

This was originally intended to help support filenames with spaces in
them, but this actually breaks things when someone sets a command with
a space in it, (such as CC="ccache cc").

Instead, we now only set a custom IFS when acting on the
newline-separated list of files from /sbin/ldconfig.

13 years agoemacs: View the output of pipe command when it fails
Michal Sojka [Sun, 23 Jan 2011 10:45:50 +0000 (11:45 +0100)]
emacs: View the output of pipe command when it fails

Previously, the user didn't know whether the pipe command succeeded or
not. It was only possible to find it out by manually inspecting
the work done (or not done) by the command or by manually switching to
*notmuch-pipe* buffer and determine it from command output. For this
the user had to first find the text corresponding to the last run of
pipe command as the buffer accumulated the output from all pipe commands.

This patch changes the following. The *notmuch-pipe* buffer is erased
before every pipe command so it contains only the output from the last
command. Additionally, when the command failed, the *notmuch-pipe* buffer
is shown and an error message is displayed.
with the output of pipe command.

13 years agotest: Make it easier to resolve conflicts when adding new tests
Michal Sojka [Sun, 23 Jan 2011 11:12:24 +0000 (12:12 +0100)]
test: Make it easier to resolve conflicts when adding new tests

Currently, there are two places in the test framework that contain very
long list on a single line. Whenever a test is added (or changed) in
several branches and these branches are merged, it results in conflict
which is hard to resolve because one has to go through the whole long
line to find where the conflict is.

This patch splits these long lists to several lines so that the
conflicts are easier to resolve.

13 years agoFix installation of zsh completion
Michal Sojka [Sun, 23 Jan 2011 20:57:07 +0000 (21:57 +0100)]
Fix installation of zsh completion

13 years agoconfigure: add options to disable emacs/zsh/bash and choose install dir.
Cédric Cabessa [Sun, 23 Jan 2011 13:33:43 +0000 (14:33 +0100)]
configure: add options to disable emacs/zsh/bash and choose install dir.

add --bashcompletiondir and --zshcompletiondir (like --emacslispdir) to choose
installation dir for bash/zsh completion files

Make some features optional:
  --without-emacs / --with-emacs=no do not install lisp file
  --without-bash-completion / --with-bash-completion=no  do not install bash
files
  --without-zsh-completion / --with-zsh-completion=no do not install zsh files
By default, everything is enabled. You can reenable something with
  --with-feature=yes

13 years agonew: Enhance progress reporting
Michal Sojka [Fri, 21 Jan 2011 09:59:37 +0000 (10:59 +0100)]
new: Enhance progress reporting

notmuch new reports progress only during the "first" phase when the
files on disk are traversed and indexed. After this phase, other
operations like rename detection and maildir flags synchronization are
performed, but the user is not informed about them. Since these
operations can take significant time, we want to inform the user about
them.

This patch enhances the progress reporting facility that was already
present. The timer that triggers reporting is not stopped after the
first phase but continues to run until all operations are finished. The
rename detection and maildir flag synchronization are enhanced to report
their progress.

13 years agonew: Add all initial tags at once
Michal Sojka [Fri, 21 Jan 2011 09:59:36 +0000 (10:59 +0100)]
new: Add all initial tags at once

If there are several tags applied to the new messages, it is beneficial
to store them to the database at one, because it saves some time,
especially when the notmuch new is run for the first time.

This patch decreased the time for initial import from 1h 35m to 1h 14m.

13 years agoDo not defer maildir flag synchronization for new messages
Austin Clements [Wed, 26 Jan 2011 11:52:54 +0000 (21:52 +1000)]
Do not defer maildir flag synchronization for new messages

This is a simplified version of a patch originally by Michal Sojka
<sojkam1@fel.cvut.cz> which is designed to have the same performance
benefits. Michal said the following:

  When notmuch new is run for the first time, it is not necessary to
  defer maildir flags synchronization to later because we already know
  that no files will be removed.

  Performing the maildinr flag synchronization immediately after the
  message is added to the database has the advantage that the message
  is likely hot in the disk cache so the synchronization is faster.
  Additionally, we also save one database query for each message,
  which must be performed when the operation is deferred.

  Without this patch, the first notmuch new of 200k messages (3 GB)
  took 1h and 46m out of which 20m was maildir flags
  synchronization. With this patch, the whole operation took only 1h
  and 36m.

Unlike Michal's patch, this version does the deferral for any new
message, rather than doing it only on the first run of "notmuch new".

13 years agovim: Get user email address from notmuch config file.
Peter John Hartman [Wed, 26 Jan 2011 06:57:12 +0000 (16:57 +1000)]
vim: Get user email address from notmuch config file.

Here's a bitty patch to the vim plugin; it now calculates the primary email
of the user based on a call to notmuch config.  There's still a lot of work
that needs to get done on notmuch.vim, e.g., the ability to have multiple
emails/accounts.

13 years agolib: Save and restore term position in message while indexing.
Carl Worth [Wed, 26 Jan 2011 05:53:14 +0000 (15:53 +1000)]
lib: Save and restore term position in message while indexing.

This fixes the recently addead search-position-overlap bug as
demonstrated in the test of the same name.

13 years agoAdd test demonstrating a position overlap bug.
Carl Worth [Wed, 26 Jan 2011 05:19:31 +0000 (15:19 +1000)]
Add test demonstrating a position overlap bug.

Currently, whenever we call index_terms multiple times for a single
field, the term generator is being reset to position 0 each time. This
means that with text such as:

To: a@b.c, x@y.z

one can get a bogus match by searching for:

To: a@y.c

Thanks to Mark Anderson for reporting the bug, (and providing a nice,
minimal test case that inspired what is used here).

13 years agonotmuch search: Clean up some memory leaks during search loop.
Carl Worth [Tue, 25 Jan 2011 13:40:35 +0000 (23:40 +1000)]
notmuch search: Clean up some memory leaks during search loop.

With talloc, we were already freeing all memory by the time we exited
the loop, but that didn't help with excess use of memory inside the
loop, (which was mostly from tallocing some objects with the incorrect
parent).

Thanks to Andrew Tridgell for sitting next to me and teaching me to
use talloc_report_full to find these leaks.

13 years agoMigrate to goconfig pkg
Sebastien Binet [Thu, 16 Dec 2010 22:13:09 +0000 (23:13 +0100)]
Migrate to goconfig pkg

13 years agobindings/go: Add a todo file
Sebastien Binet [Wed, 10 Nov 2010 17:27:04 +0000 (18:27 +0100)]
bindings/go: Add a todo file

13 years agoA minor, cosmetic change
Sebastien Binet [Wed, 10 Nov 2010 17:24:14 +0000 (18:24 +0100)]
A minor, cosmetic change

Just trying to keep the line lengths in check.

13 years agoInitial import of Go bindings for notmuch
Sebastien Binet [Wed, 10 Nov 2010 17:18:44 +0000 (18:18 +0100)]
Initial import of Go bindings for notmuch

13 years agoTODO: Note that folder: has now been implemented.
Carl Worth [Thu, 20 Jan 2011 01:04:10 +0000 (17:04 -0800)]
TODO: Note that folder: has now been implemented.

This feature has been mentioned in the TODO file (more than once) for
quite some time now.

13 years agoruby: Add wrapper for message_get_filenames
Ali Polatel [Mon, 10 Jan 2011 14:03:31 +0000 (16:03 +0200)]
ruby: Add wrapper for message_get_filenames

13 years agoruby: Add wrappers for maildir sync. interface
Ali Polatel [Mon, 10 Jan 2011 14:02:43 +0000 (16:02 +0200)]
ruby: Add wrappers for maildir sync. interface

New wrappers:
notmuch_message_maildir_flags_to_tags(): MESSAGE.maildir_flags_to_tags
notmuch_message_tags_to_maildir_flags(): MESSAGE.tags_to_maildir_flags

13 years agoruby: Add wrappers for query_get_s{ort,tring}
Ali Polatel [Mon, 10 Jan 2011 13:59:18 +0000 (15:59 +0200)]
ruby: Add wrappers for query_get_s{ort,tring}

New wrappers:
notmuch_query_get_sort(): QUERY.sort
notmuch_query_get_query_string(): QUERY.to_s

13 years agoAdd documentation for the recently added folder-based searching.
Carl Worth [Sat, 15 Jan 2011 22:18:45 +0000 (14:18 -0800)]
Add documentation for the recently added folder-based searching.

Augmenting both the builtin help as well as the manual page.

13 years agoAdd support for folder-based searching.
Carl Worth [Sat, 15 Jan 2011 22:09:04 +0000 (14:09 -0800)]
Add support for folder-based searching.

A new "folder:" prefix in the query string can now be used to match
the directories in which mail files are stored.

The addition of this feature causes the recently added
search-by-folder tests to now pass.

13 years agotest: Add new tests for folder-based searching.
Carl Worth [Sat, 15 Jan 2011 22:05:10 +0000 (14:05 -0800)]
test: Add new tests for folder-based searching.

This is a new feature which is not implemente yet, so these tests mostly
fail currently. A subsequent commit will add the feature and cause these
tests to start passing.

These tests verify that we can search for containing folders of mail files
by word or by phrase and that the search terms are updated correctly when
directories are renamed.

13 years agoFix misspelling in a comment.
Carl Worth [Sat, 15 Jan 2011 22:04:38 +0000 (14:04 -0800)]
Fix misspelling in a comment.

Just a simple change I noticed in passing.