]> git.notmuchmail.org Git - notmuch/log
notmuch
11 years agovim: simplify build
Felipe Contreras [Wed, 22 Feb 2012 16:57:56 +0000 (18:57 +0200)]
vim: simplify build

There should be no functional changes, except that you don't need to
make the directories before installing.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
11 years agovim: fix regex after "notmuch show" output change
Jakob [Thu, 29 Mar 2012 22:02:53 +0000 (15:02 -0700)]
vim: fix regex after "notmuch show" output change

The new field "excluded" was added to the output and made this regex fail.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
12 years agolib: work around talloc_steal usage from C++ code
Jani Nikula [Thu, 12 Apr 2012 20:57:39 +0000 (23:57 +0300)]
lib: work around talloc_steal usage from C++ code

Implicit typecast from 'void *' to 'T *' is okay in C, but not in
C++. In talloc_steal, an explicit cast is provided for type safety in
some GCC versions. Otherwise, a cast is required. Provide a template
function for this to maintain type safety, and redefine talloc_steal
to use it.

The template must be outside the extern "C" block (NOTMUCH_BEGIN_DECLS
and NOTMUCH_END_DECLS), but keep it within the GCC visibility #pragma.

No functional changes, apart from making the library build with
compilers other than recent GCC.

Signed-off-by: Jani Nikula <jani@nikula.org>
12 years agoRecord dependencies during build instead of before
Austin Clements [Wed, 11 Apr 2012 20:38:39 +0000 (16:38 -0400)]
Record dependencies during build instead of before

Previously, the makefile created dependency files in a separate, first
pass.  In particular, include-ing the dependency files would cause
make to attempt to rebuild those files using the dependency-generation
rules in the makefile.  Unfortunately, this approach required obtuse
rules and silently delayed the start of the build process (by quite a
bit on a clean tree without any dependency files).  Worse, this
required the dependency files to themselves depend on all of the
headers the source file depended on, which meant that, if a header
file was removed, the depedency file could not be updated because of a
missing dependency (!), which would cause make to silently fail.

This patch eliminates the dependency generation rules and instead
generates dependency files as a side-effect of the regular build rule.
On the first build, we don't need to know the dependencies beforehand;
the object file doesn't exist, so it will be built anyway.  On
subsequent builds, if a header file is updated, the dependency rules
generated by the previous build will force a rebuild.  If a source
file is updated, the dependency rules may be stale, but it doesn't
matter because the updated source file will force a rebuild.

In the final case above, the stale dependency rules may refer to a
header file that no longer exists but is also no longer needed.  In
order to prevent this from breaking the build, we also pass gcc the
-MP option, which generates phony targets for every depended-on header
file, so make won't complain if it can't find them during a later
build.

12 years agoshow: Remove empty message_set_{start,sep,end} fields
Austin Clements [Sun, 8 Apr 2012 00:57:50 +0000 (20:57 -0400)]
show: Remove empty message_set_{start,sep,end} fields

Setting these to NULL is equivalent to the empty string now.

12 years agoshow: Support NULL values for message_set_{start, sep, end}
Austin Clements [Sun, 8 Apr 2012 00:57:49 +0000 (20:57 -0400)]
show: Support NULL values for message_set_{start, sep, end}

Many formats don't need these, so it's more convenient if they don't
have to set them at all.

12 years agoshow: Remove unused fields from notmuch_show_format
Austin Clements [Sun, 8 Apr 2012 00:57:48 +0000 (20:57 -0400)]
show: Remove unused fields from notmuch_show_format

These fields were only used by old-style formatters.

12 years agoRemove show-message.c
Austin Clements [Sun, 8 Apr 2012 00:57:47 +0000 (20:57 -0400)]
Remove show-message.c

There are no more calls to show_message_body.

12 years agoshow: Remove support for old-style formatters in show_message
Austin Clements [Sun, 8 Apr 2012 00:57:46 +0000 (20:57 -0400)]
show: Remove support for old-style formatters in show_message

show_message used to have a compatibility path for old-style
formatters.  This removes that.

12 years agoSync schemata with current code structure
Austin Clements [Sun, 8 Apr 2012 00:57:45 +0000 (20:57 -0400)]
Sync schemata with current code structure

The schema itself hasn't changed, but many of the references to
functions in notmuch-show.c were out of date.

12 years agoemacs: have tag-completion return all tags for nil input
Jameson Graef Rollins [Mon, 9 Apr 2012 18:36:18 +0000 (11:36 -0700)]
emacs: have tag-completion return all tags for nil input

Previously the function would fail if the initial input was nil.  Now
it will return a list of all tags, which obviously makes much more
sense.

12 years agoNews for raw format changes
Austin Clements [Sun, 8 Apr 2012 01:09:56 +0000 (21:09 -0400)]
News for raw format changes

