9 years agocli: notmuch-show.c fix whitespace error
Mark Walters [Sat, 16 Jun 2012 10:21:47 +0000 (11:21 +0100)]
cli: notmuch-show.c fix whitespace error

Fix an existing whitespace error since it is right next to
the changes of this series.

9 years agoemacs: make elide messages use notmuch-show for omitting messages.
Mark Walters [Sat, 16 Jun 2012 10:21:46 +0000 (11:21 +0100)]
emacs: make elide messages use notmuch-show for omitting messages.

Previously the elide messages code got the entire-thread from
notmuch-show.c and then threw away all non-matching messages. This
version calls notmuch-show.c without the --entire-thread flag so
it never receives the non-matching messages in the first place.

This makes it substantially faster.

9 years agoUpdate devel/schemata for --entire-thread=false
Mark Walters [Sat, 16 Jun 2012 10:21:45 +0000 (11:21 +0100)]
Update devel/schemata for --entire-thread=false

Also remove the Json --entire-thread item from devel/TODO.

9 years agocli: make --entire-thread=false work for format=json.
Mark Walters [Sat, 16 Jun 2012 10:21:44 +0000 (11:21 +0100)]
cli: make --entire-thread=false work for format=json.

The --entire-thread option in notmuch-show.c defaults to true when
format=json. Previously there was no way to turn this off. This patch
makes it respect --entire-thread=false.

To do this the patch moves the --entire-thread option to be a keyword
option using the new command line parsing to allow the existing
--entire-thread to keep working.

9 years agocli: Let json output "null" messages for non --entire-thread
Mark Walters [Sat, 16 Jun 2012 10:21:43 +0000 (11:21 +0100)]
cli: Let json output "null" messages for non --entire-thread

All formats except Json can output empty messages for non
entire-thread, but in Json format we output "null" to keep the other
elements (e.g. the replies to the omitted message) in the correct

9 years agocli: command line parsing: allow default for keyword options
Mark Walters [Sat, 16 Jun 2012 10:21:42 +0000 (11:21 +0100)]
cli: command line parsing: allow default for keyword options

This changes the parsing for "keyword" options so that if the option
is specified with no argument the argument is parsed as if it were
passed an empty string. This make it easier to add options to existing
boolean arguments (the existing --option can default to TRUE).

9 years agoruby: extern linkage portability improvement
Tomi Ollila [Sun, 24 Jun 2012 18:48:34 +0000 (21:48 +0300)]
ruby: extern linkage portability improvement

Some C compilers are stricter when it comes to (tentative) definition
of a variable -- in those compilers introducing variable without 'extern'
keyword always allocates new 'storage' to the variable and linking all
these modules fails due to duplicate symbols.

This is reimplementation of Charlie Allom's patch:
written originally by Ali Polatel. This version has
more accurate commit message.

9 years agoemacs: add pipe attachment command
Mark Walters [Mon, 7 May 2012 07:02:09 +0000 (00:02 -0700)]
emacs: add pipe attachment command

Allow the user to pipe the attachment somewhere. Bound to '|' on the
attachment button.

Signed-off-by: Jameson Graef Rollins <>
9 years agoemacs: derive correct timestamp in FCC unique name
Jesse Rosenthal [Thu, 14 Jun 2012 17:16:03 +0000 (13:16 -0400)]
emacs: derive correct timestamp in FCC unique name

Previously, the timestamp at the beginning of the FCC unique maildir
name was derived incorrectly, thanks to an integer overflow. This
changes the derivation of timestamp to use a float, and so will get
the number correct at least until 2038. (It is still formatted with
"%d" so it will show up as an integer.) Should we need to change it in
the next 26 years to take the unix millenium into account, it will be
invisible to users.

This change is mostly a question of consistency, since the unique name
is arbitrary anyway. But since most people use timestamps, and that was
the original intention here as well, we might as well.

Signed-off-by: Jesse Rosenthal <>
9 years agoNews for updated maildir sync semantics
Austin Clements [Sat, 9 Jun 2012 19:14:18 +0000 (15:14 -0400)]
News for updated maildir sync semantics

9 years agolib: Treat messages in new/ as maildir messages with no flags set
Austin Clements [Sat, 9 Jun 2012 19:14:17 +0000 (15:14 -0400)]
lib: Treat messages in new/ as maildir messages with no flags set

Previously, notmuch new only synchronized maildir flags to tags for
files with a maildir "info" part.  Since messages in new/ don't have
an info part, notmuch would ignore them for flag-to-tag

This patch makes notmuch consider messages in new/ to be legitimate
maildir messages that simply have no maildir flags set.  The most
visible effect of this is that such messages now automatically get the
unread tag.

