10 years agofix .gitignore for gzipped man pages
Jani Nikula [Tue, 17 Jan 2012 18:16:03 +0000 (20:16 +0200)]
fix .gitignore for gzipped man pages

10 years agoRevert "emacs: Don't attempt to colour tags in `notmuch-show-mode'."
David Bremner [Tue, 17 Jan 2012 12:01:48 +0000 (08:01 -0400)]
Revert "emacs: Don't attempt to colour tags in `notmuch-show-mode'."

This reverts commit 4b256ff557e924fbaffca144d25a9d5f92026146.

According to id:"" and followup messages, the
assumptions of the patch seem not to hold in emacs 23.

10 years agoNEWS: consistent 2-space indentation
Tomi Ollila [Tue, 17 Jan 2012 11:00:15 +0000 (13:00 +0200)]
NEWS: consistent 2-space indentation

In NEWS file, indentation for item descriptions is generally 2 spaces
but in a few cases there were 3 or 4 (4 caused different markdown
handling) space indentations. Indentation in those lines are brought
to consistent 2-space indentation.

10 years agosearch: Support automatic tag exclusions
Austin Clements [Sun, 15 Jan 2012 00:17:34 +0000 (19:17 -0500)]
search: Support automatic tag exclusions

This adds a "search" section to the config file and an
"auto_tag_exclusions" setting in that section.  The search and count
commands pass tag tags from the configuration to the library.

10 years agolib: Add support for automatically excluding tags from queries
Austin Clements [Sun, 15 Jan 2012 00:17:33 +0000 (19:17 -0500)]
lib: Add support for automatically excluding tags from queries

This is useful for tags like "deleted" and "spam" that people
generally want to exclude from query results.  These exclusions will
be overridden if a tag is explicitly mentioned in a query.

10 years agocli: pick the user's address in a group list as from address
Jani Nikula [Sat, 14 Jan 2012 21:49:50 +0000 (23:49 +0200)]
cli: pick the user's address in a group list as from address

Messages received to a group list were not replied to using the from
address in the list. Fix it.

Signed-off-by: Jani Nikula <>
10 years agotest: add known broken test for reply from address in named group list
Jani Nikula [Sat, 14 Jan 2012 21:49:49 +0000 (23:49 +0200)]
test: add known broken test for reply from address in named group list

If a message was received to the user's address that was in a named
group list, notmuch reply does not use that address for picking the
from address.

Groups lists are of the form:,;

Signed-off-by: Jani Nikula <>
10 years agopy3k: add a specialized version of _str for python3
Justus Winter [Mon, 16 Jan 2012 12:39:41 +0000 (13:39 +0100)]
py3k: add a specialized version of _str for python3

All strings are unicode strings in python 3 and the basestring and
unicode types are removed hence the need for a specialized version.

Signed-off-by: Justus Winter <>
10 years agotest: don't bail out of `run_emacs' too early when missing prereqs
Pieter Praet [Sat, 14 Jan 2012 09:09:37 +0000 (10:09 +0100)]
test: don't bail out of `run_emacs' too early when missing prereqs

When running the Emacs tests in verbose mode, only the first missing
prereq is reported because the `run_emacs' function is short-circuited

    emacs: Testing emacs interface
     missing prerequisites: [0]  emacs(1)
     skipping test: [0]  Basic notmuch-hello view in emacs
     SKIP   [0]  Basic notmuch-hello view in emacs

This can lead to situations reminiscent of "dependency hell", so instead
of returning based on each individual `test_require_external_prereq's exit
status, we now do so only after checking all the prereqs:

    emacs: Testing emacs interface
     missing prerequisites: [0]  dtach(1) emacs(1) emacsclient(1)
     skipping test: [0]  Basic notmuch-hello view in emacs
     SKIP   [0]  Basic notmuch-hello view in emacs

Also added missing prereq for dtach(1).

10 years agoemacs: Cycle through notmuch buffers rather than jumping to the last.
David Edmondson [Wed, 28 Dec 2011 08:29:58 +0000 (08:29 +0000)]
emacs: Cycle through notmuch buffers rather than jumping to the last.

As suggested by j4ni in #notmuch, rename
`notmuch-jump-to-recent-buffer' as `notmuch-cycle-notmuch-buffers' and
have it behave accordingly.

Consider `message-mode' buffers to be of interest.

10 years agoemacs: Don't attempt to colour tags in `notmuch-show-mode'.
David Edmondson [Tue, 27 Dec 2011 16:47:14 +0000 (16:47 +0000)]
emacs: Don't attempt to colour tags in `notmuch-show-mode'.

The tags were coloured using text properties. Unfortunately that text
(the header line) also has an overlay, which overrides the text
properties. There's not point in applying text properties that will
never be seen.