12 years agodebian: add gnupg-agent to notmuch recommends
Jameson Graef Rollins [Wed, 11 Apr 2012 17:23:51 +0000 (10:23 -0700)]
debian: add gnupg-agent to notmuch recommends

gnupg-agent is required for message decryption, so this should help
stem some issues encountered by users trying to decrypt messages.

12 years agoemacs: include tags from excluded messages in tag tab completion
Jameson Graef Rollins [Mon, 9 Apr 2012 18:36:17 +0000 (11:36 -0700)]
emacs: include tags from excluded messages in tag tab completion

The new message exclude functionality will hide tags that only exist
on excluded messages.  However, one might very well want to manually
modify excluded tags.  This makes sure tags from excluded messages are
always available in tab completion.

12 years agoemacs: update call in tag-completion function
Jameson Graef Rollins [Mon, 9 Apr 2012 18:36:16 +0000 (11:36 -0700)]
emacs: update call in tag-completion function

"search-tags" is deprecated, so use the more modern and supported
"search --output=tags".

12 years agoemacs: get rid of trailing spaces in notmuch-hello view
Dmitry Kurochkin [Sat, 10 Mar 2012 03:54:15 +0000 (07:54 +0400)]
emacs: get rid of trailing spaces in notmuch-hello view

This patch removes trailing spaces in notmuch-hello view.

A side effect of this change is that tag/query buttons no longer
include a space at the end.  This means that pressing RET when the
point is at the first character after the tag/query button no longer
works (note that this is the standard behavior for buttons).  We may
change this behavior in the future (without adding trailing spaces
back) if people would find this change inconvenient.

12 years agoemacs: make show set --exclude=false
Mark Walters [Sat, 7 Apr 2012 16:10:08 +0000 (17:10 +0100)]
emacs: make show set --exclude=false

Show has to set --exclude=false to deal with cases where it is asked
to show a single excluded message. It uses JSON so it can easily pass
the exclude information to the user.

12 years agotest: add some exclude tests
Mark Walters [Sat, 7 Apr 2012 16:10:07 +0000 (17:10 +0100)]
test: add some exclude tests

Systematically test the exclude options for search. Also move the
search existing exclude tests into the new test. There is some overlap
between the two sets of tests but many of the existing ones are there
because they triggered bugs in the past so I have kept them to ensure
coverage.

12 years agocli: move show to the new --exclude= option naming scheme.
Mark Walters [Sat, 7 Apr 2012 16:10:06 +0000 (17:10 +0100)]
cli: move show to the new --exclude= option naming scheme.

This moves notmuch show to the --exclude=(true|false) naming
scheme. When exclude=false show returns all threads that match
including those that only match in an excluded message. The excluded
messages are flagged.

When exclude=true the behaviour depends on whether --entire-thread is
set. If it is not set then show only returns the messages which match
and are not excluded. If it is set then show returns all messages in
the threads that match in a non-excluded message, flagging the excluded
messages in these threads. The rationale is that it is awkward to use
a thread with some missing messages.

12 years agocli: move search to the new --exclude= naming scheme.
Mark Walters [Sat, 7 Apr 2012 16:10:05 +0000 (17:10 +0100)]
cli: move search to the new --exclude= naming scheme.

This commit replaces the --no-exclude option with a
--exclude=(true|false|flag) option. The default is to omit the
excluded messages.

The flag option only makes sense if output=summary (as otherwise there
is nowhere to print the flag). In summary output exclude=false and
exclude=flag give almost identical output:
they differ in that with the exclude=flag option the match count
(i.e., the x in [x/n] in the output) is the number of matching
non-excluded messages rather than the number of matching messages.

Note this changes the default for output=summary when no --exclude=
option is given: it used to default to flag and now defaults to true
(i.e. omit excluded messages). This is neccesary to keep the cli
output uncluttered and for speed reasons.

12 years agocli: move count to the new --exclude=(true|false|flag) naming scheme.
Mark Walters [Sat, 7 Apr 2012 16:10:04 +0000 (17:10 +0100)]
cli: move count to the new --exclude=(true|false|flag) naming scheme.

Move the option --no-exclude to the --exclude= scheme. Since there is
no way to flag messages only true and false are implemented. Note
that, for consistency with other commands, this is implemented as a
keyword option rather than a boolean option.

12 years agolib: change default for notmuch_query_set_omit_excluded
Mark Walters [Sat, 7 Apr 2012 16:10:03 +0000 (17:10 +0100)]
lib: change default for notmuch_query_set_omit_excluded

12 years agoemacs: do not modify the alist passed to notmuch-sort-saved-searches
Jani Nikula [Sun, 1 Apr 2012 14:51:23 +0000 (17:51 +0300)]
emacs: do not modify the alist passed to notmuch-sort-saved-searches