9 years agolib: Only synchronize maildir flags for messages in maildirs
Austin Clements [Sat, 9 Jun 2012 19:14:16 +0000 (15:14 -0400)]
lib: Only synchronize maildir flags for messages in maildirs

Previously, we synchronized flags to tags for any message that looked
like it had maildir flags in its file name, regardless of whether it
was in a maildir-like directory structure.  This was asymmetric with
tag-to-flag synchronization, which only applied to messages in
directories named new/ and cur/ (introduced by 95dd5fe5).

This change makes our interpretation stricter and addresses this
asymmetry by only synchronizing flags to tags for messages in
directories named new/ or cur/.  It also prepares us to treat messages
in new/ as maildir messages, even though they lack maildir flags.

9 years agolib: Move _filename_is_in_maildir
Austin Clements [Sat, 9 Jun 2012 19:14:15 +0000 (15:14 -0400)]
lib: Move _filename_is_in_maildir

This way notmuch_message_maildir_flags_to_tags can call it.  It makes
more sense for this to be just above all of the maildir
synchronization code rather than mixed in the middle.

9 years agotest: Add broken test for tag synchronization on files delivered to new/
Austin Clements [Sat, 9 Jun 2012 19:14:14 +0000 (15:14 -0400)]
test: Add broken test for tag synchronization on files delivered to new/

Currently, notmuch new only synchronizes maildir flags to tags for
files that have an "info" part.  However, in maildir, new mail doesn't
gain the info part until it moves from new/ to cur/.  Hence, even
though mail in new/ doesn't have an info part, it is still a maildir
message and thus has maildir flags (though none of them set).

The most visible effect of not synchronizing maildir flags for
messages in new/ is that newly delivered messages don't get the unread
tag (unless it is assigned by some other mechanism, like new.tags).

This patch does *not* modify the test for messages in cur/ that do not
have an "info" part.  Unlike a message in new/, a message in cur/
without an info part is no longer a maildir message, and thus
shouldn't be subject to maildir flag synchronization.

9 years agocli: use new notmuch_crypto_get_context in mime-node.c
Jameson Graef Rollins [Sat, 26 May 2012 18:45:46 +0000 (11:45 -0700)]
cli: use new notmuch_crypto_get_context in mime-node.c

This has the affect of lazily creating the crypto contexts only when
needed.  This removes code duplication from notmuch-show and
notmuch-reply, and should speed up these functions considerably if the
crypto flags are provided but the messages don't have any
cryptographic parts.

9 years agocli: new crypto verify flag to handle verification
Jameson Graef Rollins [Sat, 26 May 2012 18:45:45 +0000 (11:45 -0700)]
cli: new crypto verify flag to handle verification

Use this flag rather than depend on the existence of an initialized
gpgctx, to determine whether we should verify a multipart/signed.  We
will be moving to create the ctx lazily, so we don't want to depend on
it being previously initialized if it's not needed.

9 years agocli: modify mime_node_context to use the new crypto struct
Jameson Graef Rollins [Sat, 26 May 2012 18:45:44 +0000 (11:45 -0700)]
cli: modify mime_node_context to use the new crypto struct

This simplifies some more interfaces.

9 years agocli: modify mime_node_open to take new crypto struct as argument
Jameson Graef Rollins [Sat, 26 May 2012 18:45:43 +0000 (11:45 -0700)]
cli: modify mime_node_open to take new crypto struct as argument

This simplifies the interface considerably.

9 years agocli: modify show and reply to use new crypto struct
Jameson Graef Rollins [Sat, 26 May 2012 18:45:42 +0000 (11:45 -0700)]
cli: modify show and reply to use new crypto struct

notmuch_show_params_t is modified to use the new notmuch_crypto_t, and
notmuch-show and notmuch-reply are modified accordingly.

9 years agocli: new crypto structure to store crypto contexts and parameters, and functions...
Jameson Graef Rollins [Sat, 26 May 2012 18:45:41 +0000 (11:45 -0700)]
cli: new crypto structure to store crypto contexts and parameters, and functions to support it

This new structure, notmuch_crypto_t, keeps all relevant crypto
contexts and parameters together, and will make it easier to pass the
stuff around and clean it up.  The name of the crypto context inside
this new struct will change, to reflect that it is actually a GPG
context, which is a sub type of Crypto context.  There are other types
of Crypto contexts (Pkcs7 in particular, which we hope to support) so
we want to be clear.

The new crypto.c contains functions to return the proper context from
the struct for a given protocol (and initialize it if needed), and to
cleanup a struct by releasing the crypto contexts.

