notmuch
3 years agoMerge branch 'release'
David Bremner [Sat, 25 Mar 2017 14:51:03 +0000 (11:51 -0300)]
Merge branch 'release'

wildcard search fixes, plus release busywork

3 years agodebian: start changelog for 0.24.1-1
David Bremner [Sat, 25 Mar 2017 14:22:55 +0000 (11:22 -0300)]
debian: start changelog for 0.24.1-1

3 years agoversion: bump to 0.24.1
David Bremner [Sat, 25 Mar 2017 14:20:56 +0000 (11:20 -0300)]
version: bump to 0.24.1

The release is not yet finalized, but start the busywork needed.

3 years agotests: add compatibility layer
Mikhail [Thu, 9 Mar 2017 13:32:43 +0000 (09:32 -0400)]
tests: add compatibility layer

Make test-lib-common.sh load test-lib-<$PLATFORM>.sh to create
additional shim for platform specifics.

Use test-lib-FREEBSD.sh to call GNU utilities instead of native ones.

- amended by db following Tomi's suggestions

3 years agolib: only trigger phrase processing for regexp fields when needed
David Bremner [Sat, 18 Mar 2017 02:23:51 +0000 (23:23 -0300)]
lib: only trigger phrase processing for regexp fields when needed

The argument is that if the string passed to the field processor has
no spaces, then the added quotes won't have any benefit except for
disabling wildcards. But disabling wildcards doesn't seem very useful
in the normal Xapian query parser, since they're stripped before
generating terms anyway. It does mean that the query 'from:"foo*"' will
not be precisely equivalent to 'from:foo' as it is for the non
field-processor version.

3 years agotest: add known broken tests wildcard search in from and subject
David Bremner [Fri, 17 Mar 2017 12:17:48 +0000 (09:17 -0300)]
test: add known broken tests wildcard search in from and  subject

This was broken by the addition of regexp searching. The detection of
wildcards is not currently done in the recursive call to parse_query,
because of quoting issues.

3 years agodebian rename libnotmuch4 to libnotmuch5
David Bremner [Wed, 22 Mar 2017 12:00:20 +0000 (09:00 -0300)]
debian rename libnotmuch4 to libnotmuch5

follow the SONAME bump

3 years agopython: bump SOVERSION to 5
David Bremner [Wed, 22 Mar 2017 12:19:02 +0000 (09:19 -0300)]
python: bump SOVERSION to 5

Otherwise hilarity ensues when the python bindings try to use the new
API against the old shared library.

3 years agolib: make notmuch_query_add_tag_exclude return a status value
David Bremner [Sat, 18 Feb 2017 15:08:04 +0000 (11:08 -0400)]
lib: make notmuch_query_add_tag_exclude return a status value

Since this is an ABI breaking change, but we already bumped the SONAME
for the next release

3 years agolib: replace deprecated n_q_count_threads with status returning version
David Bremner [Sun, 26 Feb 2017 21:21:35 +0000 (17:21 -0400)]
lib: replace deprecated n_q_count_threads with status returning version

This function was deprecated in notmuch 0.21.  We re-use the name for
a status returning version, and deprecate the _st name.

3 years agolib: replace deprecated n_q_count_messages with status returning version
David Bremner [Sun, 26 Feb 2017 21:21:34 +0000 (17:21 -0400)]
lib: replace deprecated n_q_count_messages with status returning version

This function was deprecated in notmuch 0.21.  We re-use the name for
a status returning version, and deprecate the _st name. One or two
remaining uses of the (removed) non-status returning version fixed at
the same time

3 years agolib: replace deprecated n_q_search_messages with status returning version
David Bremner [Sun, 26 Feb 2017 21:21:32 +0000 (17:21 -0400)]
lib: replace deprecated n_q_search_messages with status returning version

This function was deprecated in notmuch 0.21.  We re-use the name for
a status returning version, and deprecate the _st name.

3 years agolib: replace n_query_search_threads with status returning version
David Bremner [Sun, 26 Feb 2017 21:21:31 +0000 (17:21 -0400)]
lib: replace n_query_search_threads with status returning version

This function was deprecated in notmuch 0.21. We finally remove the
deprecated API, and rename the status returning version to the simpler
name. The status returning is kept as a deprecated alias.

