]> git.notmuchmail.org Git - notmuch/log
notmuch
12 years agotag signed/encrypted during notmuch new
Jameson Graef Rollins [Thu, 26 May 2011 01:01:20 +0000 (18:01 -0700)]
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.

12 years agoemacs: Add support for PGP/MIME verification/decryption
Jameson Graef Rollins [Thu, 26 May 2011 01:01:19 +0000 (18:01 -0700)]
emacs: Add support for PGP/MIME verification/decryption

A new emacs configuration variable "notmuch-crypto-process-mime"
controls the processing of PGP/MIME signatures and encrypted parts.
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.

12 years agoAdd decryption of PGP/MIME-encrypted parts with --decrypt.
Jameson Graef Rollins [Thu, 26 May 2011 01:01:18 +0000 (18:01 -0700)]
Add decryption of PGP/MIME-encrypted parts with --decrypt.

This adds support for decrypting PGP/MIME-encrypted parts to
notmuch-show and notmuch-reply.  The --decrypt option implies
--verify.  Once decryption (and possibly signature verification) is
done, a new part_encstatus formatter is emitted, the part_sigstatus
formatter is emitted, and the entire multipart/encrypted part is
replaced by the contents of the encrypted part.

At the moment only a json part_encstatus formatting function is
available, even though decryption is done for all formats.  Emacs
support to follow.

12 years agoAdd signature verification of PGP/MIME-signed parts with --verify.
Jameson Graef Rollins [Thu, 26 May 2011 01:01:17 +0000 (18:01 -0700)]
Add signature verification of PGP/MIME-signed parts with --verify.

This is primarily for notmuch-show, although the functionality is
added to show-message.  Once signatures are processed a new
part_sigstatus formatter is emitted, and the entire multipart/signed
part is replaced with the contents of the signed part.

At the moment only a json part_sigstatus formatting function is
available.  Emacs support to follow.

The original work for this patch was done by

  Daniel Kahn Gillmor <dkg@fifthhorseman.net>

whose help with this functionality I greatly appreciate.

12 years agotest: add crypto tests for signature verification and decryption
Jameson Graef Rollins [Thu, 26 May 2011 01:01:16 +0000 (18:01 -0700)]
test: add crypto tests for signature verification and decryption

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), and test
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

These tests are not expected to pass now, but will as crypto
functionality is included.

12 years agotest: add notmuch_show_sanitize_all function that is a little more aggressive.
Jameson Graef Rollins [Thu, 26 May 2011 01:01:15 +0000 (18:01 -0700)]
test: add notmuch_show_sanitize_all function that is a little more aggressive.

The old notmuch_show_sanitize function only scrubed part of the
filename.  This one scrubs the full filename, as well as the message
id.

12 years agotest: new test-lib function to test for equality between files
Jameson Graef Rollins [Thu, 26 May 2011 01:01:14 +0000 (18:01 -0700)]
test: new test-lib function to test for equality between files

We need to be able to test for the presence of a newline at the end of
output.  There's no good way to capture trailing newlines in bash, so
redirecting output to a file is the next best thing.  This new
function should be used when testing for output that is expected to
have trailing newlines.

The next commit will demonstrate the use of this.

12 years agoBreak up format->part function into part_start and part_content functions.
Jameson Graef Rollins [Thu, 26 May 2011 01:01:13 +0000 (18:01 -0700)]
Break up format->part function into part_start and part_content functions.

Future improvements (eg. crypto support) will require adding new part
header.  By breaking up the output of part headers from the output of
part content, we can easily out new part headers with new formatting
functions.

12 years agoUse empty strings instead of NULL in format_reply structure.
Jameson Graef Rollins [Thu, 26 May 2011 01:01:12 +0000 (18:01 -0700)]
Use empty strings instead of NULL in format_reply structure.

This keeps things consistent with notmuch-show, and prevents having to
check for the existence of the field pointer for simple string output
formats.

12 years agoIntegrate reply_part_content function into reply_part function.
Jameson Graef Rollins [Thu, 26 May 2011 01:01:11 +0000 (18:01 -0700)]
Integrate reply_part_content function into reply_part function.