10 years agoNEWS: add news items for reply to sender
Jani Nikula [Sat, 14 Jan 2012 16:39:28 +0000 (18:39 +0200)]
NEWS: add news items for reply to sender

10 years agoFix build warning: "/*" within comment
Austin Clements [Sat, 14 Jan 2012 03:08:23 +0000 (22:08 -0500)]
Fix build warning: "/*" within comment

10 years agotest: add tests for "notmuch reply" --reply-to=sender
Mark Walters [Sat, 14 Jan 2012 14:46:19 +0000 (16:46 +0200)]
test: add tests for "notmuch reply" --reply-to=sender

10 years agoemacs: bind 'r' to reply-to-sender and 'R' to reply-to-all
Jani Nikula [Sat, 14 Jan 2012 14:46:18 +0000 (16:46 +0200)]
emacs: bind 'r' to reply-to-sender and 'R' to reply-to-all

Change the default reply key bindings, making 'r' reply-to-sender and 'R'

Signed-off-by: Jani Nikula <>
10 years agoemacs: add support for replying just to the sender
Jani Nikula [Sat, 14 Jan 2012 14:46:17 +0000 (16:46 +0200)]
emacs: add support for replying just to the sender

Provide reply to sender counterparts to the search and show reply
functions. Add key binding 'R' to reply to sender, while keeping 'r' as
reply to all, both in search and show views.

Signed-off-by: Jani Nikula <>
10 years agocli: add support for replying just to the sender in "notmuch reply"
Jani Nikula [Sat, 14 Jan 2012 14:46:16 +0000 (16:46 +0200)]
cli: add support for replying just to the sender in "notmuch reply"

Add new option --reply-to=(all|sender) to "notmuch reply" to select whether
to reply to all (sender and all recipients), or just sender. Reply to all
remains the default.

Credits to Mark Walters <> for his similar earlier
work where I picked up the basic idea of handling reply-to-sender in
add_recipients_from_message(). All bugs are mine, though.

Signed-off-by: Jani Nikula <>
10 years agocli: slightly refactor "notmuch reply" address scanning functions
Jani Nikula [Sat, 14 Jan 2012 14:46:15 +0000 (16:46 +0200)]
cli: slightly refactor "notmuch reply" address scanning functions

Slightly refactor "notmuch reply" recipient and user from address scanning
functions in preparation for reply-to-sender feature.

Add support for not adding recipients at all (just scan for user from
address), and returning the number of recipients added.

No externally visible functional changes.

Signed-off-by: Jani Nikula <>
10 years agonotmuch/emacs: Observe the charset of text/html parts, where known.
David Edmondson [Fri, 13 Jan 2012 09:44:46 +0000 (09:44 +0000)]
notmuch/emacs: Observe the charset of text/html parts, where known.

Add the charset of text/html parts to the JSON output of 'notmuch
-show' when it is known. Observe the encoding when rendering such
parts in emacs.

10 years agocount: Convert to new-style argument parsing
Austin Clements [Fri, 13 Jan 2012 23:07:02 +0000 (18:07 -0500)]
count: Convert to new-style argument parsing

10 years agoSet fill column to 70 in .dir-locals.el.
Austin Clements [Thu, 12 Jan 2012 23:17:23 +0000 (18:17 -0500)]
Set fill column to 70 in .dir-locals.el.

This controls where comments and other text wraps.  70 is the default
value, so this simply returns it to the default for people who have
overridden it.  Most notmuch code already adheres to this.

10 years agoMerge branch 'release'
David Bremner [Sat, 14 Jan 2012 00:52:01 +0000 (20:52 -0400)]
Merge branch 'release'


10 years agoNEWS: set release date. 0.11 debian/0.11-1
David Bremner [Sat, 14 Jan 2012 00:28:44 +0000 (20:28 -0400)]
NEWS: set release date.

It's Friday the thirteenth. What could possibly go wrong?

10 years agodebian: changelog stanza for 0.11
David Bremner [Sat, 14 Jan 2012 00:06:39 +0000 (20:06 -0400)]
debian: changelog stanza for 0.11

10 years agoUpdate version to 0.11
David Bremner [Fri, 13 Jan 2012 23:58:36 +0000 (19:58 -0400)]
Update version to 0.11

10 years agoemacs: Improve `notmuch-hello' display on ttys.
David Edmondson [Tue, 10 Jan 2012 10:15:28 +0000 (10:15 +0000)]
emacs: Improve `notmuch-hello' display on ttys.

Inserting spaces to pad out columns is good, except when the padding
makes the line wider than the window. This looks particularly bad on a
tty where there is no fringe.

Hence, avoid padding the last column on each row.