Sort modifies its input as a side effect. Pass it a copy in
notmuch-sort-saved-searches to not modify the notmuch-saved-searches
alist.

12 years agoconfigure: change gmime version in help message to 2.6
David Bremner [Thu, 5 Apr 2012 11:01:32 +0000 (08:01 -0300)]
configure: change gmime version in help message to 2.6

Since GMime 2.6 is now the stable version upstream, and probably the
most tested by notmuch developers, it makes sense to suggest that to
users to install.

12 years agoconfigure: print info about required gmime 2.4 or 2.6 versions
Tomi Ollila [Wed, 21 Mar 2012 19:18:50 +0000 (21:18 +0200)]
configure: print info about required gmime 2.4 or 2.6 versions

In case required gmime (2.4 or 2.6) version if not found print information
about both alternatives (and currently minimal 2.6 version that is needed).

12 years agoconfigure: add empty line after each missing component message
Tomi Ollila [Tue, 20 Mar 2012 22:16:50 +0000 (00:16 +0200)]
configure: add empty line after each missing component message

Currently whenever message about missing GMime, Glib or talloc is
printed the message is 2 lines, component info and its http location
in next line. In the future the amount of lines will vary. To ease
reading in these cases newline is added after each message.

12 years agoemacs: fix off-by-one error in notmuch-hello column alignment
Dmitry Kurochkin [Fri, 9 Mar 2012 07:34:53 +0000 (11:34 +0400)]
emacs: fix off-by-one error in notmuch-hello column alignment

Expected results for few tests are fixed, the relevant test is
unmarked broken.

12 years agotest: add broken test for long names in Emacs notmuch-hello view
Dmitry Kurochkin [Fri, 9 Mar 2012 07:34:52 +0000 (11:34 +0400)]
test: add broken test for long names in Emacs notmuch-hello view

Currently, the column alignment in Emacs notmuch-hello is broken for
tags/queries with long names.

12 years agoemacs: Fix the References header in reply
Adam Wolfe Gordon [Sun, 1 Apr 2012 15:24:23 +0000 (09:24 -0600)]
emacs: Fix the References header in reply

In the new reply code, the References header gets inserted by
message.el using a function called message-shorten-references. Unlike
all the other header-inserting functions, it doesn't put a newline
after the header, causing the next header to end up on the same
line. In our case, this header happened to be User-Agent, so it's hard
to notice. This is probably a bug in message.el, but we need to work
around it.

This fixes the problem by wrapping message-shorten-references in a
function that inserts a newline after if necessary. This should
protect against the message.el bug being fixed in the future.

12 years agotest: Show all headers in emacs reply tests
Adam Wolfe Gordon [Sun, 1 Apr 2012 15:24:22 +0000 (09:24 -0600)]
test: Show all headers in emacs reply tests

By default, emacs hides the User-Agent and References headers when
composing mail. This is a good thing for users, but a bad thing for
testing, since we can create ugly or invalid headers and not have it
show up in the tests.

By setting message-hidden-headers to an empty list, we force emacs to
show all the headers, so we can check that they're correct. Users
won't see this, but it will let us catch future bugs.

As a side-effect, this breaks all the reply tests, since there is a
bug with the References and User-Agent headers, fixed in the next commit.

12 years agoemacs: Fix two bugs in reply
Adam Wolfe Gordon [Sun, 1 Apr 2012 15:24:21 +0000 (09:24 -0600)]
emacs: Fix two bugs in reply

Bug 1: Replying from alternate addresses
----------------------------------------

The reply code was inconsistent in its use of symbols and strings for
header names being passed to message.el functions. This caused the
From header to be lookup up incorrectly, causing an additional From
header to be added with the user's primary address instead of the
correct alternate address.

This is fixed by using symbols everywhere, i.e. never using strings
for header names when interacting with message.el.

This change also removes our use of `mail-header`, since we don't use
it anywhere else, and using assq makes it clear how the header lists
are expected to work.

Bug 2: Duplicate headers in emacs 23.2
--------------------------------------

The message.el code in emacs 23.2 assumes that header names will
always be passed as symbols, so our use of strings caused
problems. The symptom was that on 23.2 (and presumably on earlier
versions) the reply message would end up with two of some headers.

Converting everything to symbols also fixes this issue.

12 years agotest: Tests for reply from alternate addresses in emacs
Adam Wolfe Gordon [Sun, 1 Apr 2012 15:24:20 +0000 (09:24 -0600)]
test: Tests for reply from alternate addresses in emacs

Since the recent reply changes were pushed, there has been a bug that
causes emacs to always reply from the primary address, even if the
JSON or default CLI reply output uses an alternate address.

This adds two tests to the emacs test library based on the two "Reply
form..." tests in the reply test library. One is currently marked
broken.

