Commit graph

5309 commits

Author SHA1 Message Date
David Bremner
de9baa29dc cli: change api of parse_option
The idea is to allow it (in a future commit) advance to the next argv
element to get a value
2017-07-12 17:44:15 -03:00
David Bremner
15815d4e4c cli/show: convert keyword options to booleans
There are two keyword options here that impliment boolean options. It
is simpler to use the built-in boolean argument handling, and also
more robust against divergence in parsing boolean and keyword arguments.
2017-07-12 17:42:23 -03:00
Kyle Meyer
37d1fa5672 emacs: tree: drop repeated "of" from docstring 2017-07-10 21:58:30 -03:00
David Bremner
6a79229737 debian: drop notmuch-dbg
notmuch-dbgsym should be auto generated now.
2017-07-06 09:21:14 -03:00
David Bremner
87ca29b7a7 test/crypto: add test for corrupted signatures
Have an empty list of signatures is not the nicest mechanism to signal
complete failure to verify, but it's the one we currently have.
2017-07-05 07:36:20 -03:00
David Bremner
4f48ae4a5f test: add test for modified pgp/mime signed message
This is a good thing to test in any case, but particularly as we hit
the dark corners of the gmime crypto API.
2017-07-05 07:36:20 -03:00
David Bremner
71f04b9a67 test: mark test as broken in gmime 3.0
Currently I'm not sure what the intent of this test is, so it's not
clear if the new answer is better or worse than the old one.
2017-07-05 07:13:02 -03:00
David Bremner
f7dd69d4c6 test: mark inclusion of headers as broken in gmime-2.x
The output of headers here reflects an underlying bug / quirk of
gmime-2.6.
2017-07-05 07:12:20 -03:00
David Bremner
3805898e3e test/multipart: reorganize creation of multipart message
We want to have the bodies of the multipart available in a file on
their own for planned modifications to tests.
2017-07-05 07:12:08 -03:00
David Bremner
e1b7d32db0 cli: implement structured output version 4
Since the error field is unused by the emacs front end, no changes are
needed other than bumping the format version number.

As it is, this is a bit overengineered, but it will reduce duplication
when we support gmime 3.0
2017-07-04 08:32:44 -03:00
David Bremner
9eacd7d367 devel/schemata: describe version 4
Replace numeric errors with human readable flags.  Not all sig_error
keys will necessarily be generated with a given version of gmime.

Drop status "none" as it's currrently unused and I don't know what
it's for.
2017-07-04 08:32:37 -03:00
David Bremner
b6f87c3085 emacs: convert to use format-version 3
Keeping the emacs interface running old format-versions makes it
impossible to test new format-versions or deprecate old ones.
2017-07-04 08:32:28 -03:00
David Bremner
0aba694c11 Merge branch 'release' 2017-07-03 21:35:05 -03:00
David Bremner
1970981bf1 debian: upload 0.24.2-2
Just a no-change rebuild.
2017-07-02 12:49:06 -03:00
David Bremner
ab02265777 Merge branch 'debian'
merge in changes from 0.23.7-3 debian upload
2017-07-02 10:50:17 -03:00
David Bremner
6dd00d6486 lib/index: add simple html filter
The filter just drops all (HTML) tags. As an enabling change, pass the
content type to the filter constructor so we can decide which scanner
to user.
2017-07-01 12:32:27 -03:00
David Bremner
64f81f95a1 lib/index.cc: generalize filter state machine
To match things more complicated than fixed strings, we need states
with multiple out arrows.
2017-07-01 12:32:17 -03:00
David Bremner
4a085a5137 lib/index: separate state table definition from scanner.
We want to reuse the scanner definition with a different table.  This
is mainly code movement, and making the state table part of the filter
struct/class.
2017-07-01 12:32:03 -03:00
David Bremner
20c15bc820 lib/index: generalize name of indexing filter
In followup commits we will generalize the functionality of this
filter to deal with other types of non-indexable content.
2017-07-01 12:31:55 -03:00
Tom Hinton
d848d4040a Fix minor mistake where indentation width is ignored 2017-06-30 08:55:16 -03:00
Damien Cassou
3840b6b495 Add indentation to imenu in notmuch-show 2017-06-30 08:33:29 -03:00
Piotr Trojanek
c9deb32933 remove extra space in Emacs prompt
Trivial: fix extra space in the "Insert failed" Emacs prompt message.
2017-06-25 09:57:48 -03:00
Piotr Trojanek
85c8304058 fix wrong printf formatting of signed/unsigned integers 2017-06-25 09:39:35 -03:00
Piotr Trojanek
410b96080c remove ineffective assignments
Detected by cppcheck.
2017-06-25 09:38:22 -03:00
Piotr Trojanek
e9d73f90a6 fix leaks due to missing invocations of va_end
As the Linux man page states: "Each invocation of va_start() must be
matched by a corresponding invocation of va_end() in the same
function." Detected by cppcheck.
2017-06-25 09:35:23 -03:00
Piotr Trojanek
a17eb162ee minor whitespace cleanups 2017-06-25 09:32:08 -03:00
Damien Cassou
a83ab29930 Add Emacs' imenu support in notmuch-show and notmuch-search
Emacs' major modes can facilitate navigation in their buffers by
supporting Imenu. In such major modes, launching Imenu (M-x imenu)
makes Emacs display a list of items (e.g., function definitions in a
code buffer). Selecting an item from this list moves point to this
item.