9 years agocli: use new typedef to deal with gmime 2.4/2.6 context incompatibility
Jameson Graef Rollins [Sat, 26 May 2012 18:45:40 +0000 (11:45 -0700)]
cli: use new typedef to deal with gmime 2.4/2.6 context incompatibility

gmime 2.4 defines GMimeCipherContext, while 2.6 defines
GMimeCryptoContext.  typedef them both to notmuch_crypto_context_t to
cover this discrepancy and remove a bunch of #ifdefs.

9 years agoemacs: only strip "re:" in the beginning of subject
Jani Nikula [Tue, 5 Jun 2012 15:42:51 +0000 (18:42 +0300)]
emacs: only strip "re:" in the beginning of subject

Fix notmuch-show-strip-re by matching "re:" only in the beginning of
the input string.

9 years agotest: add test for emacs notmuch-show-strip-re function
Jani Nikula [Tue, 5 Jun 2012 15:42:50 +0000 (18:42 +0300)]
test: add test for emacs notmuch-show-strip-re function

The function is used for stripping "re:" from subjects to generate
"bare subjects". Include broken test for having "re:" in the middle of
the subject.

9 years agonmbug: check whether every forked process exit with (non)zero value
Tomi Ollila [Sun, 1 Apr 2012 18:28:42 +0000 (21:28 +0300)]
nmbug: check whether every forked process exit with (non)zero value

If any of the forked process exits with nonzero value, terminate
current operation -- nonzero exit value indicates failure and
then there is no point continuing.

9 years agouncrustify.cfg: comments and more types
Tomi Ollila [Tue, 7 Feb 2012 16:34:17 +0000 (18:34 +0200)]
uncrustify.cfg: comments and more types

Changes to devel/uncrustify.cfg:

* Updated header comment to state this is config file for *notmuch*.
* Added comment about the reason of 'type' keyword used.
* Added some more custom types woth 'type' keyword.
* Have (every) multiline comment lines start with '*'.

9 years agoemacs: Suppress warnings about using cl at runtime
Austin Clements [Thu, 29 Mar 2012 04:33:42 +0000 (00:33 -0400)]
emacs: Suppress warnings about using cl at runtime

It was decided in the thread starting at [0] that it is okay for
notmuch to use 'cl runtime functions.  However, by default, these
produce byte compiler warnings.  This suppresses those using
file-local variables.

[0] id:""

9 years agoconfig: add quoting to fix IFS bug
Jameson Graef Rollins [Sat, 2 Jun 2012 18:16:01 +0000 (11:16 -0700)]
config: add quoting to fix IFS bug

Without proper quoting the DEFAULT_IFS was getting set incorrectly,
which was causing problems with the storage of some variables later in
the script.  Quoting fixes the problem.

9 years agoMerge tag '0.13.2'
David Bremner [Sun, 3 Jun 2012 14:38:08 +0000 (11:38 -0300)]
Merge tag '0.13.2'

notmuch 0.13.2 release

9 years agodebian: changelog stanza for 0.13.2-1 0.13.2 debian/0.13.2-1
David Bremner [Sat, 2 Jun 2012 21:17:42 +0000 (18:17 -0300)]
debian: changelog stanza for 0.13.2-1

9 years agoNEWS: update for 0.13.2
David Bremner [Sat, 2 Jun 2012 21:15:06 +0000 (18:15 -0300)]
NEWS: update for 0.13.2

9 years agoversion: update to 0.13.2
David Bremner [Sat, 2 Jun 2012 21:10:55 +0000 (18:10 -0300)]
version: update to 0.13.2

9 years agonotmuch-deliver: Update to new notmuch_database_open API
Austin Clements [Fri, 1 Jun 2012 14:16:49 +0000 (10:16 -0400)]
notmuch-deliver: Update to new notmuch_database_open API

Commit 5fddc07 changed this API, but missed this use of it.

9 years agonotmuch-mutt: lookup notmuch-search-terms(7) when asked for help
Stefano Zacchiroli [Tue, 29 May 2012 20:44:27 +0000 (22:44 +0200)]
notmuch-mutt: lookup notmuch-search-terms(7) when asked for help

When asked for interactive help, lookup notmuch-search-terms(7)
instead of notmuch(1). Syntax of notmuch queries used to be described
in the latter, but has recently been moved to the former.

Closes: #675073 (in the Debian BTS)
9 years agoMerge branch 'release'
David Bremner [Tue, 29 May 2012 12:07:31 +0000 (09:07 -0300)]
Merge branch 'release'

9 years agoNEWS: add item about ruby bindings. 0.13.1
David Bremner [Mon, 28 May 2012 23:40:45 +0000 (20:40 -0300)]
NEWS: add item about ruby bindings.

Corrections or clarifications welcome.