After the last patch to eliminate some redundant code paths in
reply_part, the reply_part_content function was only being called
once.  Disolving the function and integrating its contents into the
reply_part function makes things a little simpler, and frees up some
name space that will be needed in the next patch.

12 years agoSimplify reply_part function to eliminate redundant code paths.
Jameson Graef Rollins [Thu, 26 May 2011 01:01:10 +0000 (18:01 -0700)]
Simplify reply_part function to eliminate redundant code paths.

This is the same logic but with less code.

12 years agotest: use `princ' instead of `message' calls in emacs tests
Dmitry Kurochkin [Tue, 10 May 2011 06:25:08 +0000 (10:25 +0400)]
test: use `princ' instead of `message' calls in emacs tests

The patch replaces all (message (buffer-string)) calls in emacs
tests with (princ (buffer-string)).  This avoids accidentally
interpreting '%' as format specifiers and makes code simpler
because we do not need to capture stderr.

Also, the patch works around an Emacs (23.3+1-1 on current Debian
Unstable) segfault in "Ensure that emacs doesn't drop results"
test.  Note: the segfault does not happen on every test run.
Though, it seems to be consistently reproducible if the test uses
300 messages instead of 30.  Hopefully, it is the crash described
in Emacs bug #8545 [1] which is already fixed.

[1] http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8545

12 years agoUpdate some more recent tests to use /usr/bin/env to find bash
Carl Worth [Fri, 27 May 2011 21:08:04 +0000 (14:08 -0700)]
Update some more recent tests to use /usr/bin/env to find bash

The recentl-applied patch had grown stale, so update the tests that had
been created since it was originally written.

12 years agotest: change "#!/bin/bash" to "#!/usr/bin/env bash" enhances portability
Joel Borggrén-Franck [Wed, 1 Dec 2010 20:27:52 +0000 (21:27 +0100)]
test: change "#!/bin/bash" to "#!/usr/bin/env bash" enhances portability

Change #!/bin/bash at start of tests to "#!/usr/bin/env bash". That way
systems running on bash < 4 can prepend bash >= 4 to path before
running the tests.

12 years agoFix check of sysconf return in get_name/username_from_passwd_file
Matthias Guedemann [Wed, 25 May 2011 12:27:55 +0000 (14:27 +0200)]
Fix check of sysconf return in get_name/username_from_passwd_file

Fix to check the value returned by sysconf(_SC_GETPW_R_SIZE_MAX)
before using the value.

This fixes a core dump on DragonFlyBSD where this function returns -1.

12 years agoemacs: Make the queries used in the all-tags section configurable
Daniel Schoepe [Wed, 25 May 2011 21:21:54 +0000 (23:21 +0200)]
emacs: Make the queries used in the all-tags section configurable

This patch adds a customization variable that controls what queries
are used to construct the all-tags section in notmuch-hello. It allows
the user to specify a function to construct the query given a tag or
a string that is used as a filter for each tag.
It also adds a variable to hide various tags from the all-tags section.

Signed-off-by: Daniel Schoepe <daniel.schoepe@googlemail.com>
12 years agotest: add test-lib.el file with `visible-buffer-string' function
Dmitry Kurochkin [Thu, 26 May 2011 16:27:58 +0000 (20:27 +0400)]
test: add test-lib.el file with `visible-buffer-string' function

The patch adds test-lib.el file for Emacs tests auxiliary stuff.
Currently, it implements two functions: `visible-buffer-string'
and `visible-buffer-substring'.  These are similar to standard
counterparts without "visible-" prefix but exclude invisible
text.  The functions are not used anywhere at the moment but
should be useful for testing hiding/showing in the Emacs
interface.

Edited-by: Carl Worth <cworth@cworth.org> Fixed "basic" test to ignore
new test-lib.el file.

12 years agoemacs: Add a customization allowing to always prompt for the "From" address when...
Thomas Jost [Thu, 26 May 2011 17:22:41 +0000 (19:22 +0200)]
emacs: Add a customization allowing to always prompt for the "From" address when composing a new message

12 years agoemacs: Allow the user to choose the "From" address when replying to a message
Thomas Jost [Thu, 26 May 2011 08:41:33 +0000 (10:41 +0200)]
emacs: Allow the user to choose the "From" address when replying to a message

When pressing C-u r, the user will be prompted for the identity to use.

