]> git.notmuchmail.org Git - notmuch/log
notmuch
12 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

12 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

12 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

12 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.

12 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

12 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.

12 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
id:"CAEbOPGyuHnz4BPtDutnTPUHcP3eYcRCRkXhYoJR43RUMw671+g@mail.gmail.com"
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
functions.

12 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
id:"CAEbOPGyuHnz4BPtDutnTPUHcP3eYcRCRkXhYoJR43RUMw671+g@mail.gmail.com"
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
functions.

Test marked fix by db.

12 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.

12 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.

12 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.

12 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.

12 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.

12 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

12 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.

12 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.

12 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.

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

12 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.

12 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
whitespace.

- 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
  synopsis

12 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.

12 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.

12 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.

12 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
symbol-test.

12 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
  committer

12 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.

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

It makes no sense to run test-lib.sh, 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 test-lib.sh executable when saving it, which will
in turn case the 'basic' test to fail.

12 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.

12 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.

12 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

12 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.

12 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.

12 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.

12 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 <jani@nikula.org>
12 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 <jani@nikula.org>
12 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 <jani@nikula.org>
12 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

12 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.

12 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.

12 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".

12 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.

12 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.

12 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
buffer.

12 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.

12 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.

12 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.

12 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.

12 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'.

12 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.

12 years agoemacs: Change the default thousands separator to a space
Thomas Jost [Wed, 21 Dec 2011 13:44:19 +0000 (14:44 +0100)]
emacs: Change the default thousands separator to a space

This had been discussed and decided on IRC.

Rationale:
  Therefore the space is recommended in the SI/ISO 31-0 standard, and the
  International Bureau of Weights and Measures states that "for numbers with
  many digits the digits may be divided into groups of three by a thin space, in
  order to facilitate reading. Neither dots nor commas are inserted in the
  spaces between groups of three".