9 years agoRevert "ruby: Add workarounds to use in-tree build not the installed one"
Felipe Contreras [Fri, 25 May 2012 13:08:17 +0000 (15:08 +0200)]
Revert "ruby: Add workarounds to use in-tree build not the installed one"

This reverts commit 82b73ffd7380b85d259eeb91100dd6ac2d14223a.

Only leave the copyright changes.

Signed-off-by: Felipe Contreras <>
(cherry picked from commit 35cb1c95cc8afa964900d29c813349ad8e24e7a8)

10 years agoconfigure: add help note about gmime version
Jameson Graef Rollins [Wed, 23 May 2012 18:38:47 +0000 (11:38 -0700)]
configure: add help note about gmime version

10 years agocli: fix documentation about --decrypt for show
Jameson Graef Rollins [Wed, 23 May 2012 18:41:20 +0000 (11:41 -0700)]
cli: fix documentation about --decrypt for show

Forgot to mention that it implies --verify.

10 years agotest: remove "Testing" from test description in emacs-hello and emacs-show
Dmitry Kurochkin [Fri, 25 May 2012 13:02:55 +0000 (17:02 +0400)]
test: remove "Testing" from test description in emacs-hello and emacs-show

"Testing" is printed by test/, so having "Testing" in test
description results in duplicate "Testing" in console output.

10 years agodebian: changelog stanza for 0.13.1
David Bremner [Sat, 26 May 2012 00:25:29 +0000 (21:25 -0300)]
debian: changelog stanza for 0.13.1

10 years agoversion: bump to 0.13.1
David Bremner [Sat, 26 May 2012 00:17:54 +0000 (21:17 -0300)]
version: bump to 0.13.1

10 years agofix release date for 0.13.1
David Bremner [Sat, 26 May 2012 00:13:19 +0000 (21:13 -0300)]
fix release date for 0.13.1

10 years agoNEWS for directory function fixes
Austin Clements [Fri, 25 May 2012 01:17:26 +0000 (21:17 -0400)]
NEWS for directory function fixes

10 years agoRevert "ruby: Add workarounds to use in-tree build not the installed one"
Felipe Contreras [Fri, 25 May 2012 13:08:17 +0000 (15:08 +0200)]
Revert "ruby: Add workarounds to use in-tree build not the installed one"

This reverts commit 82b73ffd7380b85d259eeb91100dd6ac2d14223a.

Only leave the copyright changes.

Signed-off-by: Felipe Contreras <>
10 years agotest: add tests for notmuch reply From guessing
Jani Nikula [Thu, 24 May 2012 05:15:50 +0000 (08:15 +0300)]
test: add tests for notmuch reply From guessing

Add tests for picking up user's From address from fallback headers
Envelope-To, X-Original-To, and Delivered-To.

Signed-off-by: Jani Nikula <>
10 years agocli: also use Delivered-To header to figure out the reply from address
Jani Nikula [Thu, 24 May 2012 05:15:49 +0000 (08:15 +0300)]
cli: also use Delivered-To header to figure out the reply from address

Add another fallback header Delivered-To for guessing the user's from
address for notmuch reply before using the Received
headers. Apparently some MTAs use Delivered-To instead of
X-Original-To (which already exists as a fallback).

Reported-by: Michael Hudson-Doyle <>
Signed-off-by: Jani Nikula <>
10 years agoRecommend libgmime-2.6-dev in INSTALL
Austin Clements [Thu, 24 May 2012 19:32:31 +0000 (15:32 -0400)]
Recommend libgmime-2.6-dev in INSTALL

Given that everything prefers 2.6 over 2.4, it seems appropriate to
suggest that people install the 2.6 dev package instead of 2.4.

10 years agonew: Unify add_files and add_files_recursive
Austin Clements [Thu, 24 May 2012 22:01:13 +0000 (18:01 -0400)]
new: Unify add_files and add_files_recursive

Since starting at the top of a directory tree and recursing within
that tree are now identical operations, there's no need for both
add_files and add_files_recursive.  This eliminates add_files (which
did nothing more than call add_files_recursive after the previous
patch) and renames add_files_recursive to add_files.

10 years agonew: Merge error checks from add_files and add_files_recursive
Austin Clements [Thu, 24 May 2012 22:01:12 +0000 (18:01 -0400)]
new: Merge error checks from add_files and add_files_recursive

Previously, add_files_recursive could have been called on a symlink to
a non-directory.  Hence, calling it on a non-directory was not an
error, so a separate function, add_files, existed to fail loudly in
situations where the path had to be a directory.

With the new stat-ing logic, add_files_recursive is always called on
directories, so the separation of this logic is no longer necessary.
Hence, this patch moves the strict error checking previously done by
add_files into add_files_recursive.