10 years agolib: fix messages.c build warn
Jani Nikula [Sat, 7 Jan 2012 23:26:17 +0000 (01:26 +0200)]
lib: fix messages.c build warn

lib/messages.c: In function ‘notmuch_messages_move_to_next’:
lib/messages.c:131:2: warning: ISO C forbids ‘return’ with expression, in function returning void [-pedantic]

Signed-off-by: Jani Nikula <>
10 years agoman: add missing SEE ALSO header to notmuch reply man page
Jani Nikula [Sun, 8 Jan 2012 20:57:22 +0000 (22:57 +0200)]
man: add missing SEE ALSO header to notmuch reply man page

Signed-off-by: Jani Nikula <>
10 years agoemacs: Mark the quoted region during reply.
David Edmondson [Fri, 6 Jan 2012 10:03:40 +0000 (10:03 +0000)]
emacs: Mark the quoted region during reply.

Mark the quoted region of text during a reply, making it easy for the
user to delete it quickly.

10 years agoemacs: Better handling of inherited keymaps for `nomuch-help'.
David Edmondson [Fri, 30 Dec 2011 11:37:17 +0000 (11:37 +0000)]
emacs: Better handling of inherited keymaps for `nomuch-help'.

`notmuch-hello-mode' inherits the keymap for widgets, which confused
`notmuch-substitute-command-keys'. Fix the confusion.

Simplify `notmuch-substitute-command-keys' a little to make it easier
to read.

10 years agoNEWS: add news entry for notmuch reply uninitialized variable bugfix
Jani Nikula [Mon, 9 Jan 2012 11:49:56 +0000 (11:49 +0000)]
NEWS: add news entry for notmuch reply uninitialized variable bugfix

10 years agoMerge branch 'master' of ssh://
Sebastian Spaeth [Mon, 9 Jan 2012 16:25:19 +0000 (17:25 +0100)]
Merge branch 'master' of ssh://

10 years agodebian: add changelog stanza for 0.11~rc3-1
David Bremner [Mon, 9 Jan 2012 11:13:56 +0000 (07:13 -0400)]
debian: add changelog stanza for 0.11~rc3-1

as usual for pre-releases, fairly minimal commentary.

10 years agoversion: update to 0.11~rc3 0.11_rc3 debian/0.11_rc3-1
David Bremner [Mon, 9 Jan 2012 11:05:40 +0000 (07:05 -0400)]
version: update to 0.11~rc3

We found another serious-ish bug during freeze.

10 years agocli: fix use of uninitialized variable in "notmuch reply"
Jani Nikula [Thu, 5 Jan 2012 20:25:12 +0000 (22:25 +0200)]
cli: fix use of uninitialized variable in "notmuch reply"

notmuch_show_params_t params is only initialized partially in
notmuch_reply_command(). The only field that is used uninitialized is
params.decrypt. It is usually non-zero, making "notmuch reply" on encrypted
messages work by coincidence.

Initialize params properly, and set params.decrypt as needed.

Signed-off-by: Jani Nikula <>
10 years agocli: convert "notmuch reply" to use the new argument parser
Jani Nikula [Thu, 5 Jan 2012 20:25:13 +0000 (22:25 +0200)]
cli: convert "notmuch reply" to use the new argument parser

Use the new notmuch argument parser to handle arguments in "notmuch
reply". There should be no functional changes.

Signed-off-by: Jani Nikula <>
10 years agocli: fix use of uninitialized variable in "notmuch reply"
Jani Nikula [Thu, 5 Jan 2012 20:25:12 +0000 (22:25 +0200)]
cli: fix use of uninitialized variable in "notmuch reply"

notmuch_show_params_t params is only initialized partially in
notmuch_reply_command(). The only field that is used uninitialized is
params.decrypt. It is usually non-zero, making "notmuch reply" on encrypted
messages work by coincidence.

Initialize params properly, and set params.decrypt as needed.

Signed-off-by: Jani Nikula <>
10 years agoemacs: Don't signal an error when reaching the end of the search results.
David Edmondson [Tue, 20 Dec 2011 08:45:14 +0000 (08:45 +0000)]
emacs: Don't signal an error when reaching the end of the search results.

With the default configuration ('space' moves through the messages
matching the search and back to the results index at the end) it's
unnecessary to signal an error when the last message has been read, as
this is the common case.

Moreover, it's very annoying when `debug-on-error' is t.

10 years agopython test "compare message ids"
Patrick Totzke [Mon, 2 Jan 2012 14:51:27 +0000 (14:51 +0000)]
python test "compare message ids"

Introduces a second (trivial) test for the python
bindings that searches for message ids and compares
the output with that of `notmuch search`.