This patch adds Imenu support to both notmuch-show and notmuch-search
buffers:

* in notmuch-show, Imenu will present a list of all messages in the
  currently visible thread;

* in notmuch-search, Imenu will present a list of all messages in the
  search buffer.
2017-06-14 07:49:08 -03:00
David Bremner
1ec634461e Merge branch 'release' 2017-06-01 07:54:38 -03:00
David Bremner
2e86a4da55 fixup! NEWS: news for 0.24.2 2017-06-01 07:32:10 -03:00
David Bremner
6773235ea3 debian: changelog for 0.24.2-1 2017-06-01 07:25:56 -03:00
David Bremner
b6494a8dd9 NEWS: news for 0.24.2 2017-06-01 07:19:46 -03:00
David Bremner
4fb08341a4 version: bump to 0.24.2 2017-06-01 07:13:00 -03:00
David Bremner
11fda0bf2f cli/dump: don't include tags when not asked for
Add in the analogous test for tags that is given for properties a few
lines below.
2017-06-01 07:07:32 -03:00
David Bremner
e68022416d test: add known broken test --include=properties
Reported in [1], --include=properties currently implies
--include=tags, but it should not.

[1] id:87y3u8vjbo.fsf@tethera.net
2017-06-01 07:03:06 -03:00
David Bremner
6ac3d8c27f test: define GMime version dependant breakage
We have some tests where the gmime 3 behaviour seems like a bug fix,
others where it's less clear, so we allow both possibilities.
2017-05-31 21:54:08 -03:00
David Bremner
6977316a5f configure: add optional support for gmime-3.0
This is only the changes to make configure work; it won't compile with
gmime-3.0 yet.
2017-05-31 21:52:15 -03:00
David Bremner
51cf6dbab2 test/thread-naming: remove excess escaping from sender address.
This is another case where the behaviour of gmime-2.6 and gmime-3.0
seems to differ. It may be that we prefer the more lax parsing of the
previous version, but that should be tested separately.
2017-05-30 09:02:51 -03:00
David Bremner
233092577c cli/reply: fix two memory leaks, document a third
internet_address_list_to_string returns an allocated string, which
needs to be freed with g_free. g_free can handle a NULL argument, so
we follow the usage elsewhere of calling it unconditionally.

The third leak we leave as it would require restructuring of
add_recipients_from_message, and is fixed by later gmime-3.0 porting.
2017-05-30 09:02:29 -03:00
David Bremner
e86fa3226c perf-test: add memory test for reply
Looking at the code for notmuch-reply, there seems to be several gmime
related memory leaks. This test is supposed to help eliminate those.
2017-05-30 09:02:17 -03:00
David Bremner
331310c4ba cli/show: use single stream for printf / gmime object output
This is again motivated by the need to transition away from
GMimeStreamFile for output to stdout.