10 years agonew: Centralize file type stat-ing logic
Austin Clements [Thu, 24 May 2012 22:01:11 +0000 (18:01 -0400)]
new: Centralize file type stat-ing logic

This moves our logic to get a file's type into one function.  This has
several benefits: we can support OSes and file systems that do not
provide dirent.d_type or always return DT_UNKNOWN, complex
symlink-handling logic has been replaced by a simple stat fall-through
in one place, and the error message for un-stat-able file is more
accurate (previously, the error always mentioned directories, even
though a broken symlink is not a directory).

10 years agotest: Test notmuch new with a broken symlink
Austin Clements [Thu, 24 May 2012 22:01:10 +0000 (18:01 -0400)]
test: Test notmuch new with a broken symlink

10 years agoNEWS: started 0.13.1 stanza: fix decoding of text/plain parts in reply
Tomi Ollila [Thu, 24 May 2012 17:09:20 +0000 (20:09 +0300)]
NEWS: started 0.13.1 stanza: fix decoding of text/plain parts in reply

NEWS item for forthcoming 0.13.1 bug fix release: UTF-8 characters were
incorrectly decoded when inserting reply content from text/plain parts.

10 years agoMerge branch 'release'
David Bremner [Thu, 24 May 2012 01:48:16 +0000 (22:48 -0300)]
Merge branch 'release'

merge 0.13.1 bugfix patches back to master, fixes for emacs reply and
spurious directory document creation.

10 years agocli: clean up user address matching code in guess_from_received_header()
Jani Nikula [Fri, 11 May 2012 14:33:05 +0000 (17:33 +0300)]
cli: clean up user address matching code in guess_from_received_header()

Get rid of user address matching code duplication in
guess_from_received_header() by using the new address matching

No functional changes.

Signed-off-by: Jani Nikula <>
10 years agocli: add user address matching helpers for notmuch reply
Jani Nikula [Fri, 11 May 2012 14:33:04 +0000 (17:33 +0300)]
cli: add user address matching helpers for notmuch reply

Add a multi-purpose address_match() function for matching strings
against user's configured primary and other email addresses. Add thin
wrappers user_address_in_string() and string_in_user_address() for
ease of use, and also convert existing address_is_users() to wrapper
for the same.

No functional changes.

Signed-off-by: Jani Nikula <>
10 years agolib: Don't needlessly create directory docs in _notmuch_message_remove_filename
Austin Clements [Fri, 18 May 2012 04:13:42 +0000 (00:13 -0400)]
lib: Don't needlessly create directory docs in _notmuch_message_remove_filename

Previously, if passed a filename with a directory that did not exist
in the database, _notmuch_message_remove_filename would needlessly
create that directory document.  Fix it so that doesn't happen.

10 years agopython: Remove find_message_by_filename workaround
Austin Clements [Fri, 18 May 2012 04:13:41 +0000 (00:13 -0400)]
python: Remove find_message_by_filename workaround

Now that notmuch_database_find_message_by_filename works on read-only
databases, remove the workaround that disabled it on read-write

This also adds a regression test for find_message_by_filename.

10 years agolib: Make notmuch_database_find_message_by_filename not crash on read-only databases
Austin Clements [Fri, 18 May 2012 04:13:40 +0000 (00:13 -0400)]
lib: Make notmuch_database_find_message_by_filename not crash on read-only databases

Previously, _notmuch_database_filename_to_direntry would abort with an
internal error when called on a read-only database.  Now that creating
the directory document is optional,
notmuch_database_find_message_by_filename can disable directory
document creation (as it should) and, as a result, not abort on
read-only databases.

10 years agopython: Update Database.get_directory documentation
Austin Clements [Fri, 18 May 2012 04:13:39 +0000 (00:13 -0400)]
python: Update Database.get_directory documentation

notmuch_database_get_directory no longer returns an error for
read-only databases, so remove ReadOnlyDatabaseError from the list of
get_directory exceptions.

10 years agonew: Remove workaround for detecting newly created directory objects
Austin Clements [Fri, 18 May 2012 04:13:38 +0000 (00:13 -0400)]
new: Remove workaround for detecting newly created directory objects

Previously, notmuch_database_get_directory did not indicate whether or
not the returned directory object was newly created, which required a
workaround to distinguish newly created directory objects with no
child messages from directory objects that had no mtime set but did
have child messages.  Now that notmuch_database_get_directory
distinguishes whether or not the directory object exists in the
database, this workaround is no longer necessary.

10 years agolib: Make notmuch_database_get_directory return NULL if the directory is not found
Austin Clements [Fri, 18 May 2012 04:13:37 +0000 (00:13 -0400)]
lib: Make notmuch_database_get_directory return NULL if the directory is not found