12 years agoemacs: Allow the user to choose the "From" address when forwarding a message
Thomas Jost [Thu, 26 May 2011 08:41:32 +0000 (10:41 +0200)]
emacs: Allow the user to choose the "From" address when forwarding a message

When pressing C-u f, the user will be prompted for the identity to use.

12 years agoemacs: Allow the user to choose the "From" address when composing a new message
Thomas Jost [Thu, 26 May 2011 08:41:31 +0000 (10:41 +0200)]
emacs: Allow the user to choose the "From" address when composing a new message

When pressing C-u m, the user will be prompted for the identity to use.

12 years agoemacs: Helpers needed for the user to be able to choose the "From" address when compo...
Thomas Jost [Thu, 26 May 2011 08:41:30 +0000 (10:41 +0200)]
emacs: Helpers needed for the user to be able to choose the "From" address when composing a new message

This adds functions and variables needed for this feature to be implemented.
Once it's done, the user will be able to use a prefix argument (e.g. pressing
C-u m instead of m) and be able to select a From address.

By default the list of names/addresses to be used during completion will be
automatically generated by the settings in the notmuch configuration file. The
user can customize the notmuch-identities variable to provide an alternate list.

This is based on a previous patch by Carl Worth
(id:"87wrhfvk6a.fsf@yoom.home.cworth.org" and follow-ups).

12 years agoCarefully manage save/restore of point in `notmuch-wash-toggle-invisible-action'.
Dmitry Kurochkin [Tue, 24 May 2011 23:02:43 +0000 (03:02 +0400)]
Carefully manage save/restore of point in `notmuch-wash-toggle-invisible-action'.

Before the change, save-excursion was used to save the point.  But the
marker saved by save-excursion was inside a region that was deleted,
so that approach is unreliable, (leading to point jumping to a new
position past the button). This patch instead saves point in an
integer variable, and when restoring, carefully avoids moving point
past the button, (in case the new button label is shorter than the old
button label).

12 years agotest: add test for hiding/showing signature in notmuch-show view
Dmitry Kurochkin [Sun, 22 May 2011 18:57:55 +0000 (22:57 +0400)]
test: add test for hiding/showing signature in notmuch-show view

12 years agotest: fix expected output for emacs tests after the wash button label changes
Dmitry Kurochkin [Sun, 22 May 2011 18:57:54 +0000 (22:57 +0400)]
test: fix expected output for emacs tests after the wash button label changes

12 years agoUse different labels for wash buttons when text is visible or hidden.
Dmitry Kurochkin [Sun, 22 May 2011 18:57:53 +0000 (22:57 +0400)]
Use different labels for wash buttons when text is visible or hidden.

Before the change, citation and signature wash buttons used the
same label in both visible and hidden states.  Sometimes it is
very convenient when you can determine if the text is hidden or
shown without reading the context and/or clicking the button.
The patch makes it easy to see if the text is shown or hidden by
explicitly saying what the button does (shows or hides the text).

12 years agoemacs: Add an accessor function for emacs code to get at user.other_email
Carl Worth [Tue, 24 May 2011 21:26:20 +0000 (14:26 -0700)]
emacs: Add an accessor function for emacs code to get at user.other_email

This is like the other notmuch-config accessor functions except that it
converts the newline-separated string into an actual lisp list.

12 years agoemacs: add notmuch-before- and notmuch-after-tag-hook
Daniel Schoepe [Sun, 15 May 2011 15:48:58 +0000 (17:48 +0200)]
emacs: add notmuch-before- and notmuch-after-tag-hook