3 years agolib: bump SONAME to libnotmuch5
David Bremner [Sun, 26 Feb 2017 21:21:30 +0000 (17:21 -0400)]
lib: bump SONAME to libnotmuch5

We plan a sequence of ABI breaking changes. Put the SONAME change in a
separate commit to make reordering easier.

3 years agorename libutil.a to libnotmuch_util.a
David Bremner [Tue, 14 Mar 2017 11:10:07 +0000 (08:10 -0300)]
rename libutil.a to libnotmuch_util.a

Apparently some systems (MacOS?) have a system library called libutil
and the name conflict causes problems. Since this library is quite
notmuch specific, rename it to something less generic.

3 years agoMerge branch 'release'
David Bremner [Sun, 19 Mar 2017 00:02:42 +0000 (21:02 -0300)]
Merge branch 'release'

Merge in memory fixes

3 years agolib/message.cc: fix Coverity finding (use after free)
Tomi Ollila [Fri, 17 Mar 2017 22:28:48 +0000 (00:28 +0200)]
lib/message.cc: fix Coverity finding (use after free)

The object where pointer to `data` was received was deleted before
it was used in _notmuch_string_list_append().

Relevant Coverity messages follow:

3: extract
Assigning: data = std::__cxx11::string(message->doc.()).c_str(),
which extracts wrapped state from temporary of type std::__cxx11::string.

4: dtor_free
The internal representation of temporary of type std::__cxx11::string
is freed by its destructor.

5: use after free:
Wrapper object use after free (WRAPPER_ESCAPE)
Using internal representation of destroyed object local data.

3 years agocli/show: unref crlf filter.
David Bremner [Sat, 18 Mar 2017 17:46:42 +0000 (14:46 -0300)]
cli/show: unref crlf filter.

Mimic the handling of the other filter g_objects. This cleans up a
fair sized memory leak.

3 years agocli/show: fix usage of g_mime_content_type_to_string
David Bremner [Sat, 18 Mar 2017 17:33:50 +0000 (14:33 -0300)]
cli/show: fix usage of g_mime_content_type_to_string

It returns an "allocated string", which needs to be freed.

3 years agocli/show: fix some memory leaks in format_part_text
David Bremner [Sat, 18 Mar 2017 17:07:45 +0000 (14:07 -0300)]
cli/show: fix some memory leaks in format_part_text

Mimic Jeff Stedfast's changes to format_headers_sprinter, clean up use
of internet_address_list_to_string and
g_mime_message_get_date_as_string.

3 years agofix memory leaks in notmuch-show.c:format_headers_sprinter()
Jeffrey Stedfast [Thu, 16 Mar 2017 16:53:47 +0000 (16:53 +0000)]
fix memory leaks in notmuch-show.c:format_headers_sprinter()

Internet_address_list_to_string() and
g_mime_message_get_date_as_string() return allocated string buffers
and not const, so from what I can tell from taking a look at the
sprinter-sexp.c’s sexp_string() function, the code leaks the
recipients_string as well as the date string.

3 years agoperf-test/mem: add simple memory tests for notmuch search
David Bremner [Sat, 18 Mar 2017 19:35:51 +0000 (16:35 -0300)]
perf-test/mem: add simple memory tests for notmuch search

Just copy and replace from the show tests. Currently these show no
major leaks.

3 years agoperf-test: add simple memory tests for notmuch-show
David Bremner [Sat, 18 Mar 2017 16:40:25 +0000 (13:40 -0300)]
perf-test: add simple memory tests for notmuch-show

These are probably too slow to run with the full corpus

3 years agoperf-test: use 'eval' in memory_run
David Bremner [Sat, 18 Mar 2017 16:34:32 +0000 (13:34 -0300)]
perf-test: use 'eval' in memory_run

This allows the use of redirection in the tests

3 years agotest-databases: use wget or curl to download test databases
Tomi Ollila [Sun, 12 Mar 2017 12:59:33 +0000 (14:59 +0200)]
test-databases: use wget or curl to download test databases

Often Linux systems are shipped with wget(1) by default (and no curl).

Many BSDs, macOS, and e.g. some Linux minimal/container images
comes with curl(1) (and no wget).