Using the new support from _notmuch_directory_create, this makes
notmuch_database_get_directory a read-only operation that simply
returns the directory object if it exists or NULL otherwise.  This
also means that notmuch_database_get_directory can work on read-only

This change breaks the directory mtime workaround in notmuch-new.c by
fixing the exact issue it was working around.  This permits mtime
update races to prevent scans of changed directories, which
non-deterministically breaks a few tests.  The next patch fixes this.

10 years agolib: Perform the same transformation to _notmuch_database_filename_to_direntry
Austin Clements [Fri, 18 May 2012 04:13:36 +0000 (00:13 -0400)]
lib: Perform the same transformation to _notmuch_database_filename_to_direntry

Now _notmuch_database_filename_to_direntry takes a flags argument and
can indicate if the necessary directory documents do not exist.
Again, callers have been updated, but retain their original behavior.

10 years agolib: Perform the same transformation to _notmuch_database_find_directory_id
Austin Clements [Fri, 18 May 2012 04:13:35 +0000 (00:13 -0400)]
lib: Perform the same transformation to _notmuch_database_find_directory_id

Now _notmuch_database_find_directory_id takes a flags argument, which
it passes through to _notmuch_directory_create and can indicate if the
directory does not exist.  Again, callers have been updated, but
retain their original behavior.

10 years agolib: Make directory document creation optional for _notmuch_directory_create
Austin Clements [Fri, 18 May 2012 04:13:34 +0000 (00:13 -0400)]
lib: Make directory document creation optional for _notmuch_directory_create

Previously this function would create directory documents if they
didn't exist.  As a result, it could only be used on writable
databases.  This adds an argument to make creation optional and to
make this function work on read-only databases.  We use a flag
argument to avoid a bare boolean and to permit future expansion.

Both callers have been updated, but currently retain the old behavior.
We'll take advantage of the new argument in the following patches.

10 years agoemacs: use 'gnus-decoded in notmuch-mm-display-part-inline ()
Tomi Ollila [Sun, 20 May 2012 16:58:14 +0000 (19:58 +0300)]
emacs: use 'gnus-decoded in notmuch-mm-display-part-inline ()

When mail message is read from emacs, the message structure
obtained may contain parts which have content included
(`text/plain` for example) and other parts where content is not
included (`text/html` for example).

In case content is included, the string is already available in
emacs' internal format and therefore mm-... functions should not
attempt to do further decoding for the data in temp buffer
provided for it.

Currently when reply buffer is created,
notmuch-mm-display-part-inline () is used to provided quoted reply
content. This change makes the mm-... functions called by it use
'gnus-decoded as charset whenever the content is already available.

File .../emacs-23.3/lisp/gnus/mm-uu.el mentions:
"`gnus-decoded' is a fake charset, which means no further decoding."

10 years agopython: deprecate Messages.{format,print}_messages
Justus Winter [Thu, 17 May 2012 17:06:57 +0000 (19:06 +0200)]
python: deprecate Messages.{format,print}_messages

This code adds functionality at the python level that is unlikely to
be useful for anyone. Furthermore the python bindings strive to be a
thin wrapper around libnotmuch, so this code will be removed in
notmuch 0.15.

Signed-off-by: Justus Winter <>
10 years agopython: deprecate Database.db_p
Justus Winter [Thu, 17 May 2012 17:05:53 +0000 (19:05 +0200)]
python: deprecate Database.db_p

Signed-off-by: Justus Winter <>
10 years agopython: fix Message.get_header
Justus Winter [Thu, 17 May 2012 16:14:58 +0000 (18:14 +0200)]
python: fix Message.get_header

8dc8495010057202b725ac029831c03f4e3ab6bd introduced a bug, if the
requested header is not set the underlying notmuch function returns an
empty string that also made the expression true resulting in an
exception being raised. Partly revert the commit to fix this
issue. Testing for equality with None is correct in this case since
the restype of the function Message._get_header is c_char_p so NULL
pointers are in fact converted to None in this case.

Signed-off-by: Justus Winter <>
10 years agopython: add a file abstracting away differences between python 2 and 3
Justus Winter [Thu, 17 May 2012 16:13:55 +0000 (18:13 +0200)]
python: add a file abstracting away differences between python 2 and 3

Signed-off-by: Justus Winter <>
10 years agopython: remove the "notmuch binary" section from the docs
Justus Winter [Thu, 17 May 2012 15:47:49 +0000 (17:47 +0200)]
python: remove the "notmuch binary" section from the docs

Signed-off-by: Justus Winter <>
10 years agopython: Fix the remaining broken NULL pointer tests
Justus Winter [Thu, 17 May 2012 15:15:24 +0000 (17:15 +0200)]
python: Fix the remaining broken NULL pointer tests