This patch adds hooks that are run before/after messages are tagged
From the emacs interface.  In order to implement this and to avoid
having hooks parse all the arguments to the notmuch binary again, I
created a `notmuch-tag' function that other modules should use instead
of running (notmuch-call-notmuch-process "tag" ...) directly.

12 years agopython: Update README to talkabout notmuch, not cnotmuch
Carl Worth [Tue, 24 May 2011 20:08:18 +0000 (13:08 -0700)]
python: Update README to talkabout notmuch, not cnotmuch

The old instructions were telling users to do "easy_install cnotmuch"
which installed some old, stale bindings. The new instructions should
be much more effective.

12 years agoman page: Eliminate two warnings
Carl Worth [Tue, 24 May 2011 19:34:25 +0000 (12:34 -0700)]
man page: Eliminate two warnings

Manually turn off both filling and justification for the one
exceedingly-long URL which was blowing groff's mind. Also, adjust the
position of 'text' to not be at the beginning of a line so it is not
mistaken for a macro.

12 years agonotmuch: Implement search-tags as an alias for "search --output=tags *"
Carl Worth [Tue, 24 May 2011 19:09:53 +0000 (12:09 -0700)]
notmuch: Implement search-tags as an alias for "search --output=tags *"

Ever since we added support for "notmuch search --output=tags" the
"notmuch search-tags" command has been redundant. The recent addition
of alias support makes it easy to drop the explicit search-tags
command in favor of a simple alias that runs "notmuch search
--output=tags *".

So there's no longer any documentation of the search-tags command, but
existing scripts will not break at all.

12 years agotest: Expand multipart test to cover "notmuch reply" as well
Carl Worth [Tue, 24 May 2011 17:56:38 +0000 (10:56 -0700)]
test: Expand multipart test to cover "notmuch reply" as well

This gives coverage for the segmentation fault in "notmuch reply" that
was just fixed with the previous commit.

12 years agonotmuch reply: Avoid segmentation fault when printing multiple parts
Carl Worth [Tue, 24 May 2011 17:52:38 +0000 (10:52 -0700)]
notmuch reply: Avoid segmentation fault when printing multiple parts

The code was previously trying to print a NULL string in this case, which
is obviously what we don't want to do.

12 years agotest: Expand multipart test to cover part output in all formats.
Jameson Graef Rollins [Mon, 23 May 2011 07:46:44 +0000 (00:46 -0700)]
test: Expand multipart test to cover part output in all formats.

The example multipart message is made a bit more complicated by adding
a message/rfc822 message, and the all parts are output and tested in
all output formats.

12 years agoemacs: update notmuch-show.el to use new part output
Jameson Graef Rollins [Mon, 23 May 2011 13:45:39 +0000 (06:45 -0700)]
emacs: update notmuch-show.el to use new part output

The command-line interface for extracting a single part from a message
recently changed from:

notmuch part --part=X
to:
notmuch show --format=raw --part=X

12 years agoFix handling of message/rfc822 parts
Jameson Graef Rollins [Mon, 23 May 2011 07:46:16 +0000 (00:46 -0700)]
Fix handling of message/rfc822 parts

Since message/rfc822 parts are really just a special kind of
multipart, we here normalize the handling of the two.  This will
provide access to sub-parts of message/rfc822 parts, which was
previously unavailable.

12 years agonotmuch show: Update documentation for default --format=raw for --part
Carl Worth [Tue, 24 May 2011 18:21:08 +0000 (11:21 -0700)]
notmuch show: Update documentation for default --format=raw for --part

We recently made the --part option to "notmuch show" trigger a default
format of "raw", (since the previous default of "text" is not often
useful with a single part---especially a non-text part).

Here, we update the documentation to match.

12 years agouse format=raw by default when requesting part with --part=
Jameson Graef Rollins [Mon, 23 May 2011 22:38:49 +0000 (15:38 -0700)]
use format=raw by default when requesting part with --part=

This makes part retrieval a little more intuitive, since generally one
will always want to retrieve parts in raw form.

12 years agothrow error if mbox format specified with --part
Jameson Graef Rollins [Mon, 23 May 2011 07:35:37 +0000 (00:35 -0700)]
throw error if mbox format specified with --part

These formats are incompatible, since mbox format requires full
messages.

12 years agonotmuch: Support "notmuch part" as an alias for "notmuch show --format=raw"
Carl Worth [Tue, 24 May 2011 19:00:27 +0000 (12:00 -0700)]
notmuch: Support "notmuch part" as an alias for "notmuch show --format=raw"

We unifed the "notmuch part" functionality into "notmuch show" where
the implementation is both simpler and more powerful. But there's no
good reason to break users of the old interface.

Add support for aliases, which are undocumented means of getting at
functionality through deprecated names. The first such alias is
"notmuch part" as implemented here.

12 years agoNew part output handling as option to notmuch-show.
Jameson Graef Rollins [Mon, 23 May 2011 22:31:32 +0000 (15:31 -0700)]
New part output handling as option to notmuch-show.

Outputting of single MIME parts is moved to an option of notmuch show,
instead of being handled in it's own sub-command.  The recent rework
of multipart mime allowed for this change but consolidating part
handling into a single recursive function (show_message_part) that
includes formatting.  This allows for far simpler handling single
output of a single part, including formatting.

12 years agoNormalize part counting and formatting in show_message_part function.
Jameson Graef Rollins [Mon, 23 May 2011 05:08:08 +0000 (22:08 -0700)]
Normalize part counting and formatting in show_message_part function.

Simplify the function by moving part counting and formatting outside
of conditionals, thereby eliminating redundant code.  This also wraps
message part output handling with proper part formatting.

12 years agorename do_show_raw to do_show_single, and create params.raw for raw message output
Jameson Graef Rollins [Mon, 23 May 2011 03:04:02 +0000 (20:04 -0700)]
rename do_show_raw to do_show_single, and create params.raw for raw message output

We rename here in order to make do_show_single into a generic function
for handling output of just a single message, or which format=raw is a
special case.  The raw case is handled by setting a new parameter,
params.raw, which is used to tell do_show_single to output a single
message as a raw file.

This is mostly in preparation for much improved part handling to
follow imminently.

12 years agoadd part_sep formatter to replace "first" argument to part format functions
Jameson Graef Rollins [Mon, 23 May 2011 02:56:53 +0000 (19:56 -0700)]
add part_sep formatter to replace "first" argument to part format functions

A new field "part_sep" is added to the notmuch_show_format structure,
to be used for part separation.  This is cleaner than the "first"
argument that was being passed around to the part arguments, and
allows the function that handles overall part output formatting
(show_message_part) to directly handle when outputting the separator.

12 years agocreate notmuch_show_params_t structure for holding parameters passed to show functions.
Jameson Graef Rollins [Fri, 20 May 2011 22:01:52 +0000 (15:01 -0700)]
create notmuch_show_params_t structure for holding parameters passed to show functions.

This simplifies the passing of arguments to the show functions.  This
will be very useful as we accumulate more parameters that will need to
be passed.  Currently only the entire_thread parameter is passed this
way.

12 years agotest: force deletion of test remnants
Jameson Graef Rollins [Sat, 7 May 2011 19:10:04 +0000 (12:10 -0700)]
test: force deletion of test remnants

This keeps the test from failing if only a subset of the remnants were
available for deletion, because e.g. only a subset of the tests were
run.

12 years agotest: allow specifying tests to run with NOTMUCH_TESTS env var
Jameson Graef Rollins [Sat, 7 May 2011 19:08:34 +0000 (12:08 -0700)]
test: allow specifying tests to run with NOTMUCH_TESTS env var

This is useful for just running a specific subset of tests, ie:

NOTMUCH_TESTS=crypto make test

12 years agoTODO: Add note for bug with message with References but no In-Reply-To
Carl Worth [Mon, 23 May 2011 21:53:52 +0000 (14:53 -0700)]
TODO: Add note for bug with message with References but no In-Reply-To

We recently noticed on the mailing list a case where a message wasn't
properly connected to its parent. We should fix that of course.

12 years agonotmuch part: Fix part numbering to match what's reported by "notmuch show"
Carl Worth [Mon, 23 May 2011 21:27:23 +0000 (14:27 -0700)]
notmuch part: Fix part numbering to match what's reported by "notmuch show"

Since commit c51d5b3cdb5ca0816816e88ca6f7136a24e74eee we are counting
multipart containers when emitting part numbers in the "notmuch show"
output. Unfortunately, "notmuch part" wasn't updated with the same
numbering, (and the test suite is inadequate to catch this).

Fix this by adding a similar part-numbering change to "notmuch part" here.

12 years agopass entire format structure to various show_message functions
Jameson Graef Rollins [Fri, 20 May 2011 18:45:33 +0000 (11:45 -0700)]
pass entire format structure to various show_message functions

Various show_message* functions require formatting functions, which
were previously being passed individually as arguments.  Since we will
need to be needing to passing in more formatting function in the
future (ie. for crypto support), we here modify things so that we just
pass in the entire format structure.  This will make things much
simpler down the line as we need to pass in new format functions.

We move the show_format structure into notmuch-client.c as
notmuch_show_format.  This also affects notmuch-reply.c, so we create
a mostly-empty format_reply to pass the reply_part function to
show_message_body.

12 years agotest: remove hard-coded paths from multipart test
Jameson Graef Rollins [Thu, 19 May 2011 13:04:06 +0000 (06:04 -0700)]
test: remove hard-coded paths from multipart test

Small oversite, easily corrected.

12 years agoAdd a .dir-locals.el file for the benefit of emacs users
Daniel Kahn Gillmor [Wed, 24 Nov 2010 05:45:43 +0000 (00:45 -0500)]
Add a .dir-locals.el file for the benefit of emacs users

This file causes emacs to automatically set the correct style
variables to control indentation, etc. One more thing to make it
easier for everyone to collaborate with a consistent coding style.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
12 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".

Edited-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net> (clean up
expected output for emacs tests).

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
12 years agoemacs: Add custom `notmuch-show-elide-same-subject'
David Edmondson [Wed, 19 May 2010 09:41:08 +0000 (10:41 +0100)]
emacs: Add custom `notmuch-show-elide-same-subject'

This controls the appearance of collapsed messages in notmuch-show
mode, avoiding redundancy for repeated subject).

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

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

This is not enabled by default, instead the user must execute
`notmuch-show-setup-w3m' for it to take effect.