format_part_mbox is left alone for now, as this cannot be mixed in
with output using gmime object output.
2017-05-30 09:02:07 -03:00
David Bremner
555e2abe9d cli/reply: direct all output for text format to gmime stream
Interleaving printfs with writes to the gmime stream worked when the
gmime stream was backed by the FILE *stdout, but that is no longer the
case.  Create one stream and pass it into the two functions where
needed, as well well as replacing printfs with g_mime_stream_printf.
2017-05-30 09:01:56 -03:00
David Bremner
1e7dbf7abc util: convenience function to create gmime stream for stdout
It turns out that our use of GMimeStreamPipe has only succeeded
because gmime has been ignoring some seek failures; this will no
longer be the case in gmime 3.0, so we use a GMimeStreamPipe, which
does not assume seekability, wrapped in a buffering stream.
2017-05-30 09:01:46 -03:00
Tomi Ollila
427fa5e6e6 emacs: with prefix argument, notmuch-show-stash-date stashes timestamp
Using timestamp of a message is useful in many Xapian queries.
2017-05-30 08:54:35 -03:00
Tomi Ollila
5f71a4d3e1 exit lingering gpg agents at the end of relevant tests
Since gnupg 2.1.20, gpg-agent no longer shut itself down when
$GNUPGHOME directory is removed.

Add exit hooks to the test modules which execute `gpgconf --kill all`

Add exit hooks to execute `gpgconf --kill all` in the modules that
create $GNUPGHOME for gpg to work with.
2017-05-26 07:26:06 -03:00
Tomi Ollila
eb157f8841 test-lib.sh: add "atexit" functionality
New function at_exit_function registers given function to be called
at script termination.

Functions so registered are called in the reverse order of their
registration; no arguments are passed.

Function is called only once; re-adding with function name already
registered will remove previous registration.

New function rm_exit_function can be used to remove registration.

Modules (and possibly test-lib.sh functions) in future commits will
register such functions.
2017-05-26 07:25:55 -03:00
David Bremner
523d2b50fc Merge branch 'release'
Emacs bug fix from Mark
2017-05-13 08:51:10 -03:00
Mark Walters
2d79d38a0f emacs: tree: bugfix: specify --format-version
Previously notmuch tree did not specify the format-version when
calling notmuch. This meant that when the structured output was
slightly changed (in commit 14c60cf168)
stash filename broke. This fixes this breakage by specifying the
format-version.
2017-05-13 08:47:04 -03:00
Jani Nikula
30c475c1ef build: visibility=default for library structs is no longer needed
Commit d5523ead90 ("Mark some structures in the library interface
with visibility=default attribute.") fixed some mixed visibility
issues with structs. With the symbol default visibility reversed, this
is no longer a problem.
2017-05-13 08:38:18 -03:00
Jani Nikula
bc11759dd1 build: switch to hiding libnotmuch symbols by default
The dynamic generation of the linker version script for libnotmuch
exports has grown rather complicated.

Reverse the visibility control by hiding symbols by default using
-fvisibility=hidden, and explicitly exporting symbols in notmuch.h
using #pragma GCC visibility. (We could also use __attribute__
((visibility ("default"))) for each exported function, but the pragma
is more convenient.)

The above is not quite enough alone, as it would "leak" a number of
weak symbols from Xapian and C++ standard library. Combine it with a
small static version script that filters out everything except the
notmuch_* symbols that we explicitly exposed, and the C++ RTTI
typeinfo symbols for exception handling.

Finally, as the symbol hiding test can no longer look at the generated
symbol table, switch the test to parse the functions from notmuch.h.
2017-05-12 07:17:18 -03:00
Jani Nikula
544b8ec90e compat: don't include compat.h from the feature test source
The feature test code should test the build environment, and none of
the compat code should interfere with that. Don't include compat.h
from the feature test source. There should be no functional changes
here, but this is just the right thing to do.
2017-05-11 20:42:37 -03:00