Signed-off-by: Justus Winter <>
10 years agopython: use relative imports
Justus Winter [Thu, 17 May 2012 14:58:53 +0000 (16:58 +0200)]
python: use relative imports

Signed-off-by: Justus Winter <>
10 years agopython: remove unused import of the json module
Justus Winter [Thu, 17 May 2012 14:55:29 +0000 (16:55 +0200)]
python: remove unused import of the json module

Signed-off-by: Justus Winter <>
10 years agodebian: fix typo in changelog.
David Bremner [Wed, 16 May 2012 16:49:23 +0000 (13:49 -0300)]
debian: fix typo in changelog.

the path for NEWS was wrong
(cherry picked from commit b9520ef033ea9ae54507f94f7258641a6a1ad2e6)

10 years agoNEWS: Capitalized go bindings changes title
Tomi Ollila [Wed, 16 May 2012 07:21:50 +0000 (10:21 +0300)]
NEWS: Capitalized go bindings changes title

Align 'Go bindings changes' title capitalization to rest of the file

10 years agoNEWS: Insert markdown formatting commands in 0.13 section text
Tomi Ollila [Wed, 16 May 2012 07:21:49 +0000 (10:21 +0300)]
NEWS: Insert markdown formatting commands in 0.13 section text

NEWS entries in section 0.13 is brought consistent with rest of the
NEWS file.

10 years agoNEWS: Changed 0.13 release date in NEWS file to 2012-05-15
Tomi Ollila [Wed, 16 May 2012 07:21:48 +0000 (10:21 +0300)]
NEWS: Changed 0.13 release date in NEWS file to 2012-05-15

10 years agoNEWS: Dropped old 'Reply to sender' section
Tomi Ollila [Wed, 16 May 2012 07:21:47 +0000 (10:21 +0300)]
NEWS: Dropped old 'Reply to sender' section

'Reply to sender' section was 0.12 news which was accidentally
duplicated in 0.13 news

10 years agodebian: fix typo in changelog.
David Bremner [Wed, 16 May 2012 16:49:23 +0000 (13:49 -0300)]
debian: fix typo in changelog.

the path for NEWS was wrong

10 years agopython: remove format_message_as_{json,text} from the sphinx docs
Justus Winter [Wed, 16 May 2012 14:57:45 +0000 (16:57 +0200)]
python: remove format_message_as_{json,text} from the sphinx docs

Signed-off-by: Justus Winter <>
10 years agopython: remove functions that have been marked as deprecated in 0.13
Justus Winter [Wed, 16 May 2012 14:20:42 +0000 (16:20 +0200)]
python: remove functions that have been marked as deprecated in 0.13

Removes Message.format_message_{internal,as_json,as_text}.

This code adds functionality at the python level that is unlikely to
be useful for anyone. Furthermore the python bindings strive to be a
thin wrapper around libnotmuch. The code has been marked as deprecated
in 0.13 and is now removed.

Signed-off-by: Justus Winter <>
10 years agopython: remove
Justus Winter [Wed, 16 May 2012 14:45:56 +0000 (16:45 +0200)]
python: remove

Removes If someone wants to step up and work on this it
can always be restored using the version control system. was meant to be a python implementation of the notmuch
utility. It was never finished and hasn't been updated to changes in
the API and bindings and its features and interface haven't been kept
in sync with the notmuch utility.

Signed-off-by: Justus Winter <>
10 years agodebian: changelog stanza for 0.13 0.13
David Bremner [Tue, 15 May 2012 21:26:48 +0000 (18:26 -0300)]
debian: changelog stanza for 0.13

My usual lazy self, refer to upstream NEWS.

10 years agoversion: bump to 0.13
David Bremner [Tue, 15 May 2012 21:18:45 +0000 (18:18 -0300)]
version: bump to 0.13

10 years agoadd NEWS item about new emacs tagging interface.
Jameson Graef Rollins [Tue, 15 May 2012 16:26:42 +0000 (09:26 -0700)]
add NEWS item about new emacs tagging interface.

This is fairly important to mention, since it represents a user
interface change.

10 years agodebian: recommend notmuch-mutt as an alternative user interface
Stefano Zacchiroli [Tue, 15 May 2012 13:12:25 +0000 (15:12 +0200)]
debian: recommend notmuch-mutt as an alternative user interface

Recommend all notmuch UI (including notmuch-mutt) as alternatives, to
avoid unneeded vim/emacs installation.

Thanks Matteo F. Vescovi for the patch.

Closes: #673011
10 years agonews: Update for changes to notmuch_database_get_directory
Austin Clements [Sun, 13 May 2012 23:36:13 +0000 (19:36 -0400)]
news: Update for changes to notmuch_database_get_directory