12 years agonotmuch-mutt: fix typo in manpage
Stefano Zacchiroli [Sat, 31 Mar 2012 08:35:25 +0000 (10:35 +0200)]
notmuch-mutt: fix typo in manpage

12 years agoNEWS: document inclusion of contrib/notmuch-mutt
Stefano Zacchiroli [Sat, 31 Mar 2012 08:33:24 +0000 (10:33 +0200)]
NEWS: document inclusion of contrib/notmuch-mutt

12 years agoemacs: Fix mis-named argument to notmuch-get-bodypart-internal
Austin Clements [Tue, 27 Mar 2012 01:40:26 +0000 (21:40 -0400)]
emacs: Fix mis-named argument to notmuch-get-bodypart-internal

Previously, this function took an argument called "message-id", even
though it was a general query, rather than a message ID.  This changes
it to "query".

12 years agoreply: Move reply citation printing to the recursive MIME walk
Austin Clements [Tue, 27 Mar 2012 21:59:52 +0000 (17:59 -0400)]
reply: Move reply citation printing to the recursive MIME walk

This makes more logical sense, since it makes the recursive printer
responsible for the entire reply body and lets it start at the root of
the MIME tree instead of the first child.  (We could move reply header
creation in there, too, but if we ever support proper reply to
multiple messages, we'll want just one set of reply headers computed
from the entire message set and many bodies.)

12 years agoreply: Convert default reply format to self-recursive style
Austin Clements [Tue, 27 Mar 2012 21:59:51 +0000 (17:59 -0400)]
reply: Convert default reply format to self-recursive style

This re-arranges the default reply formatter code to use the
mime_node_t abstraction.  There are no semantic changes.

12 years agoshow/reply: Unify the code that extracts text parts
Austin Clements [Tue, 27 Mar 2012 21:59:50 +0000 (17:59 -0400)]
show/reply: Unify the code that extracts text parts

Previously, show and reply had separate implementations of decoding
and printing text parts.  Now both use show's implementation, which
was more complete.  Show's implementation has been extended with an
option to add reply quoting to the extracted part (this is implemented
as a named flag to avoid naked booleans, even though it's the only
flag it can take).

12 years agoemacs: Escape all message ID queries
Austin Clements [Tue, 27 Mar 2012 01:37:16 +0000 (21:37 -0400)]
emacs: Escape all message ID queries

This adds a lib function to turn a message ID into a properly escaped
message ID query and uses this function wherever we previously
hand-constructed ID queries.  Wherever this new function is used,
documentation has been clarified to refer to "id: queries" instead of
"message IDs".

This fixes the broken test introduced by the previous patch.

12 years agotest: Add Emacs test for messages with quotes in their message ID
Austin Clements [Tue, 27 Mar 2012 01:37:15 +0000 (21:37 -0400)]
test: Add Emacs test for messages with quotes in their message ID

Currently this is broken because Emacs doesn't properly escape double
quotes in message IDs.

12 years agocli: refactor "notmuch restore" message tagging into a separate function
Jani Nikula [Mon, 26 Mar 2012 21:04:11 +0000 (00:04 +0300)]
cli: refactor "notmuch restore" message tagging into a separate function

Refactor to make tagging code easier to reuse in the future. No
functional changes.

Signed-off-by: Jani Nikula <jani@nikula.org>
12 years agocli: refactor "notmuch tag" query tagging into a separate function
Jani Nikula [Mon, 26 Mar 2012 21:04:10 +0000 (00:04 +0300)]
cli: refactor "notmuch tag" query tagging into a separate function

Refactor to make tagging code easier to reuse in the future. No
functional changes.

Signed-off-by: Jani Nikula <jani@nikula.org>
12 years agocli: refactor "notmuch tag" data structures for tagging operations
Jani Nikula [Mon, 26 Mar 2012 21:04:09 +0000 (00:04 +0300)]
cli: refactor "notmuch tag" data structures for tagging operations

To simplify code, keep all tagging operations in a single array
instead of separate add and remove arrays. Apply tag changes in the
order specified on the command line, instead of first removing and
then adding the tags.

This results in a minor functional change: If a tag is both added and
removed, the last specified operation is now used. Previously the tag
was always added. Change the relevant test to reflect the new
behaviour.

Signed-off-by: Jani Nikula <jani@nikula.org>
12 years agotest: add test for both adding and removing a tag at the same time
Jani Nikula [Mon, 26 Mar 2012 21:04:08 +0000 (00:04 +0300)]
test: add test for both adding and removing a tag at the same time

The current behaviour is that regardless of the order in which the
addition and removal of a tag are specified, the tag is added.

Signed-off-by: Jani Nikula <jani@nikula.org>
12 years agoemacs: content-type comparison should be case insensitive.
Mark Walters [Sun, 25 Mar 2012 00:43:28 +0000 (00:43 +0000)]
emacs: content-type comparison should be case insensitive.