Edited-by: Carl Worth <cworth@cworth.org> Add documentation string for
notmuch-show-setup-23m and clean up warning about reference/assignment
of free variable.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
12 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>
12 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.

It's simply one more property of a MIME part that might be useful, and
json makes it so easy to add additional properties.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
12 years agotest: Link to compat files when building program during "make test"
Carl Worth [Wed, 18 May 2011 20:15:46 +0000 (13:15 -0700)]
test: Link to compat files when building program during "make test"

The compilation of the smtp-dummy program would fail if a build was
attempted on a system without getline. Fix this by simply including
the existing notmuch_compat_srcs variable when constructing the list
of source files for compiling smtp-dummy.

12 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>
12 years agoemacs: Allow indentation of multipart children.
David Edmondson [Mon, 10 May 2010 10:15:30 +0000 (11:15 +0100)]
emacs: Allow indentation of multipart children.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
12 years agoemacs: Add `notmuch-show-multipart/alternative-discouraged'.
David Edmondson [Mon, 10 May 2010 10:03:08 +0000 (11:03 +0100)]
emacs: Add `notmuch-show-multipart/alternative-discouraged'.

Also improved implementation of indication of which parts are
not shown.

Signed-off-by: Jameson Rollins <jrollins@finestructure.net>
12 years agoemacs: add more part handling functions
David Edmondson [Fri, 13 May 2011 06:09:30 +0000 (23:09 -0700)]
emacs: add more part handling functions