Attempting to download with curl if wget is not available increases
the likelihood for this to succeed.

3 years agolib: clamp return value of g_mime_utils_header_decode_date to >=0
David Bremner [Sun, 12 Mar 2017 12:51:01 +0000 (09:51 -0300)]
lib: clamp return value of g_mime_utils_header_decode_date to >=0

For reasons not completely understood at this time, gmime (as of
2.6.22) is returning a date before 1900 on bad date input. Since this
confuses some other software, we clamp such dates to 0,
i.e. 1970-01-01.

3 years agolib: add known broken test for parsing bad dates.
David Bremner [Sun, 12 Mar 2017 12:51:00 +0000 (09:51 -0300)]
lib: add known broken test for parsing bad dates.

This reproduces the symptoms of bug report
id:20150422065630.6330.90536@hoothoot

3 years agoemacs: use epg-gpg-program
John Byrnes [Sun, 12 Mar 2017 19:26:16 +0000 (21:26 +0200)]
emacs: use epg-gpg-program

Adjusted notmuch-crypto gpg call-process function to respect
the GPG program set by the EasyPG epg-gpg-program variable.

This is to correct a problem observed on NixOS where only gpg2 is
installed by default. The Notmuch Emacs frontend fails when trying to
access someone's key to verify their signature when it cannot find the
GPG binary.

3 years agoMerge branch 'release'
David Bremner [Mon, 13 Mar 2017 01:43:11 +0000 (22:43 -0300)]
Merge branch 'release'

final 0.24 release

3 years agobuild: replace remaining uses of SHA1_FILE 0.24
David Bremner [Mon, 13 Mar 2017 01:31:16 +0000 (22:31 -0300)]
build: replace remaining uses of SHA1_FILE

oops. If only there was some editor facility that allowed replacing
all instances of a string.

3 years agodebian: changelog stanza for 0.24-1
David Bremner [Mon, 13 Mar 2017 01:15:05 +0000 (22:15 -0300)]
debian: changelog stanza for 0.24-1

3 years agoNEWS: set release date
David Bremner [Mon, 13 Mar 2017 01:10:36 +0000 (22:10 -0300)]
NEWS: set release date

3 years agoversion: bump to 0.24
David Bremner [Mon, 13 Mar 2017 01:08:54 +0000 (22:08 -0300)]
version: bump to 0.24

3 years agofix out of tree tests
Tomi Ollila [Sun, 12 Mar 2017 11:59:14 +0000 (13:59 +0200)]
fix out of tree tests

Use $NOTMUCH_SRCDIR/ instead of $TEST_DIRECTORY/../ (in those 2 places)
where reference to source directory instead of build directory is
required.

3 years agofix out of tree build
Tomi Ollila [Sun, 12 Mar 2017 11:59:13 +0000 (13:59 +0200)]
fix out of tree build

In addition to use ${srcdir} and deliver ${NOTMUCH_SRCDIR} where needed,
source from ruby bindings had to be copied to the out-of-tree target
directory -- if the source files in source directory were referenced
in build and there were also built object files there, those could have
been considered as target files (and then not found when attempting
to create bindings/ruby/notmuch.so).

3 years agoconfigure: add ${NOTMUCH_SRCDIR} -- absolute path to notmuch source
Tomi Ollila [Sun, 12 Mar 2017 11:59:12 +0000 (13:59 +0200)]
configure: add ${NOTMUCH_SRCDIR} -- absolute path to notmuch source

The ${srcdir} -- usually relative path to notmuch source -- works fine
in current ./configure and all makefiles. To have simple access to
notmuch source in tests and out of tree builds holding absolute path to
the source directory is useful.

3 years agolib/database: reduce try block scope to things that really need it
Jani Nikula [Sat, 17 Dec 2016 16:26:54 +0000 (18:26 +0200)]
lib/database: reduce try block scope to things that really need it

No need to maintain the pure C stuff within a try block, it's arguably
confusing. This also reduces indent for a bunch of code. No functional
changes.

3 years agotest: atomicity.py: improve exit probability on failure
Tomi Ollila [Wed, 4 Jan 2017 14:53:47 +0000 (16:53 +0200)]
test: atomicity.py: improve exit probability on failure