The function notmuch-match-content-type was comparing content types
case sensitively. Fix it so it tests case insensitively.

This fixes a bug where emacs would not include any body when replying
to a message with content-type TEXT/PLAIN.

12 years agodebian packaging: new binary package notmuch-mutt
Stefano Zacchiroli [Mon, 26 Mar 2012 08:51:44 +0000 (10:51 +0200)]
debian packaging: new binary package notmuch-mutt

12 years agocontrib: new mutt-notmuch utility for Mutt integration
Stefano Zacchiroli [Mon, 26 Mar 2012 08:45:58 +0000 (10:45 +0200)]
contrib: new mutt-notmuch utility for Mutt integration

12 years agoNEWS: consistent 2-space indentation in new content
Tomi Ollila [Wed, 21 Mar 2012 19:32:29 +0000 (21:32 +0200)]
NEWS: consistent 2-space indentation in new content

Some 0.12 NEWS items descriptions were indented with 3 spaces whereas
all other lines are indented with 2 spaces. Brought those
escaped lines back in line with others.

12 years agoMerge tag 'debian/0.12-1'
David Bremner [Tue, 20 Mar 2012 22:07:36 +0000 (19:07 -0300)]
Merge tag 'debian/0.12-1'

notmuch Debian 0.12-1 upload (same as 0.12 + debian changelog fix)

12 years agodebian: reword changelog about ignores debian/0.12-1
David Bremner [Tue, 20 Mar 2012 18:43:35 +0000 (15:43 -0300)]
debian: reword changelog about ignores

12 years agoAllow selecting which version of gmime is used to build notmuch.
Tomi Ollila [Wed, 14 Mar 2012 15:00:00 +0000 (17:00 +0200)]
Allow selecting which version of gmime is used to build notmuch.

This allows for testing against both versions of gmime on a single
machine, without having to mess with pkg-config paths.

This is rework of Tom Prince's patch submitted in
id:"1331402091-15663-1-git-send-email-tom.prince@ualberta.net"

12 years agoconfigure: store $IFS to $DEFAULT_IFS readonly variable
Tomi Ollila [Wed, 14 Mar 2012 14:59:59 +0000 (16:59 +0200)]
configure: store $IFS to $DEFAULT_IFS readonly variable

In the future, IFS value needs to be changed in a few places
in configure -- and then restored. Store the original value
to $DEFAULT_IFS for easy restoration.

12 years agoDo not try to parse the options for --build and --host arguments
Justus Winter [Mon, 5 Mar 2012 10:23:44 +0000 (11:23 +0100)]
Do not try to parse the options for --build and --host arguments

Formerly the code assumed the arguments to be triples and threw an
error if this was not the case. But those arguments are only there for
compatibility with autotools and are not used within the build system,
so just dropping the code parsing these values makes the build system
more robust.

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
12 years agoAdd GNU as a valid platform
Justus Winter [Mon, 5 Mar 2012 10:23:43 +0000 (11:23 +0100)]
Add GNU as a valid platform

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
12 years agoMerge tag '0.12'
David Bremner [Tue, 20 Mar 2012 11:08:17 +0000 (08:08 -0300)]
Merge tag '0.12'

notmuch 0.12 release

12 years agoadd NEWS item for printing 0.12
David Bremner [Tue, 20 Mar 2012 10:47:24 +0000 (07:47 -0300)]
add NEWS item for printing

12 years agoMerge branch 'release'
David Bremner [Tue, 20 Mar 2012 01:48:24 +0000 (22:48 -0300)]
Merge branch 'release'

Conflicts:
NEWS

Conflicts resolved by hand for date of 0.12 release.

12 years agodebian: add changelog stanza for 0.12
David Bremner [Tue, 20 Mar 2012 01:43:50 +0000 (22:43 -0300)]
debian: add changelog stanza for 0.12

Include extremely terse summary of NEWS.

12 years agoNEWS: add news item for help = man page
David Bremner [Tue, 20 Mar 2012 01:32:23 +0000 (22:32 -0300)]
NEWS: add news item for help = man page

As we discovered recently on the list, this really is new for 0.12

12 years agoupdate version to 0.12
David Bremner [Tue, 20 Mar 2012 01:28:17 +0000 (22:28 -0300)]
update version to 0.12

There may be a few NEWS changes after this, but no code (hopefully).

12 years agoNEWS: update discussion of GMime 2.6 version requirements.
David Bremner [Tue, 20 Mar 2012 01:25:05 +0000 (22:25 -0300)]
NEWS: update discussion of GMime 2.6 version requirements.

Be more specific than "Current GMime 2.6". Also explain why we need
>=2.6.7