(http://en.wikipedia.org/wiki/Decimal_separator#Digit_grouping)

12 years agoemacs: rename notmuch-decimal-separator to notmuch-hello-thousands-separator
Thomas Jost [Wed, 21 Dec 2011 13:44:18 +0000 (14:44 +0100)]
emacs: rename notmuch-decimal-separator to notmuch-hello-thousands-separator

In 123,456.78, "." is the decimal separator, but "," is the thousands separator.

12 years agoemacs: Don't prompt the user to choose from zero matching addresses.
David Edmondson [Wed, 21 Dec 2011 12:35:27 +0000 (12:35 +0000)]
emacs: Don't prompt the user to choose from zero matching addresses.

If the address matching function generates no matches, don't prompt
the user to choose between them (!). Instead, generate a message to
report that there were no matches.

12 years agoemacs: Fix notmuch-mua-user-agent defcustom
Jani Nikula [Tue, 20 Dec 2011 19:53:14 +0000 (21:53 +0200)]
emacs: Fix notmuch-mua-user-agent defcustom

The :options keyword is not meaningful for function type. Also, it was not
possible to enter nil value, contrary to the notmuch-mua-user-agent
defcustom documentation. Specify the alternatives using choice type, taking
nil into account.

Signed-off-by: Jani Nikula <jani@nikula.org>
12 years agoemacs: Fix notmuch-hello-tag-list-make-query defcustom
Jani Nikula [Tue, 20 Dec 2011 19:53:13 +0000 (21:53 +0200)]
emacs: Fix notmuch-hello-tag-list-make-query defcustom

It was not possible to define custom filters or filter functions because
the types were const. Remove const to allow editing.

Signed-off-by: Jani Nikula <jani@nikula.org>
12 years agoemacs: add notmuch-hello-refresh-hook
Thomas Jost [Wed, 21 Dec 2011 01:28:14 +0000 (02:28 +0100)]
emacs: add notmuch-hello-refresh-hook

This hook is called every time a notmuch-hello buffer is updated.

12 years agonotmuch: Quiet buildbot warnings.
David Edmondson [Tue, 20 Dec 2011 15:20:04 +0000 (15:20 +0000)]
notmuch: Quiet buildbot warnings.

Cast away the result of various *write functions. Provide a default
value for some variables to avoid "use before set" warnings.

12 years agoDon't quote lambda forms
Aaron Ecay [Sat, 17 Dec 2011 15:47:48 +0000 (10:47 -0500)]
Don't quote lambda forms

This generates byte-compiler warnings on (at least) current trunk
versions of Emacs.  The quote is not necessary; lambda forms are
self-quoting.

12 years agoemacs: Add `notmuch-jump-to-recent-buffer'.
David Edmondson [Tue, 20 Dec 2011 08:01:46 +0000 (08:01 +0000)]
emacs: Add `notmuch-jump-to-recent-buffer'.

From a Carl Worth idea: add a function which will select the most
recently used notmuch buffer (search, show or hello). If no recent
buffer is found, run `notmuch'.

It is expected that the user will global bind this command to a key
sequence.

12 years agoemacs: do not call `notmuch-hello-mode' on update
Dmitry Kurochkin [Sun, 18 Dec 2011 00:21:21 +0000 (04:21 +0400)]
emacs: do not call `notmuch-hello-mode' on update

`notmuch-hello' should call `notmuch-hello-mode' function only when
run for the first time.  But before the change, `notmuch-hello' used
`kill-all-local-variables' to remove editable widgets fields.  This
caused the major mode to be reset, and `notmuch-hello-mode' to be
called every time.

The patch manually deletes all editable widget fields and removes
`kill-all-local-variables' call.

12 years agotest: add broken test for `notmuch-hello-mode-hook' called during update
Dmitry Kurochkin [Sun, 18 Dec 2011 00:21:20 +0000 (04:21 +0400)]
test: add broken test for `notmuch-hello-mode-hook' called during update

Test that `notmuch-hello-mode-hook' is not called during
`notmuch-hello' buffer updates.  The test is currently broken.

12 years agotest: add test for `notmuch-hello-mode-hook'
Dmitry Kurochkin [Sun, 18 Dec 2011 00:21:19 +0000 (04:21 +0400)]
test: add test for `notmuch-hello-mode-hook'

Test that `notmuch-hello-mode-hook' is called once when
`notmuch-hello' function is called.

12 years agotest: add `notmuch-hello-mode-hook-counter'
Dmitry Kurochkin [Sun, 18 Dec 2011 00:21:18 +0000 (04:21 +0400)]
test: add `notmuch-hello-mode-hook-counter'

Add `notmuch-hello-mode-hook-counter' hook to count how many times
`notmuch-hello-mode-hook' was called.  The counter function increments
`notmuch-hello-mode-hook-counter' variable value if it is bount,
otherwise it does nothing.

12 years agoAdd an argument to notmuch-mua-mail
Aaron Ecay [Sat, 17 Dec 2011 15:24:47 +0000 (10:24 -0500)]
Add an argument to notmuch-mua-mail

From the emacs changelog:

  ** `compose-mail' now accepts an optional 8th arg, RETURN-ACTION, and
  passes it to the mail user agent function.  This argument specifies an
  action for returning to the caller after finishing with the mail.
  This is currently used by Rmail to delete a mail window.

Under Emacs 24, notmuch breaks when this argument is passed to it by a
function in another part of Emacs.  One example of a functon that does
this is report-emacs-bug -- so notmuch users cannot file emacs bug
reports!

This patch also adds a &rest argument to the arg-list of this function,
to future-proof against such changes.  This is adapted from the approach
taken by message-mail, a similar function built into emacs.

This patch was originally submitted by richardmurri@gmail.com on Aug. 1:
id:"877h6x6oor.fsf@veracitynetworks.com"

12 years agobuild-system: use a shell variable for TMPFILE in debian-snapshot
David Bremner [Sun, 18 Dec 2011 03:16:51 +0000 (23:16 -0400)]
build-system: use a shell variable for TMPFILE in debian-snapshot

Aaron Ecay points out in
id:"1324136185-4509-1-git-send-email-aaronecay@gmail.com" that the
mktemp in

     debian-snapshot: TMPFILE := $(shell mktemp)

Is being evaluated for every target. As best I can tell, this is
because make is evaluating the right hand side, even though it is not
doing the assignment.

Of course, it isn't quite as nice to edit with the line continuations,
but it is ideomatic make.

12 years agotest: optionally print subtest number
David Bremner [Tue, 13 Dec 2011 19:56:47 +0000 (15:56 -0400)]
test: optionally print subtest number

The idea is that $test_count could be used in tests to label
intermediate files. The output enabled by this patch (and --debug)
helps figure out which OUTPUT.nn file belongs to which test in case
several subtests write to OUTPUT.$test_count

12 years agoFix build with binutils-2.22
Thomas Jost [Thu, 15 Dec 2011 19:41:58 +0000 (20:41 +0100)]
Fix build with binutils-2.22

binutils-2.22 changes the behaviour of ld by defaulting to
--no-copy-dt-needed-entries, which means that required objects/libs are not
"indirectly" linked through intermediate objects/libs anymore. As a consequence,
when using binutils-2.22, building symbol-test fails with the following error:

    /usr/bin/ld: test/symbol-test.o: undefined reference to symbol
    'std::basic_string<char, std::char_traits<char>, std::allocator<char>
    >::~basic_string()@@GLIBCXX_3.4'

    /usr/bin/ld: note: 'std::basic_string<char, std::char_traits<char>,
    std::allocator<char> >::~basic_string()@@GLIBCXX_3.4' is defined in DSO
    /usr/lib/libstdc++.so.6 so try adding it to the linker command line

    /usr/lib/libstdc++.so.6: could not read symbols: Invalid operation

An easy fix is to link using CXX instead of CC.

12 years agoIgnore dynamic libraries on OS X.
Aaron Ecay [Sat, 17 Dec 2011 15:40:49 +0000 (10:40 -0500)]
Ignore dynamic libraries on OS X.

Parallel to ignoring .so for linux.

12 years agoemacs: Add notmuch-hello-mode-hook
Ivy Foster [Sat, 29 Oct 2011 16:35:04 +0000 (12:35 -0400)]
emacs: Add notmuch-hello-mode-hook

Functions called after entering `notmuch-hello-mode'

12 years agoemacs: Document notmuch-show-get-message-properties
Daniel Schoepe [Fri, 8 Jul 2011 18:46:55 +0000 (20:46 +0200)]
emacs: Document notmuch-show-get-message-properties

12 years agoemacs: Add a face for crypto parts headers
Thomas Jost [Tue, 13 Dec 2011 17:32:10 +0000 (18:32 +0100)]
emacs: Add a face for crypto parts headers

Commit cb841878 introduced new parts handlers for crypto parts, but also
hardcoded values for their headers face. This replaces these hardcoded values
with a customizable face.

12 years agoRevert "test: add emacs test for hiding a message following an HTML part"
David Bremner [Thu, 15 Dec 2011 12:00:08 +0000 (08:00 -0400)]
Revert "test: add emacs test for hiding a message following an HTML part"

This reverts commit c6a3a768fef9f59f483af04f4418d350efc27968.

This test is unreliable, showing BROKEN in some environments and FIXED
in others.  The confusion seems to outweigh the benefits, for now.

Conflicts:

test/emacs

12 years agonotmuch: unref charset_filter to fix one memory leak
Tomi Ollila [Tue, 13 Dec 2011 18:18:48 +0000 (20:18 +0200)]
notmuch: unref charset_filter to fix one memory leak

In my test case added g_object_unref(charset_filter) reduces memory
consumption over 90% when 'notmuch show --format=text "*"' is
executed (~11000 messages, RES ~330M -> ~25M).

12 years agoemacs: support "notmuch new" as a notmuch-poll-script
Jani Nikula [Mon, 12 Dec 2011 20:50:04 +0000 (22:50 +0200)]
emacs: support "notmuch new" as a notmuch-poll-script

Support nil value for notmuch-poll-script to run "notmuch new" instead of
an external script, and make this the new default. "notmuch new" is run
using the configured notmuch-command.

This allows taking better advantage of the "notmuch new" hooks from emacs
without intermediate scripts.

Signed-off-by: Jani Nikula <jani@nikula.org>
12 years agodebian: add upstream-tag and fix debian-tag configs for git-buildpackage
Jameson Graef Rollins [Mon, 12 Dec 2011 01:21:09 +0000 (17:21 -0800)]
debian: add upstream-tag and fix debian-tag configs for git-buildpackage

Debian tags have been using '/', instead of '-' as a separator.

12 years agocommand-line-arguments.[ch]: make arrays of keyword descriptors const
David Bremner [Tue, 13 Dec 2011 03:54:24 +0000 (23:54 -0400)]
command-line-arguments.[ch]: make arrays of keyword descriptors const

It seems like it should never be necessary to modify these arrays after
initialization.

12 years agotest: add arg-test to .gitignore
David Bremner [Tue, 13 Dec 2011 02:25:48 +0000 (22:25 -0400)]
test: add arg-test to .gitignore

This should have been done when the binary was added, oops.

12 years agobuild-system: clean $(libutil_modules) rather than listing them individually.
David Bremner [Mon, 12 Dec 2011 15:54:16 +0000 (11:54 -0400)]
build-system: clean $(libutil_modules) rather than listing them individually.

This matches the way the other 'Makefile.local's work.

12 years agocli: factor out config handling code to get/set lists.
David Bremner [Sat, 10 Dec 2011 16:35:14 +0000 (12:35 -0400)]
cli: factor out config handling code to get/set lists.

Two new internal routines are created _config_get_list and
_config_set_list; the notmuch_config_get_* functions that deal with
lists are simply wrappers for these functions.

12 years agotest: add tests for hooks
Jani Nikula [Thu, 8 Dec 2011 22:48:31 +0000 (00:48 +0200)]
test: add tests for hooks

Signed-off-by: Jani Nikula <jani@nikula.org>
12 years agocli: add support for pre and post notmuch new hooks
Jani Nikula [Thu, 8 Dec 2011 22:48:30 +0000 (00:48 +0200)]
cli: add support for pre and post notmuch new hooks

Run notmuch new pre and post hooks, named "pre-new" and "post-new", if
present in the notmuch hooks directory. The hooks will be run before and
after incorporating new messages to the database.

Typical use cases for pre-new and post-new hooks are fetching or delivering
new mail to the maildir, and custom tagging of the mail incorporated to the
database.

Also add command line option --no-hooks to notmuch new to bypass the hooks.

Signed-off-by: Jani Nikula <jani@nikula.org>
12 years agocli: introduce the concept of user defined hooks
Jani Nikula [Thu, 8 Dec 2011 22:48:29 +0000 (00:48 +0200)]
cli: introduce the concept of user defined hooks

Add mechanism for running user defined hooks. Hooks are executables or
symlinks to executables stored under the new notmuch hooks directory,
<database-path>/.notmuch/hooks.

No hooks are introduced here, but adding support for a hook is now a simple
matter of calling the new notmuch_run_hook() function at an appropriate
location with the hook name.

Signed-off-by: Jani Nikula <jani@nikula.org>
12 years agotest: use python2 instead of python if available
Thomas Jost [Wed, 7 Dec 2011 09:46:18 +0000 (10:46 +0100)]
test: use python2 instead of python if available

Some distros (Arch Linux) ship Python as python2 and Python 3 as python.
Checking for python2 is necessary for the Python tests to work on these
platforms.

12 years agotest: add a function to run Python tests
Thomas Jost [Wed, 7 Dec 2011 09:46:17 +0000 (10:46 +0100)]
test: add a function to run Python tests

The new test_python() function makes writing Python tests a little easier:
- it sets the environment variables as needed
- it redirects stdout to the OUTPUT file (like test_emacs()).

This commit also declares python as an external prereq.

The stdout redirection is required to avoid trouble when running commands like
"python 'script' | sort > OUTPUT": in such a case, any error due to a missing
external prereq would be "swallowed" by sort, resulting to a failed test instead
of a skipped one.

12 years agoRelease memory allocated by internet_address_list_parse_string()
Tomi Ollila [Sat, 10 Dec 2011 10:18:54 +0000 (12:18 +0200)]
Release memory allocated by internet_address_list_parse_string()

g_object_unref() releases the memory of the InternetAddressList object
returned by internet_address_list_parse_string() -- when last (only)
reference is released, internet_address_list_finalize() will do cleanup.

12 years agotest: cleanup gdb external dependency in atomicity tests
Dmitry Kurochkin [Thu, 1 Dec 2011 22:02:46 +0000 (02:02 +0400)]
test: cleanup gdb external dependency in atomicity tests

Change atomicity tests to use the new external binary dependencies.
This simplifies the code and makes output consistent.

12 years agonotmuch-search: convert to command-line-arguments
David Bremner [Sun, 4 Dec 2011 15:26:22 +0000 (11:26 -0400)]
notmuch-search: convert to command-line-arguments

The switch on format_sel is slightly clunky, but it doesn't seem worth
special casing argument processing for function pointers, when I think
the function pointer approach will be modified/abandoned.

12 years agonotmuch-restore: convert to command-line-arguments
David Bremner [Sun, 4 Dec 2011 02:10:50 +0000 (21:10 -0500)]
notmuch-restore: convert to command-line-arguments

The new argument handling is a bit more concise, and bit more
flexible.  It allows the input file name to go before the --accumulate
option.

12 years agonotmuch-dump: convert to command-line-arguments
David Bremner [Fri, 2 Dec 2011 06:08:51 +0000 (22:08 -0800)]
notmuch-dump: convert to command-line-arguments

The output file is handled via positional arguments. There are
currently no "normal" options.

12 years agotest: tests for command-line-arguments.c
David Bremner [Wed, 7 Dec 2011 18:37:13 +0000 (14:37 -0400)]
test: tests for command-line-arguments.c

This was needed because no current notmuch code exercises the
NOTMUCH_OPT_STRING style arguments.

12 years agocommand-line-arguments.[ch]: new argument parsing framework for notmuch.
David Bremner [Thu, 1 Dec 2011 00:27:26 +0000 (16:27 -0800)]
command-line-arguments.[ch]: new argument parsing framework for notmuch.

As we noticed when Jani kindly converted things to getopt_long, much
of the work in argument parsing in notmuch is due to the the key-value
style arguments like --format=(raw|json|text).

The framework here provides positional arguments, simple switches,
and --key=value style arguments that can take a value being an integer,
a string, or one of a set of keywords.

12 years agojson: date_relative for threads
pazz [Sat, 23 Jul 2011 09:54:04 +0000 (10:54 +0100)]
json: date_relative for threads

include the date_relative field in the
json formated output of notmuch search

12 years agotest: date_relative in notmuch search json output
pazz [Sat, 23 Jul 2011 09:54:03 +0000 (10:54 +0100)]
test: date_relative in notmuch search json output

expect the date_relative field for thread entries
in notmuch search's json output

note from Commiter: we don't have to worry about the date changing
because the date in question is more than 180 days old.

12 years agoemacs: do not call notmuch show for non-inlinable parts
Dmitry Kurochkin [Tue, 29 Nov 2011 21:19:54 +0000 (01:19 +0400)]
emacs: do not call notmuch show for non-inlinable parts

Before the change, there was a workaround to avoid notmuch show calls
for parts with application/* Content-Type.  But non-inlinable parts
are not limited to this Content-Type (e.g. mp3 files have audio/mpeg
Content-Type and are not inlinable).  For such parts
`notmuch-show-insert-part-*/*' handler is called which unconditionally
fetches contents for all parts.

The patch moves content fetching from `notmuch-show-insert-part-*/*'
to `notmuch-show-mm-display-part-inline' function after MIME inlinable
checks are done to avoid useless notmuch show calls.  The
application/* hack is no longer needed and removed.

12 years agotest: check that Emacs UI does not call notmuch for non-inlinable parts
Dmitry Kurochkin [Tue, 29 Nov 2011 21:19:53 +0000 (01:19 +0400)]
test: check that Emacs UI does not call notmuch for non-inlinable parts

The patch adds two new test cases:

* Do not call notmuch for non-inlinable application/mpeg parts
* Do not call notmuch for non-inlinable audio/mpeg parts

The application/mpeg test passes thanks to a workaround for
application/* Content-Types.  The audio/mpeg is currently broken.

12 years agotest: add functions to count how much times notmuch was called
Dmitry Kurochkin [Tue, 29 Nov 2011 21:19:52 +0000 (01:19 +0400)]
test: add functions to count how much times notmuch was called

The patch adds two auxiliary functions and a variable:

  notmuch_counter_reset
  $notmuch_counter_command
  notmuch_counter_value

They allow to count how many times notmuch binary is called.
notmuch_counter_reset() function generates a script that counts how
many times it is called and resets the counter to zero.  The function
sets $notmuch_counter_command variable to the path to the generated
script that should be called instead of notmuch to do the counting.
The notmuch_counter_value() function returns the current counter
value.

12 years agoemacs: remove unused variable in `notmuch-show-insert-part-message/rfc822'
Dmitry Kurochkin [Fri, 25 Nov 2011 22:23:31 +0000 (02:23 +0400)]
emacs: remove unused variable in `notmuch-show-insert-part-message/rfc822'

An obvious cleanup.  I wonder why there was no warning about this
during compilation.

12 years agoemacs: remove some code duplication in notmuch-show
Dmitry Kurochkin [Fri, 25 Nov 2011 22:23:30 +0000 (02:23 +0400)]
emacs: remove some code duplication in notmuch-show

Add optional props argument to `notmuch-show-get-header'.  Use it to
get headers in `notmuch-show-insert-part-multipart/signed' and
`notmuch-show-insert-part-multipart/encrypted'.

12 years agotest/symbol-hiding: compare exported symbols with existing one
David Bremner [Tue, 29 Nov 2011 06:51:16 +0000 (22:51 -0800)]
test/symbol-hiding: compare exported symbols with existing one

We assume that any symbol starting with notmuch_ in lib/*.o should be
exported, and that only those symbols should be exported.

12 years agotest/symbol-hiding: add some whitespace between tests
David Bremner [Tue, 29 Nov 2011 06:51:15 +0000 (22:51 -0800)]
test/symbol-hiding: add some whitespace between tests

This is in preparation for adding a third test to this file

12 years agoMerge branch 'release'
David Bremner [Tue, 6 Dec 2011 23:39:33 +0000 (19:39 -0400)]
Merge branch 'release'

Conflicts:
NEWS

Conflicts resolved by inserting the 0.10.2 stanza before 0.11