Some gdb python exceptions on some os environments (e.g. macOS
Sierra, non-codesigned gdb) do not make gdb exit (but to drop down
to nonexistent command line?).
Mitigate this chance by explict SystemExit on all exceptions.
The contents of output file 'gdb.out' is unchanged.

3 years agosupport make goals after initial {'', dist, data}clean goal(s)
Tomi Ollila [Mon, 16 Jan 2017 18:04:48 +0000 (20:04 +0200)]
support make goals after initial {'', dist, data}clean goal(s)

Now make goal combinations starting with *clean goals,
ending with *clean coals, and having non-*clean goals in between
should work. What does not expected to work are
non-*clean - *clean - *non-clean goal combinations.

Also, if first goals are *clean goals, re-creation of Makefile.config
is inhibited when Makefile.config exists and ./configure is newer.

3 years agocli: do not initialize zero values with designated initializers
Jani Nikula [Fri, 6 Jan 2017 20:14:50 +0000 (22:14 +0200)]
cli: do not initialize zero values with designated initializers

Let the language initialize defaults to zero when some values are
initialized to non-zero values. No functional changes.

3 years agocli: simplify mime node walk
Jani Nikula [Fri, 6 Jan 2017 20:14:49 +0000 (22:14 +0200)]
cli: simplify mime node walk

The function is more straighforward to read when it's clear that the
only non-NULL return is at one place. No functional changes.

3 years agocli/show: move formatter structs closer to where they're needed
Jani Nikula [Fri, 6 Jan 2017 20:14:48 +0000 (22:14 +0200)]
cli/show: move formatter structs closer to where they're needed

The formatter structs are only needed for the formatter array
initialization. Move them closer to use. This also lets us drop some
forward declarations. No functional changes.

3 years agocli/show: group --entire-thread option handling into one place
Jani Nikula [Fri, 6 Jan 2017 20:14:47 +0000 (22:14 +0200)]
cli/show: group --entire-thread option handling into one place

The --entire-thread option handling is split around, making the logic
harder to follow than necessary. Put it in one place. While at it,
make the true/false values match notmuch_bool_t values for
simplicity. No functional changes.

3 years agocli/show: rename format_sel to simply format
Jani Nikula [Fri, 6 Jan 2017 20:14:46 +0000 (22:14 +0200)]
cli/show: rename format_sel to simply format

Now that the format pointer is a temporary variable, and named
formatter, shorten format_sel to format. No functional changes.

3 years agocli/show: use a table for choosing the formatter
Jani Nikula [Fri, 6 Jan 2017 20:14:45 +0000 (22:14 +0200)]
cli/show: use a table for choosing the formatter

Continue detangling format pointer and format selection variables. No
functional changes.

3 years agocli/show: consistently use format_sel for checking the format
Jani Nikula [Fri, 6 Jan 2017 20:14:44 +0000 (22:14 +0200)]
cli/show: consistently use format_sel for checking the format

The mixed use of the format pointer and the format selection variables
is confusing. Add more clarity by using format_sel alone. No
functional changes.

3 years agocli/show: remove unused raw member from show parameters struct
Jani Nikula [Fri, 6 Jan 2017 20:14:43 +0000 (22:14 +0200)]
cli/show: remove unused raw member from show parameters struct