This adds new notmuch-show-insert-part functions to handle
multipart/alternative and message/rfc822 parts.

12 years agonotmuch show: Properly nest MIME parts within mulipart parts
Carl Worth [Tue, 17 May 2011 22:34:57 +0000 (15:34 -0700)]
notmuch show: Properly nest MIME parts within mulipart parts

Previously, notmuch show flattened all output, losing information
about the nesting of the MIME hierarchy. Now, the output is properly
nested, (both in the --format=text and --format=json output), so that
clients can analyze the original MIME structure.

Internally, this required splitting the final closing delimiter out of
the various show_part functions and putting it into a new
show_part_end function instead. Also, the show_part function now
accepts a new "first" argument that is set not only for the first MIME
part of a message, but also for each first MIME part within a series
of multipart parts. This "first" argument controls the omission of a
preceding comma when printing a part (for json).

Many thanks to David Edmondson <dme@dme.org> for originally
identifying the lack of nesting in the json output and submitting an
early implementation of this feature. Thanks as well to Jameson Graef
Rollins <jrollins@finestructure.net> for carefully shepherding David's
patches through a remarkably long review process, patiently explaining
them, and providing a cleaned up series that led to this final
implementation. Jameson also provided the new emacs code here.

12 years agonotmuch show: Include output for the enclosing multipart part of a MIME mail
Carl Worth [Tue, 17 May 2011 05:28:36 +0000 (22:28 -0700)]
notmuch show: Include output for the enclosing multipart part of a MIME mail