10 years agoruby: Update for changes to notmuch_database_get_directory
Austin Clements [Sun, 13 May 2012 23:36:12 +0000 (19:36 -0400)]
ruby: Update for changes to notmuch_database_get_directory

10 years agopython: Update for changes to notmuch_database_get_directory
Austin Clements [Sun, 13 May 2012 23:36:11 +0000 (19:36 -0400)]
python: Update for changes to notmuch_database_get_directory

notmuch_database_get_directory now returns
NOTMUCH_STATUS_READ_ONLY_DATABASE on its own (rather than crashing) so
the workaround in Database.get_directory is no longer necessary.

10 years agogo: Update for changes to notmuch_database_get_directory
Austin Clements [Sun, 13 May 2012 23:36:10 +0000 (19:36 -0400)]
go: Update for changes to notmuch_database_get_directory

10 years agolib/cli: Make notmuch_database_get_directory return a status code
Austin Clements [Sun, 13 May 2012 23:36:09 +0000 (19:36 -0400)]
lib/cli: Make notmuch_database_get_directory return a status code

Previously, notmuch_database_get_directory had no way to indicate how
it had failed.  This changes its prototype to return a status code and
set an out-argument to the retrieved directory, like similar functions
in the library API.  This does *not* change its currently broken
behavior of creating directory objects when they don't exist, but it
does document it and paves the way for fixing this.  Also, it can now
check for a read-only database and return

In the interest of atomicity, this also updates calls from the CLI so
that notmuch still compiles.

10 years agoNEWS: add an entry for the go 1 compatibility
Justus Winter [Sat, 12 May 2012 13:43:23 +0000 (15:43 +0200)]
NEWS: add an entry for the go 1 compatibility

Signed-off-by: Justus Winter <>
10 years agogo: format the souce code using gofmt
Justus Winter [Wed, 9 May 2012 11:15:20 +0000 (13:15 +0200)]
go: format the souce code using gofmt

Signed-off-by: Justus Winter <>
10 years agogo: update the build system
Justus Winter [Wed, 9 May 2012 11:15:19 +0000 (13:15 +0200)]
go: update the build system

The new "go" utility does not require any Makefiles to compile go
packages and programs. Remove the old Makefiles and replace the top
level Makefile with one defining some convenience targets for
compiling the notmuch bindings and the notmuch-addrlookup utility.

Signed-off-by: Justus Winter <>
10 years agogo: update the addrlookup utility to go 1
Justus Winter [Wed, 9 May 2012 11:15:18 +0000 (13:15 +0200)]
go: update the addrlookup utility to go 1

Use the new built in error type that replaces os.Error, adapt the code
to the fact that strings.Split has just two arguments now.

Signed-off-by: Justus Winter <>
10 years agogo: set LDFLAGS to -lnotmuch in the packages source file
Justus Winter [Wed, 9 May 2012 11:15:17 +0000 (13:15 +0200)]
go: set LDFLAGS to -lnotmuch in the packages source file

Set the LDFLAGS to -lnotmuch so the resulting go package will be
linked with libnotmuch.

Signed-off-by: Justus Winter <>
10 years agogo: reorganize the go bindings
Justus Winter [Wed, 9 May 2012 11:15:16 +0000 (13:15 +0200)]
go: reorganize the go bindings

go 1 introduced the "go" program that simplifies building of libraries
and programs. This patch reorganizes the go code so it can be compiled
using the new utility, it does not change any files.

Signed-off-by: Justus Winter <>
10 years agogo: define the constant STATUS_UNBALANCED_ATOMIC
Justus Winter [Wed, 9 May 2012 10:23:08 +0000 (12:23 +0200)]
go: define the constant STATUS_UNBALANCED_ATOMIC

Add the constant STATUS_UNBALANCED_ATOMIC to the list of notmuch
status codes.

Signed-off-by: Justus Winter <>
10 years agogo: fix the notmuch status constants
Justus Winter [Wed, 9 May 2012 10:23:07 +0000 (12:23 +0200)]
go: fix the notmuch status constants

Formerly all the constants were set to zero since in golang constants
are set to the previous value if no new value is specified. Use the
iota operator that is incremented after each use to fix this issue.

Signed-off-by: Justus Winter <>
10 years agogo: update notmuch-addrlookup to the new API
Justus Winter [Wed, 9 May 2012 10:23:06 +0000 (12:23 +0200)]
go: update notmuch-addrlookup to the new API

notmuch.OpenDatabase now returns a status indicating success or
failure. Use this information to inform the user of any failures.

Signed-off-by: Justus Winter <>