The raw member has been unused since b1130bc71c02 ("show: Convert raw
format to the new self-recursive style, properly support interior
parts"). Good riddance. No functional changes.

3 years agocli/show: detangle overloading of params.part for single message display
Jani Nikula [Fri, 6 Jan 2017 20:14:42 +0000 (22:14 +0200)]
cli/show: detangle overloading of params.part for single message display

The use of params.part has become rather convoluted in notmuch
show. Add another variable for selecting single message display to
make the code easier to read. No functional changes.

3 years agobindings/python: test python Database.get_revision ()
Gaute Hope [Thu, 9 Mar 2017 13:32:28 +0000 (14:32 +0100)]
bindings/python: test python Database.get_revision ()

Here is a test for Database.get_revision (), based on
the first part of T570-revision-tracking.sh.

3 years agobindings/python: add bindings for notmuch_database_get_revision
Gaute Hope [Mon, 6 Mar 2017 16:37:34 +0000 (17:37 +0100)]
bindings/python: add bindings for notmuch_database_get_revision

Database.get_revision () returns a tuple with the current database
revision and the UUID string representing the database.

3 years agoconfigure: removed $zlib_(cflags|ldflags) from compat code build
Tomi Ollila [Sun, 5 Mar 2017 21:03:27 +0000 (23:03 +0200)]
configure: removed $zlib_(cflags|ldflags) from compat code build

When pkg-config does not find configure, a compat version of the
zlib.pc is created. In creation of that configure attempted to
read values of $zlib_cflags and $zlib_ldflags. In the usual case
those were undefined, and with `set -a` now in the beginning of
configure, configure broke.

Even if $zlib_cflags and $zlib_ldflags had values which were used
to create zlib.pc, the values were overwritten (with static content)
a few lines later in next pkg-config --cflags and --libs run. These
values would not be different and probably useless -- the following
boild would probably fail.

But instead of using those, CPATH and LIBRARY_PATH environment
variables can be used successfully (both while configuring and
building).

3 years agocli/new: Avoid printing "\033[K" to non-terminal output
Łukasz Stelmach [Thu, 2 Mar 2017 12:22:01 +0000 (13:22 +0100)]
cli/new: Avoid printing "\033[K" to non-terminal output

3 years agotest: require test_begin_subtest before test_expect_code
Jani Nikula [Sun, 26 Feb 2017 13:43:01 +0000 (15:43 +0200)]
test: require test_begin_subtest before test_expect_code

Unify the subtests by requiring test_begin_subtest before
test_expect_code. (Similar change for test_expect_success has already
been done.)

This increases clarity in the test scripts by having a separate line
for the start of the subtest with the heading, and makes it possible
to simplify the test infrastructure by making all subtests similar.

3 years agotest: require test_begin_subtest before test_expect_success
Jani Nikula [Sun, 26 Feb 2017 13:43:00 +0000 (15:43 +0200)]
test: require test_begin_subtest before test_expect_success

Unify the subtests by requiring test_begin_subtest before
test_expect_success. (Similar change for test_expect_code will
follow.)

This increases clarity in the test scripts by having a separate line
for the start of the subtest with the heading, and makes it possible
to simplify the test infrastructure by making all subtests similar.

3 years agotest: drop the implicit prereq check mechanism from test_expect_*
Jani Nikula [Sun, 26 Feb 2017 13:42:59 +0000 (15:42 +0200)]
test: drop the implicit prereq check mechanism from test_expect_*

The only place where we use the implicit prereq check is T000-basic.sh
where we check that it works. It's an added complication that we don't
use. Remove it.

The test_have_prereq function can still be used for the same effect in
subtests that use test_begin_subtest. For now, this will make it
impossible to have prereqs in one-line subtests that don't require
test_begin_subtest. This will be fixed in follow-up work.

3 years agotest: ensure test_begin_subtest has been called before test_expect_*
Jani Nikula [Sun, 26 Feb 2017 13:42:58 +0000 (15:42 +0200)]
test: ensure test_begin_subtest has been called before test_expect_*

This is the expectation, increase robustness of the test suite by
requiring it.

3 years agotest: only accept short and long options, not silly in-betweens
Jani Nikula [Sun, 26 Feb 2017 13:42:57 +0000 (15:42 +0200)]
test: only accept short and long options, not silly in-betweens

It's not notmuch style to accept sloppy parameter names.

3 years agotest: remove unused and no-op --long-tests parameter
Jani Nikula [Sun, 26 Feb 2017 13:42:56 +0000 (15:42 +0200)]
test: remove unused and no-op --long-tests parameter

It's been unused since its introduction in commit 0083854b1204 ("Copy
test framework from Git").

3 years agotest: remove unused test_external and test_external_without_stderr
Jani Nikula [Sun, 26 Feb 2017 13:42:55 +0000 (15:42 +0200)]
test: remove unused test_external and test_external_without_stderr

They've been unused since their introduction in commit 0083854b1204
("Copy test framework from Git"), only causing maintenance burden.

3 years agotest: remove unused filter functions
Jani Nikula [Sun, 26 Feb 2017 13:42:54 +0000 (15:42 +0200)]
test: remove unused filter functions

They've been unused since their introduction in commit 0083854b1204
("Copy test framework from Git").

3 years agotest: remove unused regexp convenience variables
Jani Nikula [Sun, 26 Feb 2017 13:42:53 +0000 (15:42 +0200)]
test: remove unused regexp convenience variables

They've been unused since their introduction in commit 0083854b1204
("Copy test framework from Git").

3 years agotest: suppress diff for broken test without V=1
Jani Nikula [Sun, 26 Feb 2017 17:36:50 +0000 (19:36 +0200)]
test: suppress diff for broken test without V=1

Known broken tests are, well, known broken. Do not print the result
diff for them unless V=1 is specified. Now that the test description
is printed also when known broken tests fail, the user can also skip
to running the individual failing tests.

3 years agotest: print test description also for failing known broken tests
Jani Nikula [Sun, 26 Feb 2017 17:36:49 +0000 (19:36 +0200)]
test: print test description also for failing known broken tests

With the test description, the user can see the test script name, and
debug with that alone.

3 years agoMerge branch 'release'
David Bremner [Wed, 8 Mar 2017 12:31:51 +0000 (08:31 -0400)]
Merge branch 'release'

new release candidate, with regexp fix

3 years agodebian: changelog stanza for 0.24~rc1-1 0.24_rc1 debian/0.24_rc1-1
David Bremner [Wed, 8 Mar 2017 12:10:11 +0000 (08:10 -0400)]
debian: changelog stanza for 0.24~rc1-1

3 years agoversion: bump version to 0.24~rc1
David Bremner [Wed, 8 Mar 2017 12:04:42 +0000 (08:04 -0400)]
version: bump version to 0.24~rc1

3 years agolib: Fix RegexpPostingSource
Olly Betts [Tue, 7 Mar 2017 12:52:39 +0000 (08:52 -0400)]
lib: Fix RegexpPostingSource

Remove incorrect skipping to first match from init(), and add explicit
skip_to() and check() methods to work around xapian-core bug (the
check() method will also improve speed when filtering by one of
these).

3 years agoMerge branch 'release'
David Bremner [Tue, 7 Mar 2017 13:12:22 +0000 (09:12 -0400)]
Merge branch 'release'

NEWS and doc changes

3 years agoNEWS: notmuch-emacs-mua and desktop integration
Jani Nikula [Mon, 6 Mar 2017 19:27:01 +0000 (21:27 +0200)]
NEWS: notmuch-emacs-mua and desktop integration

3 years agoNEWS: external subcommand handling
Jani Nikula [Mon, 6 Mar 2017 19:27:00 +0000 (21:27 +0200)]
NEWS: external subcommand handling

3 years agoman: document external subcommand handling in notmuch(1)
Jani Nikula [Mon, 6 Mar 2017 19:26:59 +0000 (21:26 +0200)]
man: document external subcommand handling in notmuch(1)

The documentation for this was overlooked when adding the subcommand
handling. This seems like the proper place for it.

3 years agoNEWS for emacs
Mark Walters [Mon, 6 Mar 2017 08:49:20 +0000 (08:49 +0000)]
NEWS for emacs

3 years agoMerge tag '0.24_rc0'
David Bremner [Mon, 6 Mar 2017 00:32:20 +0000 (20:32 -0400)]
Merge tag '0.24_rc0'

notmuch 0.24~rc0 release

3 years agodebian: add two new exception symbols. 0.24_rc0 debian/0.24_rc0-1
David Bremner [Mon, 6 Mar 2017 00:13:06 +0000 (20:13 -0400)]
debian: add two new exception symbols.

It seems these need to be exported from the library in order for
exception handling to work.

3 years agoNEWS: start NEWS for 0.24
David Bremner [Sun, 5 Mar 2017 23:44:33 +0000 (19:44 -0400)]
NEWS: start NEWS for 0.24

3 years agodebian: start changelog stanza for 0.24~rc0-1
David Bremner [Sun, 5 Mar 2017 23:33:50 +0000 (19:33 -0400)]
debian: start changelog stanza for 0.24~rc0-1

3 years agoversion: bump to 0.24~rc0
David Bremner [Sun, 5 Mar 2017 23:30:21 +0000 (19:30 -0400)]
version: bump to 0.24~rc0

3 years agotest: shrink T590-thread-breakage test decription to one line
Jani Nikula [Sun, 26 Feb 2017 17:36:48 +0000 (19:36 +0200)]
test: shrink T590-thread-breakage test decription to one line

The test description is used for log output, I think the intention is
to keep it as a one-liner. Leave the rest of the long description as a
comment.

3 years agoemacs: compat: backport fix for folding long headers when sending
Mark Walters [Sat, 4 Mar 2017 20:42:14 +0000 (20:42 +0000)]
emacs: compat: backport fix for folding long headers when sending

This backports the fix from emacs master (commit
77bbca8c82f6e553c42abbfafca28f55fc995d00) to notmuch-emacs to wrap
long headers.

This fixes the test introduced in the previous changeset.

3 years agoTest: emacs: test for folding long headers.
Mark Walters [Sat, 4 Mar 2017 20:42:13 +0000 (20:42 +0000)]
Test: emacs: test for folding long headers.

Headers of more than 998 characters should be folded when sending.
However, until recently, emacs did not do this.

This adds a (known broken) test for this when sending messages in
emacs. We will backport the fix to notmuch-emacs in the next
changeset.

3 years agolib: query make exclude handling non-destructive
David Bremner [Sat, 25 Feb 2017 16:09:13 +0000 (12:09 -0400)]
lib: query make exclude handling non-destructive

We filter added exclude at add time, rather than modifying the query by
count search. As noted in the comments, there are several ignored
conditions here.

3 years agolib: centralize query parsing, store results.
David Bremner [Sat, 25 Feb 2017 16:09:11 +0000 (12:09 -0400)]
lib: centralize query parsing, store results.

The main goal is to prepare the way for non-destructive (or at least
less destructive) exclude tag handling. It does this by having a
pre-parsed query available for further processing. This also allows us
to provide slightly more precise error messages.

3 years agolib: use delete[] to free buffer allocated using new[]
Jani Nikula [Sat, 4 Mar 2017 17:38:41 +0000 (19:38 +0200)]
lib: use delete[] to free buffer allocated using new[]

Fix warning caught by clang:

lib/regexp-fields.cc:41:2: warning: 'delete' applied to a pointer that was allocated
      with 'new[]'; did you mean 'delete[]'? [-Wmismatched-new-delete]
        delete buffer;
        ^
              []
lib/regexp-fields.cc:37:17: note: allocated with 'new[]' here
        char *buffer = new char[len];
                       ^

3 years agolib: add mid: as a synonym for id:
David Bremner [Mon, 27 Feb 2017 02:34:21 +0000 (22:34 -0400)]
lib: add mid: as a synonym for id:

mid: is the url scheme suggested by URL 2392. We also plan to
introduce more flexible searches for mid: than are possible with
id: (in order not to break assumptions about the special behaviour of
id:, e.g. identifying at most one message).

3 years agolib: regexp matching in 'subject' and 'from'
David Bremner [Mon, 27 Feb 2017 02:34:20 +0000 (22:34 -0400)]
lib: regexp matching in 'subject' and 'from'

the idea is that you can run

% notmuch search subject:/<your-favourite-regexp>/
% notmuch search from:/<your-favourite-regexp>/

or

% notmuch search subject:"your usual phrase search"
% notmuch search from:"usual phrase search"

This feature is only available with recent Xapian, specifically
support for field processors is needed.

It should work with bindings, since it extends the query parser.

This is easy to extend for other value slots, but currently the only
value slots are date, message_id, from, subject, and last_mod. Date is
already searchable;  message_id is left for a followup commit.

This was originally written by Austin Clements, and ported to Xapian
field processors (from Austin's custom query parser) by yours truly.

3 years agolib: create field processors from prefix table
David Bremner [Mon, 27 Feb 2017 02:34:19 +0000 (22:34 -0400)]
lib: create field processors from prefix table

This is a bit more code than hardcoding the two existing field
processors, but it should make it easy to add more.

3 years agobuild: use sha256sum instead of sha1sum to sign releases
David Bremner [Thu, 2 Mar 2017 00:44:47 +0000 (20:44 -0400)]
build: use sha256sum instead of sha1sum to sign releases

3 years agoemacs/desktop: update to use notmuch-emacs-mua and handle mailto
Jani Nikula [Sat, 25 Feb 2017 09:25:40 +0000 (11:25 +0200)]
emacs/desktop: update to use notmuch-emacs-mua and handle mailto

With the mailto: handling in notmuch-emacs-mua, we can update the
desktop file to advertize we can be set as the default application to
handle email. While at it, add GenericName and Comment to be more
informative.

With --hello, notmuch-emacs-mua will run (notmuch) if mailto: url is
not given.

3 years agocompletion: complete notmuch emacs-mua
Jani Nikula [Sat, 25 Feb 2017 09:25:39 +0000 (11:25 +0200)]
completion: complete notmuch emacs-mua

With subcommand handling for external commands we can easily complete
'notmuch emacs-mua' using the existing completion system.

3 years agoMerge branch 'release'
David Bremner [Wed, 1 Mar 2017 01:21:07 +0000 (21:21 -0400)]
Merge branch 'release'

Second gnugpg test suite fix

3 years agoupdate version to 0.23.7 0.23.7
David Bremner [Wed, 1 Mar 2017 00:49:24 +0000 (20:49 -0400)]
update version to 0.23.7

3 years agoNEWS: add news for 0.23.7
David Bremner [Wed, 1 Mar 2017 00:46:53 +0000 (20:46 -0400)]
NEWS: add news for 0.23.7

3 years agoadd changelog stanza for 0.23.7-1
David Bremner [Tue, 28 Feb 2017 00:07:52 +0000 (20:07 -0400)]
add changelog stanza for 0.23.7-1

3 years agonotmuch-config: ENOENT vs generic handling when file open fails.
Tomi Ollila [Sun, 26 Feb 2017 19:12:39 +0000 (21:12 +0200)]
notmuch-config: ENOENT vs generic handling when file open fails.

When opening configuration file fails, ENOENT (file not found) is
handled specially -- in setup missing file is ok (often expected),
and otherwise user can be informed to run notmuch setup.

In any other case the the reason is unknown, so there is no other
option but to print generic error message to stderr.

3 years agocli/config: don't try to open config file for 'notmuch help'
Jani Nikula [Sun, 26 Feb 2017 19:12:38 +0000 (21:12 +0200)]
cli/config: don't try to open config file for 'notmuch help'

The help command does not really need to try to open the config
file. So don't.

3 years agoMerge tag '0.23.6'
David Bremner [Tue, 28 Feb 2017 12:06:42 +0000 (08:06 -0400)]
Merge tag '0.23.6'

notmuch 0.23.6 release

3 years agocli/show: add content-disposition to structured output message parts
Jani Nikula [Sun, 26 Feb 2017 18:33:48 +0000 (20:33 +0200)]
cli/show: add content-disposition to structured output message parts

Help the clients decide how to display parts.

Test updates by Mark Walters <markwalters1009@gmail.com>.
One more test fix by db

3 years agocli/show: abstract get content disposition
Jani Nikula [Sun, 26 Feb 2017 18:33:47 +0000 (20:33 +0200)]
cli/show: abstract get content disposition

Reduce duplication in follow-up work. As a side effect, handle error
returns from g_mime_content_disposition_get_disposition() without
segfaulting.

3 years agotest: move GNUPGHOME to TEST_TMPDIR
David Bremner [Mon, 27 Feb 2017 23:53:56 +0000 (19:53 -0400)]
test: move GNUPGHOME to TEST_TMPDIR

We already use this directory for dtach sockets, so it makes sense to
put gnupg sockets there as well. There doesn't seem to be a clean way
to put a fully functional socket in a different location than
GNUPGHOME.

3 years agoRevert "configure: add test for gpgconf --create-socketdir"
David Bremner [Mon, 27 Feb 2017 22:27:49 +0000 (18:27 -0400)]
Revert "configure: add test for gpgconf --create-socketdir"

This reverts commit 12f7d4e61d30fb9a5c99e128ab1aab0bf069cdb4.

Since we're not using gpgconf anymore, drop the unneeded test in
configure.