10 years agoclean up "compare thread ids" python test
Patrick Totzke [Mon, 2 Jan 2012 14:51:26 +0000 (14:51 +0000)]
clean up "compare thread ids" python test

This makes the test script open the database in READ_ONLY mode
and use the libraries own sorting methods instead of "sort".

10 years agoUpdate NEWS for Emacs changes
Thomas Jost [Wed, 4 Jan 2012 09:25:07 +0000 (10:25 +0100)]
Update NEWS for Emacs changes

- A fair amount of conflict resolution by db.

10 years agoNEWS: give a hint about using sort to achieve the old dump behavior.
David Bremner [Wed, 4 Jan 2012 03:19:05 +0000 (23:19 -0400)]
NEWS: give a hint about using sort to achieve the old dump behavior.

This is needed for a few applications, and actually is quite
fast (relative to the actual dump).

10 years agoNEWS: fix typos.
David Bremner [Thu, 5 Jan 2012 21:52:07 +0000 (17:52 -0400)]
NEWS: fix typos.

Thanks to Xavier for one of these.

10 years agoupdate NEWS
Jameson Graef Rollins [Mon, 2 Jan 2012 22:16:51 +0000 (14:16 -0800)]
update NEWS

This change looks slightly larger than it actually is, since I moved
the emacs section below the Performance and Memory Management

10 years agoemacs: fix notmuch-show-indent-messages-width customization variable name
Jameson Graef Rollins [Mon, 2 Jan 2012 22:23:02 +0000 (14:23 -0800)]
emacs: fix notmuch-show-indent-messages-width customization variable name

The name was originally notmuch-indent-messages-width, which is
inconsistent with our variable naming convention.

10 years agopython: str.decode() doesn't like kwargs in python 2.5
Sebastian Spaeth [Mon, 2 Jan 2012 16:07:53 +0000 (17:07 +0100)]
python: str.decode() doesn't like kwargs in python 2.5

Recent changes introduced lots of unicodification of strings, mostly in
the form of .decode('utf-8', errors='ignore'). However, python 2.5 does
not like the errors keyword argument and complains. It does work when
used as a simple arg though, so that's what this patch does.

Signed-off-by: Sebastian Spaeth <>
10 years agopython: make the result of Message.get_replies() more pythonic
Justus Winter [Wed, 21 Dec 2011 13:15:02 +0000 (14:15 +0100)]
python: make the result of Message.get_replies() more pythonic

Formerly Message.get_replies() returned an iterator or None forcing
users to check the result before iterating over it leading to strange
looking code at the call site.

Fix this flaw by adding an EmptyMessagesResult class that behaves like
the Messages class but immediatly raises StopIteration if used as an
iterator and returning objects of this type from Message.get_replies()
to indicate that there are no replies.

10 years agopython: refactor print_messages into format_messages and print_messages
Justus Winter [Wed, 21 Dec 2011 13:15:01 +0000 (14:15 +0100)]
python: refactor print_messages into format_messages and print_messages

10 years agopython: add missing conversions from and to utf-8
Justus Winter [Wed, 14 Dec 2011 10:58:25 +0000 (11:58 +0100)]
python: add missing conversions from and to utf-8

10 years agopy3k: Add and use a mixin class that implements __str__
Justus Winter [Wed, 14 Dec 2011 13:04:35 +0000 (14:04 +0100)]
py3k: Add and use a mixin class that implements __str__

Amended by Sebastian Spaeth <> to include the
required sys import in

10 years agopy3k: Rename .next() to __next__(), add python2.x compatibility alias
Justus Winter [Wed, 14 Dec 2011 10:58:22 +0000 (11:58 +0100)]
py3k: Rename .next() to __next__(), add python2.x compatibility alias

10 years agopy3k: All strings are unicode strings in py3k
Justus Winter [Wed, 14 Dec 2011 10:58:21 +0000 (11:58 +0100)]
py3k: All strings are unicode strings in py3k

10 years agopy3k: The ConfigParser module has been renamed to configparser
Justus Winter [Wed, 14 Dec 2011 10:58:20 +0000 (11:58 +0100)]
py3k: The ConfigParser module has been renamed to configparser

10 years agopy3k: The execfile built-in has been removed in python 3
Justus Winter [Wed, 14 Dec 2011 10:58:19 +0000 (11:58 +0100)]
py3k: The execfile built-in has been removed in python 3

10 years agodebian: changelog stanza for 0.11~rc2-1 0.11_rc2 debian/0.11_rc2-1
David Bremner [Mon, 2 Jan 2012 11:07:31 +0000 (07:07 -0400)]
debian: changelog stanza for 0.11~rc2-1

Set dist=experimental the first time.