12 years agoNEWS: set release date for 0.12
David Bremner [Tue, 20 Mar 2012 01:15:05 +0000 (22:15 -0300)]
NEWS: set release date for 0.12

12 years agoNEWS: news for reply enhancements
Adam Wolfe Gordon [Sun, 18 Mar 2012 16:32:43 +0000 (10:32 -0600)]
NEWS: news for reply enhancements

12 years agoemacs: Use the new JSON reply format and message-cite-original
Adam Wolfe Gordon [Sun, 18 Mar 2012 16:32:42 +0000 (10:32 -0600)]
emacs: Use the new JSON reply format and message-cite-original

Use the new JSON reply format to create replies in emacs. Quote HTML
parts nicely by using mm-display-part to turn them into displayable
text, then quoting them with message-cite-original. This is very
useful for users who regularly receive HTML-only email.

Use message-mode's message-cite-original function to create the
quoted body for reply messages. In order to make this act like the
existing notmuch defaults, you will need to set the following in
your emacs configuration:

message-citation-line-format "On %a, %d %b %Y, %f wrote:"
message-citation-line-function 'message-insert-formatted-citation-line

The tests have been updated to reflect the (ugly) emacs default.

12 years agotest: Add broken tests for new emacs reply functionality
Adam Wolfe Gordon [Sun, 18 Mar 2012 16:32:41 +0000 (10:32 -0600)]
test: Add broken tests for new emacs reply functionality

Add tests for creating nice replies to multipart messages, including
those with HTML parts. These tests are expected to fail for now.

12 years agoemacs: Factor out useful functions into notmuch-lib
Adam Wolfe Gordon [Sun, 18 Mar 2012 16:32:40 +0000 (10:32 -0600)]
emacs: Factor out useful functions into notmuch-lib

Move a few functions related to handling multipart/alternative parts
into notmuch-lib.el, so they can be used by future reply code.

12 years agoman: Add --decrypt to reply flags
Adam Wolfe Gordon [Sun, 18 Mar 2012 16:32:39 +0000 (10:32 -0600)]
man: Add --decrypt to reply flags

12 years agoman: Update notmuch-reply man page for JSON format.
Adam Wolfe Gordon [Sun, 18 Mar 2012 16:32:38 +0000 (10:32 -0600)]
man: Update notmuch-reply man page for JSON format.

12 years agoschemata: Add documentation for JSON reply format.
Adam Wolfe Gordon [Sun, 18 Mar 2012 16:32:37 +0000 (10:32 -0600)]
schemata: Add documentation for JSON reply format.

12 years agoreply: Add a JSON reply format.
Adam Wolfe Gordon [Sun, 18 Mar 2012 16:32:36 +0000 (10:32 -0600)]
reply: Add a JSON reply format.

This new JSON format for replies includes headers generated for a
reply message as well as the headers of the original message.  Using
this data, a client can intelligently create a reply. For example, the
emacs client will be able to create replies with quoted HTML parts by
parsing the HTML parts.

12 years agoTODO: Add replying to multiple messages
Adam Wolfe Gordon [Sun, 18 Mar 2012 16:32:35 +0000 (10:32 -0600)]
TODO: Add replying to multiple messages

12 years agoreply: Factor out reply creation
Adam Wolfe Gordon [Sun, 18 Mar 2012 16:32:34 +0000 (10:32 -0600)]
reply: Factor out reply creation

Factor out the creation of a reply message based on an original
message so it can be shared by different reply formats.

12 years agotest: Add broken test for the new JSON reply format.
Adam Wolfe Gordon [Sun, 18 Mar 2012 16:32:33 +0000 (10:32 -0600)]
test: Add broken test for the new JSON reply format.

12 years agoNEWS: start section for 0.13
David Bremner [Sun, 18 Mar 2012 13:15:47 +0000 (10:15 -0300)]
NEWS: start section for 0.13

People are making patches for the 0.12 NEWS section for features that
won't be there.

Let's help them out by adding a new stanza.

12 years agoemacs: Fix search tab completion in terminals
Austin Clements [Fri, 16 Mar 2012 03:13:12 +0000 (23:13 -0400)]
emacs: Fix search tab completion in terminals

In X, Emacs distinguishes the tab key, which produces a 'tab event;
from C-i, which produces a ?\t event.  However, in a terminal, these
are indistinguishable and only produce a ?\t event.  In order to
simplify things, Emacs automatically translates from 'tab to ?\t (see
"Function key translations" in M-x describe-bindings), so functions
only need to be bound to ?\t to work in all situations.

Previously, the search tab completion code usedq (kbd "<tab>"), which
produced the event sequence [tab], which only matched the 'tab event
and hence only worked in X.  This patch changes it to (kbd "TAB"),
which matches the general ?\t event and works in all situations.