Previously, the outer multipart part of any multipart/mixed,
multipart/signed, etc. MIME message was silently omitted from the
"notmuch show" output. This prevented any client from correctly
determining to which parts a signature applies, for example.

Now, we actually emit these parts as their own parts. The output is
still flattened---the contained parts are not yet included "within"
the multipart part---so it's still not possible to determine to which
parts a signature applies, but this is one step along the path.

The test suite is updated to reflect this change, (though we'll
eventually want to fix the emacs interface to not display buttons for
the multipart enclosure parts as there's nothing useful for the user
to actually do with them).

12 years agotest: Add a test of "notmuch show" with a multipart message
Carl Worth [Mon, 16 May 2011 22:25:25 +0000 (15:25 -0700)]
test: Add a test of "notmuch show" with a multipart message

This tests "notmuch show" with both --format=text and --format=json on
a message with some non-trivial MIME multipart nesting, (multiple parts
within a multipart/mixed part which is within a multipart/signed part).

The test captures the current behavior (where only the leaf nodes of
the MIME structure are emitted as a flat list---the multipart parts
are effectively ignored). We plan to soon change the json output at
least to emit an actual hierarchy matching the MIME structure, (at
which point we will update this test).

12 years agoMark some structures in the library interface with visibility=default attribute.
Carl Worth [Wed, 11 May 2011 20:23:13 +0000 (13:23 -0700)]
Mark some structures in the library interface with visibility=default attribute.

As of gcc 4.6, there are new warnings from -Wattributes along the lines of:

warning: ‘_notmuch_messages’ declared with greater visibility
than the type of its field ‘_notmuch_messages::iterator’
[-Wattributes]

To squelch these, we decorate all such containing structs with
__attribute__((visibility("default"))). We take care to let only the
C++ compiler see this, (since the C compiler would otherwise warn
about ignored visibility attributes on types).

12 years agoRemove some variables which were set but not used.
Carl Worth [Wed, 11 May 2011 19:34:13 +0000 (12:34 -0700)]
Remove some variables which were set but not used.

gcc (at least as of version 4.6.0) is kind enough to point these out to us,
(when given -Wunused-but-set-variable explicitly or implicitly via -Wunused
or -Wall).

One of these cases was a legitimately unused variable. Two were simply
variables (named ignored) we were assigning only to squelch a warning about
unused function return values. I don't seem to be getting those warnings
even without setting the ignored variable. And the gcc docs. say that the
correct way to squelch that warning is with a cast to (void) anyway.

12 years agoemacs: Only compile replacement functions for emacs < emacs-23
Carl Worth [Wed, 11 May 2011 19:24:46 +0000 (12:24 -0700)]
emacs: Only compile replacement functions for emacs < emacs-23