10 years agodebian: fix typo in changelog
David Bremner [Mon, 2 Jan 2012 11:04:29 +0000 (07:04 -0400)]
debian: fix typo in changelog

Previous version was actually uploaded to experimental, not unstable

10 years agoversion: bump to 0.11~rc2
David Bremner [Sun, 1 Jan 2012 00:45:24 +0000 (20:45 -0400)]
version: bump to 0.11~rc2

This to "celebrate" pushing a bugfix in at the last minute.

10 years agolib: call g_mime_init() from notmuch_database_open()
Kazuo Teramoto [Sat, 31 Dec 2011 04:37:41 +0000 (02:37 -0200)]
lib: call g_mime_init() from notmuch_database_open()

As reported in
sometimes gmime tries to access a NULL pointer, e.g. g_mime_iconv_open()
tries to access iconv_cache that is NULL if g_mime_init() is not called.
This causes notmuch to segfault when calling gmime functions.

Calling g_mime_init() initializes iconv_cache and others variables needed
by gmime, making sure they are initialized when notmuch calls gmime

10 years agolib: call g_mime_init() from notmuch_database_open()
Kazuo Teramoto [Sat, 31 Dec 2011 04:37:41 +0000 (02:37 -0200)]
lib: call g_mime_init() from notmuch_database_open()

As reported in
sometimes gmime tries to access a NULL pointer, e.g. g_mime_iconv_open()
tries to access iconv_cache that is NULL if g_mime_init() is not called.
This causes notmuch to segfault when calling gmime functions.

Calling g_mime_init() initializes iconv_cache and others variables needed
by gmime, making sure they are initialized when notmuch calls gmime

Test marked fix by db.

10 years agotest: add two new messages to corpus with iso-8859-1 encoding
David Bremner [Sun, 1 Jan 2012 02:15:02 +0000 (22:15 -0400)]
test: add two new messages to corpus with iso-8859-1 encoding

One is quoted printable, the other users 8 bit encoding. The latter
triggers a bug in the python bindings due to missing call to
g_mime_init. The corresponding test is marked broken in this commit.

10 years agotest: use file based comparison for search '*' test
David Bremner [Sun, 1 Jan 2012 02:52:45 +0000 (22:52 -0400)]
test: use file based comparison for search '*' test

This seems a bit easier to maintain, and is more accurate since lines
are not joined together.

10 years agonotmuch: replace built-in help with exec of man
David Bremner [Thu, 22 Dec 2011 01:45:59 +0000 (21:45 -0400)]
notmuch: replace built-in help with exec of man

"notmuch help" now relies on a working man installation, and a correct
setting of MANPATH, for users that install in "unusual" places. This
should probably noted in NEWS before shipping.

There is still some small duplication of docs as the one line
summaries are hard coded in the binary. This seems preferable to
complicated script games, at least as long was we are using a
presentation level markup like nroff.

10 years agoforce install notmuch-setup.1 symlink
Jameson Graef Rollins [Tue, 27 Dec 2011 17:23:47 +0000 (09:23 -0800)]
force install notmuch-setup.1 symlink

This will prevent the install from failing if the link already exists.

10 years agobreak up dump and restore man pages.
Jameson Graef Rollins [Tue, 27 Dec 2011 06:36:32 +0000 (22:36 -0800)]
break up dump and restore man pages.

These functions are enough different in their behavior that it's not
really worth it to combine them.  They overlap in the format of the
dump file, but we can have a separate page that describes the dump
format, and either reference it or include it.  This also keeps things
nice and clean with one page per command.

10 years agoremove reference to notmuch-part.1 from Makefile.local
Jameson Graef Rollins [Tue, 27 Dec 2011 05:44:26 +0000 (21:44 -0800)]
remove reference to notmuch-part.1 from Makefile.local

10 years agodebian: install split man pages.
David Bremner [Wed, 21 Dec 2011 18:48:40 +0000 (14:48 -0400)]
debian: install split man pages.

We now have man pages in sections 5 and 7 as well, so we copy the
whole /usr/share/man hierarchy.

10 years agobuild-system: update for split man pages
David Bremner [Tue, 20 Dec 2011 20:35:13 +0000 (16:35 -0400)]
build-system: update for split man pages

- We have to remove the installation of notmuch.1.gz from the top
level Makefile.local.

- Man pages with multiple names are handled by making relative
  symlinks in the install-man target.

- update version tests and convenience rules for split man pages

  The man page version test still only checks notmuch.1, but the
  location is updated.

  update-man-versions is longer than the one-line previously in
  update-versions mainly because I decided to take the high road and
  stick to POSIX sed (thus, no sed -i). The sed regex itself is more
  complicated to cope with variations in the headers.