12 years agolib: fix an exclude bug
Mark Walters [Wed, 14 Mar 2012 12:26:54 +0000 (12:26 +0000)]
lib: fix an exclude bug

When the exclude tags contain a tag that does not occur anywhere in
the Xapian database the exclusion fails. We modify the way the query
is constructed to `work around' this. (In fact the new code is cleaner
anyway.)

It also seems to fix another exclusion failure bug reported by
jrollins but we have not yet worked out why it helps in that case.

12 years agotest: add tests for message only search
Mark Walters [Wed, 14 Mar 2012 12:26:53 +0000 (12:26 +0000)]
test: add tests for message only search

This adds three tests for --output=messages searches. One test is for
the case when one exclude tag does not occur in the Xapian
database. This triggers a Xapian bug in some cases and causes the
whole exclusion to fail. The next commit avoids this bug.

12 years agotest: the test for the exclude code mistakenly excludes the tag "="
Mark Walters [Wed, 14 Mar 2012 12:26:52 +0000 (12:26 +0000)]
test: the test for the exclude code mistakenly excludes the tag "="

The tests for the exclude code in search and count use the line
    notmuch config set search.exclude_tags = deleted
which actually sets the exclude tags to be "=" and "deleted". Remove
the "=" from this line.

12 years agolib: Add exclude query debug output
Austin Clements [Wed, 14 Mar 2012 02:31:31 +0000 (22:31 -0400)]
lib: Add exclude query debug output

12 years agolib: Expose query debug output via an environment variable
Austin Clements [Wed, 14 Mar 2012 02:31:30 +0000 (22:31 -0400)]
lib: Expose query debug output via an environment variable

Allow query debugging to be enabled at run-time by setting the
NOTMUCH_DEBUG_QUERY environment variable to a non-empty string.

Previously, enabling query debugging required recompiling, but parsed
queries are often useful for tracking down bugs in situations where
recompiling is inconvenient.

12 years agocli: Parsing. Allow true/false parameter for boolean options.
Mark Walters [Sat, 10 Mar 2012 11:05:32 +0000 (11:05 +0000)]
cli: Parsing. Allow true/false parameter for boolean options.

Allow NOTMUCH_OPT_BOOLEAN to take a true or false parameter.  In
particular it allows the user to turn off a boolean option with
--option=false.

12 years agotest: use subtest name for generated message subject by default
Dmitry Kurochkin [Sat, 10 Mar 2012 01:24:51 +0000 (05:24 +0400)]
test: use subtest name for generated message subject by default

Before the change, messages generated by generate_message() used "Test
message #N" for default subject where N is the generated messages
counter.  Since message subject is commonly present in expected
results, there is a chance of breaking other tests when a new
generate_message() call is added.  The patch changes default subject
value for generated messages to subtest name if it is available.  If
subtest name is not available (i.e. message is generated during test
initialization), the old default value is used (in this case it is
fine to have the counter in the subject).

Another benefit of this change is a sane default value for subject in
generated messages, which would allow to simplify code like:

  test_begin_subtest "test for a cool feature"
  add_message [subject]="message for test for a cool feature"

12 years agotest: remove "Generate some messages" test from raw
Dmitry Kurochkin [Sat, 10 Mar 2012 01:24:50 +0000 (05:24 +0400)]
test: remove "Generate some messages" test from raw

Before the change, the first subtest in raw format tests just
generated messages and checked that they are added successfully.  This
is not really a raw format test, it is creating of environment
required for other subtests to run.  The patch removes the first
subtest from raw and replaces it with bare add_message calls, similar
to how it is done in other tests.

TODO: we should check that test environment was created successfully.
Currently, many tests do add_message(), notmuch new and other calls
without checking the results.  We should come up with a general
solution for this, i.e. if any command during test initialization
fails, all tests should be skipped with appropriate error message.

12 years agoman: Update raw format documentation
Austin Clements [Tue, 6 Mar 2012 18:48:44 +0000 (18:48 +0000)]
man: Update raw format documentation

12 years agoshow: Convert raw format to the new self-recursive style, properly support interior...
Austin Clements [Tue, 6 Mar 2012 18:48:43 +0000 (18:48 +0000)]
show: Convert raw format to the new self-recursive style, properly support interior parts

This is fully compatible for root and leaf parts, but now has proper
support for interior parts.  This requires some design decisions that
were guided by what I would want if I were to save a part.
Specifically:

- Leaf parts are printed without headers and with transfer decoding.
  This is what makes sense for saving attachments.  (Furthermore, the
  transfer decoding is necessary since, without the headers, the
  caller would not be able to interpret non-transfer-decoded output.)

- Message parts are printed with their message headers, but without
  enclosing part headers.  This is what makes sense for saving a
  message as a whole (which is a message part) and for saving attached
  messages.  This is symmetric for whole messages and for attached
  messages, though we special-case the whole message for performance
  reasons (and corner-case correctness reasons: given malformed input,
  GMime may not be able to reproduce it from the parsed
  representation).

- Multipart parts are printed with their headers and all child parts.
  It's not clear what the best thing to do for multipart is, but this
  was the most natural to implement and can be justified because such
  parts can't be interpreted without their headers.

As an added benefit, we can move the special-case code for part 0 into
the raw formatter.

12 years agoshow: Move format_part_content_raw with the other new-style formats
Austin Clements [Tue, 6 Mar 2012 18:48:42 +0000 (18:48 +0000)]
show: Move format_part_content_raw with the other new-style formats

Just code motion.

12 years agoshow: Convert mbox format to new self-recursive style
Austin Clements [Tue, 6 Mar 2012 18:48:41 +0000 (18:48 +0000)]
show: Convert mbox format to new self-recursive style

Given the lack of recursion, this is pretty easy.

12 years agoshow: Move format_message_mbox with the other new-style formats
Austin Clements [Tue, 6 Mar 2012 18:48:40 +0000 (18:48 +0000)]
show: Move format_message_mbox with the other new-style formats

Just code motion.

12 years agoshow: Allow formatters to return errors
Austin Clements [Tue, 6 Mar 2012 18:48:39 +0000 (18:48 +0000)]
show: Allow formatters to return errors

Formatter errors are propagated to the exit status of notmuch show.

This isn't used by the JSON or text formatters, but it will be useful
for the raw format, which is pickier.

12 years agotest: Fix malformed multipart message
Austin Clements [Tue, 6 Mar 2012 18:48:38 +0000 (18:48 +0000)]
test: Fix malformed multipart message

Previously, there was only one CRLF between the terminating boundary
of the embedded multipart/alternative and the boundary of the
containing multipart.  However, according the RFC 1341, 7.2.1:

  The boundary must be followed immediately either by another CRLF and
  the header fields for the next part, or by two CRLFs, in which case
  there are no header fields for the next part

and

  The CRLF preceding the encapsulation line is considered part of the
  boundary so that it is possible to have a part that does not end
  with a CRLF (line break).

Thus, there must be *two* CRLFs between these boundaries: one that
ends the terminating boundary and one that begins the enclosing
boundary.

While GMime accepted the message we had before, it could not produce
such a message.

12 years agotest: Fix typo in test description
Austin Clements [Tue, 6 Mar 2012 18:48:37 +0000 (18:48 +0000)]
test: Fix typo in test description

Part 4 is a multipart, not an html part.

12 years agoMerge tag '0.12_rc2'
David Bremner [Sun, 18 Mar 2012 11:36:33 +0000 (08:36 -0300)]
Merge tag '0.12_rc2'

notmuch 0.12~rc2 release

12 years agodebian: changelog stanza for 0.12~rc2 debian/0.12_rc2-1
David Bremner [Sun, 18 Mar 2012 11:16:55 +0000 (08:16 -0300)]
debian: changelog stanza for 0.12~rc2

mention the two bugfixes

12 years agobump version to 0.12~rc2
David Bremner [Sun, 18 Mar 2012 11:07:00 +0000 (08:07 -0300)]
bump version to 0.12~rc2

12 years agopython: fix signature of two wrapped libnotmuch functions
Justus Winter [Fri, 16 Mar 2012 12:56:32 +0000 (13:56 +0100)]
python: fix signature of two wrapped libnotmuch functions

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
12 years agoFix error reporting in notmuch_database_find_message_by_filename
Justus Winter [Sat, 17 Mar 2012 16:41:27 +0000 (17:41 +0100)]
Fix error reporting in notmuch_database_find_message_by_filename

Formerly it was possible for *message_ret to be left
uninitialized. The documentation however clearly states that "[o]n any
failure or when the message is not found, this function initializes
'*message' to NULL".

Signed-off-by: Justus Winter <4winter@informatik.uni-hamburg.de>
12 years agoMerge branch 'release'
David Bremner [Thu, 15 Mar 2012 02:01:38 +0000 (23:01 -0300)]
Merge branch 'release'

12 years agoNEWS: emacs: enable `notmuch-search-line-faces' by default
Jani Nikula [Wed, 14 Mar 2012 21:21:10 +0000 (23:21 +0200)]
NEWS: emacs: enable `notmuch-search-line-faces' by default

12 years agoMerge branch 'release'
David Bremner [Thu, 15 Mar 2012 01:58:20 +0000 (22:58 -0300)]
Merge branch 'release'

12 years agoNEWS: cli: manual page for notmuch configuration options
Jani Nikula [Wed, 14 Mar 2012 21:21:11 +0000 (23:21 +0200)]
NEWS: cli: manual page for notmuch configuration options