This avoids the emacs lisp compiler from emitting warnings on this
replacement code, (which warnings would be hard for us to eliminate
since we didn't write the code but copied it verbatim from emacs 23).

12 years agovim: parse 'from' address
Felipe Contreras [Sun, 6 Feb 2011 12:53:58 +0000 (14:53 +0200)]
vim: parse 'from' address

In order to pass it to sendmail.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
12 years agovim: use sendmail directly
Felipe Contreras [Wed, 16 Jun 2010 22:39:04 +0000 (01:39 +0300)]
vim: use sendmail directly

The problem with 'mailx' is that it's not standardized, and it doesn't
allow the -f option, which is pretty important on many sendmail
configurations.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
12 years agovim: add myself (Felipe Contreras) as contributor
Felipe Contreras [Wed, 4 May 2011 20:14:37 +0000 (23:14 +0300)]
vim: add myself (Felipe Contreras) as contributor

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
12 years agovim: implement archive in show view
Felipe Contreras [Thu, 9 Dec 2010 19:16:38 +0000 (21:16 +0200)]
vim: implement archive in show view

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
12 years agovim: refactor tagging stuff
Felipe Contreras [Thu, 9 Dec 2010 18:58:03 +0000 (20:58 +0200)]
vim: refactor tagging stuff

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
12 years agoTODO: Add item for remembing files detected as not email.
Carl Worth [Mon, 25 Apr 2011 22:27:02 +0000 (15:27 -0700)]
TODO: Add item for remembing files detected as not email.

As recently discussed on the mailing list. See, for example:

id:"874o5m802d.fsf@servo.factory.finestructure.net"

12 years agotest: Mark the search-insufficient-from-quoting tests to expect success
Carl Worth [Mon, 25 Apr 2011 22:16:49 +0000 (15:16 -0700)]
test: Mark the search-insufficient-from-quoting tests to expect success

Theses were expected failures only due to a bug in GMime (with
versions of GMime before 2.4.18). As of GMime version 2.4.18 this bug
is fixed and these tests now pass.

12 years agoMerge remote-tracking branch 'amdragon/eager-metadata-v4'
Carl Worth [Mon, 25 Apr 2011 21:26:42 +0000 (14:26 -0700)]
Merge remote-tracking branch 'amdragon/eager-metadata-v4'

12 years agouse custom-face-edit value-type in notmuch-search-line-faces
Jameson Graef Rollins [Sun, 27 Mar 2011 05:16:32 +0000 (22:16 -0700)]
use custom-face-edit value-type in notmuch-search-line-faces

This enables the proper face customization UI for
notmuch-search-line-faces.

13 years agoFixup string list author
Austin Clements [Mon, 21 Mar 2011 06:33:55 +0000 (02:33 -0400)]
Fixup string list author

13 years agoAdd the tag list to the unified message metadata pass.
Austin Clements [Thu, 9 Dec 2010 06:54:34 +0000 (01:54 -0500)]
Add the tag list to the unified message metadata pass.

Now each caller of notmuch_message_get_tags only gets a new iterator,
instead of a whole new list.  In principle this could cause problems
with iterating while modifying tags, but through the magic of talloc
references, we keep the old tag list alive even after the cache in the
message object is invalidated.

This reduces my index search from the 3.102 seconds before the unified
metadata pass to 1.811 seconds (1.7X faster).  Combined with the
thread search optimization in b3caef1f0659dac8183441357c8fee500a940889,
that makes this query 2.5X faster than when I started.

13 years agoAdd the file name list to the unified message metadata pass.
Austin Clements [Thu, 9 Dec 2010 03:19:55 +0000 (22:19 -0500)]
Add the file name list to the unified message metadata pass.

Even if the caller never uses the file names, there is little cost to
simply fetching the file name terms.  However, retrieving the full
paths requires additional database work, so the expansion from terms
to full paths is performed lazily.

This also simplifies clearing the filename cache, since that's now
handled by the generic metadata cache code.

This further reduces my inbox search from 3.102 seconds before the
unified metadata pass to 2.206 seconds (1.4X faster).

13 years agoAdd a generic function to get a list of terms with some prefix.
Austin Clements [Thu, 9 Dec 2010 05:32:35 +0000 (00:32 -0500)]
Add a generic function to get a list of terms with some prefix.

Replace _notmuch_convert_tags with this and simplify
_create_filenames_for_terms_with_prefix.  This will also come in handy
shortly to get the message file name list.

13 years agoImplement an internal generic string list and use it.
Austin Clements [Thu, 9 Dec 2010 00:26:05 +0000 (19:26 -0500)]
Implement an internal generic string list and use it.

This replaces the guts of the filename list and tag list, making those
interfaces simple iterators over the generic string list.  The
directory, message filename, and tags-related code now build generic
string lists and then wraps them in specific iterators.  The real wins
come in later patches, when we use these for even more generic
functionality.

As a nice side-effect, this also eliminates the annoying dependency on
GList in the tag list.

13 years agoUse a single unified pass to fetch scalar message metadata.
Austin Clements [Sat, 27 Nov 2010 04:34:29 +0000 (23:34 -0500)]
Use a single unified pass to fetch scalar message metadata.

This performs a single pass over a message's term list to fetch the
thread ID, message ID, and reply-to, rather than requiring a pass for
each.  Xapian decompresses the term list anew for each iteration, so
this reduces the amount of time spent decompressing message metadata.

This reduces my inbox search from 3.102 seconds to 2.555 seconds (1.2X
faster).

13 years agopython: Remove completed TODO item
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.