10 years agoman/*: fixup page references
David Bremner [Tue, 20 Dec 2011 01:41:48 +0000 (21:41 -0400)]
man/*: fixup page references

- Replace references to section X below with page refences.

- Add SEE ALSO to each page.  This is a bit error prone, because each
  SEE ALSO section is different, i.e. a page does not refer to itself.

10 years agonotmuch-config.1: fix typo
David Bremner [Tue, 20 Dec 2011 00:59:22 +0000 (20:59 -0400)]
notmuch-config.1: fix typo

10 years agonotmuch.1: smooth wording.
David Bremner [Mon, 19 Dec 2011 13:21:26 +0000 (09:21 -0400)]
notmuch.1: smooth wording.

After most of the content was ripped out of the page, a few words were
needed to glue things back togetehr.

10 years agoman/*: formatting cleanup
David Bremner [Tue, 20 Dec 2011 00:53:37 +0000 (20:53 -0400)]
man/*: formatting cleanup

Fix some problems with indentation (controlled by markup) and

- notmuch.1: reformat

  Use .SS macro to make "notmuch setup" a subsection. Introduce another
  subsection for the remaining commands.

- notmuch-config.1: reformat

   Put all the syntax in the synopsis. Supposedly this is the the UNIX way.

- notmuch-reply.1: fix formatting issues.

  Give nicer formatting for synopsis.

  Insert missing SEE ALSO header.

- notmuch-dump.1: reformat using subsections

  These seems more natural, although, as mentioned, it does require
  referring back to the synopsis. Or maybe copying parts of the

10 years agoman: add symlinks for notmuch-restore.1 and notmuch-setup.1
David Bremner [Thu, 22 Dec 2011 12:01:25 +0000 (08:01 -0400)]
man: add symlinks for notmuch-restore.1 and notmuch-setup.1

These are just for the convenience of testers using $src/man as an
element of MANPATH. They are intentionally omitted from MAN1, so that
they do not interfere with the install.

10 years agoremove notmuch-part from documentation.
David Bremner [Mon, 26 Dec 2011 23:31:11 +0000 (19:31 -0400)]
remove notmuch-part from documentation.

This should have been done when "notmuch part" was deprecated and
replaced by notmuch show --part, but it slipped through the cracks.

10 years agoinitial splitting of notmuch.1
David Bremner [Mon, 19 Dec 2011 02:38:24 +0000 (22:38 -0400)]
initial splitting of notmuch.1

We mostly just cut and paste the command descriptions into individual
files, with a short header added to each one.

The splitting into subdirectories is to support the use of ./man as an
element in MANPATH, e.g. for testing.

10 years agotest/symbol-hiding: prepend new directory to LD_LIBRARY_PATH
Tomi Ollila [Fri, 30 Dec 2011 16:12:45 +0000 (18:12 +0200)]
test/symbol-hiding: prepend new directory to LD_LIBRARY_PATH

Tester may have set LD_LIBRARY_PATH to find libraries required
by notmuch. Therefore add $TEST_DIRECTORY/../lib to the beginning
of current list of library paths in $LD_LIBRARY_PATH before running

10 years agoUpdate NEWS for change by Aaron Ecay
Aaron Ecay [Fri, 30 Dec 2011 18:42:24 +0000 (13:42 -0500)]
Update NEWS for change by Aaron Ecay

- text moved around within NEWS into existing Emacs section by

10 years agoNEWS: add item for notmuch-deliver
David Bremner [Fri, 30 Dec 2011 12:12:39 +0000 (08:12 -0400)]
NEWS: add item for notmuch-deliver

Ali mentioned he is very busy these days, so I just made something up
rather than waiting for a NEWS item from him.

10 years agotest: Remove #! line from
Austin Clements [Thu, 29 Dec 2011 02:34:56 +0000 (21:34 -0500)]
test: Remove #! line from

It makes no sense to run, so it makes no sense to give it
an interpreter.  This is particularly annoying for Emacs users who
have executable-insert set, since the presence of the #! line will
cause Emacs to mark executable when saving it, which will
in turn case the 'basic' test to fail.

10 years agotest: Make generated message date a real date
Austin Clements [Thu, 29 Dec 2011 02:34:43 +0000 (21:34 -0500)]
test: Make generated message date a real date

January 5, 2001 was a Tuesday, not a Friday.  Jameson fixed this exact
problem for the multipart test in ec2b0a98cc, but not for
generate_message itself.

As Jameson pointed out in ec2b0a98cc, if we want to test date parsing,
we should do it separately.

10 years agoIgnore encrypted parts when indexing.
Jameson Graef Rollins [Wed, 28 Dec 2011 20:14:29 +0000 (12:14 -0800)]
Ignore encrypted parts when indexing.

It appears to be an oversight that encrypted parts were indexed
previously.  The terms generated from encrypted parts are meaningless
and do nothing but add bloat to the database.  It is not worth
indexing the encrypted content, just as it's not worth indexing the
signatures in signed parts.

10 years agoNEWS: two memory leaks fixes for 0.11
Tomi Ollila [Wed, 28 Dec 2011 19:54:59 +0000 (21:54 +0200)]
NEWS: two memory leaks fixes for 0.11

10 years agotest: allow user to choose which emacs to run tests with.
David Bremner [Wed, 28 Dec 2011 17:08:21 +0000 (13:08 -0400)]
test: allow user to choose which emacs to run tests with.

As we start to pay more attention to emacs24, it helps to be able to
select a different version of emacs to run the tests with to verify
version specific bugs.

A separate variable TEST_EMACS is needed to avoid being overwritten by the
make variable EMACS in Makefile.config

For what it's worth, the value of emacs is chosen at the time
tmp.emacs/run_emacs is created, so is fixed for all subtests.

10 years agotest: Updated the expected output to match the newly enabled text/plain hooks.
David Edmondson [Wed, 28 Dec 2011 15:04:28 +0000 (15:04 +0000)]
test: Updated the expected output to match the newly enabled text/plain hooks.

10 years agoemacs: Enable more text/plain hook functions by default.
David Edmondson [Wed, 28 Dec 2011 15:04:27 +0000 (15:04 +0000)]
emacs: Enable more text/plain hook functions by default.

Users are missing out on various functions which usefully improve the
display of text/plain message parts because they are not enabled by
default. Enable a useful set.

`notmuch-wash-convert-inline-patch-to-part' is _not_ enabled by
default as it is based on a heuristic.

10 years agotest: emacs: test notmuch-wash-subject-to-* functions
Jani Nikula [Tue, 27 Dec 2011 16:04:40 +0000 (18:04 +0200)]
test: emacs: test notmuch-wash-subject-to-* functions

Signed-off-by: Jani Nikula <>
10 years agoemacs: create patch filename from subject for inline patch fake parts
Jani Nikula [Tue, 27 Dec 2011 16:04:39 +0000 (18:04 +0200)]
emacs: create patch filename from subject for inline patch fake parts

Use the mail subject line for creating a descriptive filename for the wash
generated inline patch fake parts. The names are similar to the ones
created by 'git format-patch'.

If the user has notmuch-wash-convert-inline-patch-to-part hook enabled in
notmuch-show-insert-text/plain-hook, this will change the old default
filename of "inline patch" in fake parts:

[ inline patch: inline patch (as text/x-diff) ]

into, for example:

[ 0002-emacs-create-patch-filename-from-subject-for-inline.patch: inline patch (as text/x-diff) ]

which is typically the same filename the sender had if he was using 'git
format-patch' and 'git send-email'.

Signed-off-by: Jani Nikula <>
10 years agoemacs: add inline patch fake parts through a special handler
Jani Nikula [Tue, 27 Dec 2011 16:04:38 +0000 (18:04 +0200)]
emacs: add inline patch fake parts through a special handler

Add wash generated inline patch fake parts through a special
"inline-patch-fake-part" handler to distinguish them from real MIME
parts. The fake parts are described as "inline patch (as text/x-diff)".

Signed-off-by: Jani Nikula <>
10 years agoNEWS: emacs: notmuch-poll-script and saved search news items
Jani Nikula [Mon, 26 Dec 2011 14:38:59 +0000 (16:38 +0200)]
NEWS: emacs: notmuch-poll-script and saved search news items

10 years agoversion: update version to 0.11~rc1 0.11_rc1 debian/0.11_rc1-1
David Bremner [Mon, 26 Dec 2011 03:09:17 +0000 (23:09 -0400)]
version: update version to 0.11~rc1

and keep python, man page, and debian package in sync.

10 years agoshow: Rewrite show_message_body to use the MIME tree interface.
Austin Clements [Sat, 24 Dec 2011 18:52:46 +0000 (13:52 -0500)]
show: Rewrite show_message_body to use the MIME tree interface.

This removes all of the MIME traversal logic from show_message_body
and leaves only its interaction with the format callbacks.

Besides isolating concerns, since traversal happens behind a trivial
interface, there is now much less code duplication in
show_message_part.  Also, this uses mime_node_seek_dfs to start at the
requested part, eliminating all of the logic about parts being
selected or being in_zone (and reducing the "show state" to only a
part counter).  notmuch_show_params_t no longer needs to be passed
through the recursion because the only two fields that mattered
(related to crypto) are now handled by the MIME tree.

The few remaining complexities in show_message_part highlight
irregularities in the format callbacks with respect to top-level
messages and embedded message parts.

Since this is a rewrite, the diff is not very enlightening.  It's
easier to look at the old code and the new code side-by-side.

10 years agoUtility function to seek in MIME trees in depth-first order.
Austin Clements [Sat, 24 Dec 2011 18:52:45 +0000 (13:52 -0500)]
Utility function to seek in MIME trees in depth-first order.

This function matches how we number parts for the --part argument to
show.  It will allow us to jump directly to the desired part, rather
than traversing the entire tree and carefully tracking whether or not
we're "in the zone".

10 years agoIntroduce a generic tree-like abstraction for MIME traversal.
Austin Clements [Sat, 24 Dec 2011 18:52:44 +0000 (13:52 -0500)]
Introduce a generic tree-like abstraction for MIME traversal.

This wraps all of the complex MIME part handling in a single, simple
function that gets part N from *any* MIME object, so traversing a MIME
part tree becomes a two-line for loop.  Furthermore, the MIME node
structure provides easy access to envelopes for message parts as well
as cryptographic information.

This code is directly derived from the current show_message_body code
(much of it is identical), but the control relation is inverted:
instead of show_message_body controlling the traversal of the MIME
structure and invoking callbacks, the caller controls the traversal of
the MIME structure.

10 years agoshow: Pass notmuch_message_t instead of path to show_message_body.
Austin Clements [Sat, 24 Dec 2011 18:52:43 +0000 (13:52 -0500)]
show: Pass notmuch_message_t instead of path to show_message_body.

In addition to simplifying the code, we'll need the notmuch_message_t*
in show_message_body shortly.

10 years agoemacs: fix docstring for `notmuch-search-line-faces'.
Dmitry Kurochkin [Fri, 23 Dec 2011 20:40:34 +0000 (00:40 +0400)]
emacs: fix docstring for `notmuch-search-line-faces'.

Examples in documentation for `notmuch-search-line-faces' had an extra
quote, e.g.:

  '(\"unread\" . '(:foreground \"green\"))

Which resulted in values like:

  (\"unread\" quote (:foreground \"green\"))

And tons of "Invalid face reference: quote" errors in the messages

10 years agoemacs: call notmuch-show instead of notmuch-search in buttonised id: links
Jameson Graef Rollins [Fri, 23 Dec 2011 04:59:12 +0000 (20:59 -0800)]
emacs: call notmuch-show instead of notmuch-search in buttonised id: links

Since message-ids necessarily match just a single message, there's no
reason to do a search for the id before viewing the actual message;
the search just becomes an extra screen to click through.  Clicking on
an id: links now just jumps straight to the message itself.

10 years agoFix comments about what is stored in the database
Thomas Jost [Tue, 13 Dec 2011 17:11:41 +0000 (18:11 +0100)]
Fix comments about what is stored in the database

Commit 567bcbc2 introduced two new values for each message (content of the
"From" and "Subject" headers), but the comments about the database schema had
not been updated accordingly.

10 years agoemacs: fix off-by-one bug in notmuch-show-archive
Aaron Ecay [Thu, 22 Dec 2011 14:24:20 +0000 (09:24 -0500)]
emacs: fix off-by-one bug in notmuch-show-archive

Text properties change between characters; prev-s-c-property-change
returns the position after the change.  Thus, it is still inside the
invisible region.

10 years agoemacs: put the last search on top of recent searches in notmuch-hello
Dmitry Kurochkin [Thu, 22 Dec 2011 00:23:50 +0000 (04:23 +0400)]
emacs: put the last search on top of recent searches in notmuch-hello

Notmuch-hello stores a list of recent searches.  Before the change, if
a search from this list is repeated, the recent search list is not
changed.  The patch makes repeated recent searches move to the head of
the list.  I.e. the last search is always on top of the recent search
list, which is what one would expect from a history list.

10 years agotest: add test for `notmuch-hello-refresh-hook'
Dmitry Kurochkin [Wed, 21 Dec 2011 18:18:26 +0000 (22:18 +0400)]
test: add test for `notmuch-hello-refresh-hook'

Test that `notmuch-hello-refresh-hook' is called once when
`notmuch-hello' is called and twice when calling
`notmuch-hello-update' after that.

The tests are very similar to tests for `notmuch-hello-mode-hook'.

10 years agotest: add general Emacs hook counter
Dmitry Kurochkin [Wed, 21 Dec 2011 18:18:25 +0000 (22:18 +0400)]
test: add general Emacs hook counter

Replace `notmuch-hello-mode-hook-counter' with general `hook-counter'
and `add-hook-counter' functions to allow counting calls for any hook.