Commit graph

6138 commits

Author SHA1 Message Date
Jani Nikula
8481372956 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.
2017-03-10 07:53:38 -04:00
Jani Nikula
f2160ae540 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.
2017-03-10 07:52:29 -04:00
Jani Nikula
16f0507962 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.
2017-03-10 07:48:14 -04:00
Jani Nikula
0bb3b3b8e8 cli/show: use a table for choosing the formatter
Continue detangling format pointer and format selection variables. No
functional changes.
2017-03-10 07:48:06 -04:00
Jani Nikula
1232584040 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.
2017-03-10 07:47:56 -04:00
Jani Nikula
33944a559a cli/show: remove unused raw member from show parameters struct
The raw member has been unused since b1130bc71c ("show: Convert raw
format to the new self-recursive style, properly support interior
parts"). Good riddance. No functional changes.
2017-03-10 07:47:48 -04:00
Jani Nikula
b2488a925a 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.
2017-03-10 07:47:35 -04:00
Gaute Hope
1b5c6b2dea 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.
2017-03-09 10:21:02 -04:00
Gaute Hope
a39a1ee152 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.
2017-03-09 10:20:50 -04:00
Tomi Ollila
b7763c94e2 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).
2017-03-09 10:20:01 -04:00
Łukasz Stelmach
3071fc04fb cli/new: Avoid printing "\033[K" to non-terminal output 2017-03-09 10:17:12 -04:00
Jani Nikula
0497d695ca 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.
2017-03-09 09:03:40 -04:00
Jani Nikula
d0cd253b37 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.
2017-03-09 09:01:21 -04:00
Jani Nikula
b8f12bd371 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.
2017-03-09 09:00:16 -04:00
Jani Nikula
e563b8cafd test: ensure test_begin_subtest has been called before test_expect_*
This is the expectation, increase robustness of the test suite by
requiring it.
2017-03-09 08:58:28 -04:00
Jani Nikula
13a59c4a8f test: only accept short and long options, not silly in-betweens
It's not notmuch style to accept sloppy parameter names.
2017-03-09 08:55:38 -04:00
Jani Nikula
de66230b46 test: remove unused and no-op --long-tests parameter
It's been unused since its introduction in commit 0083854b12 ("Copy
test framework from Git").
2017-03-09 08:55:17 -04:00
Jani Nikula
8af6fc5e6e test: remove unused test_external and test_external_without_stderr
They've been unused since their introduction in commit 0083854b12
("Copy test framework from Git"), only causing maintenance burden.
2017-03-09 08:55:06 -04:00
Jani Nikula
cfc0909511 test: remove unused filter functions
They've been unused since their introduction in commit 0083854b12
("Copy test framework from Git").
2017-03-09 08:54:53 -04:00
Jani Nikula
1db3244bf1 test: remove unused regexp convenience variables
They've been unused since their introduction in commit 0083854b12
("Copy test framework from Git").
2017-03-09 08:53:12 -04:00
Jani Nikula
14c0862bac 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.
2017-03-09 08:48:08 -04:00
Jani Nikula
740f3296b8 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.
2017-03-09 08:47:57 -04:00
David Bremner
4e872c64e1 Merge branch 'release'
new release candidate, with regexp fix
2017-03-08 08:31:51 -04:00
David Bremner
29958b2b9a debian: changelog stanza for 0.24~rc1-1 2017-03-08 08:10:11 -04:00
David Bremner
15f8fc78c8 version: bump version to 0.24~rc1 2017-03-08 08:04:42 -04:00
Olly Betts
81bd72cebb 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).
2017-03-07 19:44:36 -04:00
David Bremner
8f35cb889a Merge branch 'release'
NEWS and doc changes
2017-03-07 09:12:48 -04:00
Jani Nikula
9208289eea NEWS: notmuch-emacs-mua and desktop integration 2017-03-07 09:09:46 -04:00
Jani Nikula
4f4d9a0a7b NEWS: external subcommand handling 2017-03-07 09:08:39 -04:00
Jani Nikula
02421015fd 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.
2017-03-07 09:05:50 -04:00
Mark Walters
9da57ea107 NEWS for emacs 2017-03-07 09:05:20 -04:00
David Bremner
91524d5d6c notmuch 0.24~rc0 release
-----BEGIN PGP SIGNATURE-----
 
 iQGzBAABCAAdFiEE3VS2dnyDRXKVCQCp8gKXHaSnniwFAli8qxsACgkQ8gKXHaSn
 niybAAv/VRBy8VbdNw5iJlgj0HIyoLuCQQw9Koba3r5PnLHvuxozIMdYPiyLdzBg
 /Zd1Nwvp+yPSEHciyzwPceW0PsBa+ChdbJBGaZhv1++oXWEPR2t45RGVrImNu5w5
 bd5JuYW63rpYBClKhwRK+8if7sPyeBCs0kK/MgqqWbG7oAEhPDpZ9Vs7GTWGEbqe
 fJyqIJ8687LoM0eLdTYrDHrz8EKrI0UmFKqj+/FpEmgyMga4tSmConop3LjbjW5M
 woKTR8lOQ2Yt72v43bqiCWEF+J3BbeB9ixECKktanUEIfMIoYfrmFvXGxmZD60WF
 BD95Z3YwIkF0jX19omxkGx1KEY4VlNy+BjxGOXX0PvUqYdPPN2hM8uS0SnKz/1NU
 pSb7p6Rw7GNskwAP5+KkghZlVUhEoUcvC1mostB4dMibqnrjeYU7lBQfeR++vht0
 r5jKyh1z6RQBJUINx5IJh6V+OabK/Lsp90uCnFsxXWB6pMTbBX5Zm9CNHHa7UBod
 MpmI7lcv
 =KFBY
 -----END PGP SIGNATURE-----

Merge tag '0.24_rc0'

notmuch 0.24~rc0 release
2017-03-05 20:32:20 -04:00
David Bremner
990f8cd032 debian: add two new exception symbols.
It seems these need to be exported from the library in order for
exception handling to work.
2017-03-05 20:13:06 -04:00
David Bremner
ba1c934e5b NEWS: start NEWS for 0.24 2017-03-05 19:49:31 -04:00
David Bremner
75363cf4ef debian: start changelog stanza for 0.24~rc0-1 2017-03-05 19:33:50 -04:00
David Bremner
08c6731761 version: bump to 0.24~rc0 2017-03-05 19:30:21 -04:00
Jani Nikula
85df8b3915 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.
2017-03-04 21:21:11 -04:00
Mark Walters
95e9c137e1 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.
2017-03-04 21:16:42 -04:00
Mark Walters
a8f91b74e7 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.
2017-03-04 21:15:55 -04:00
David Bremner
dfacfe14f3 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.
2017-03-04 20:47:25 -04:00
David Bremner
e209b71873 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.
2017-03-04 20:47:25 -04:00
Jani Nikula
f3edc5dc86 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];
                       ^
2017-03-04 20:42:39 -04:00
David Bremner
6cb1c617a7 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).
2017-03-03 17:46:48 -04:00
David Bremner
55524bb063 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.
2017-03-03 17:46:48 -04:00
David Bremner
31b8ce4558 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.
2017-03-03 07:15:13 -04:00
David Bremner
914c4db1f2 build: use sha256sum instead of sha1sum to sign releases 2017-03-02 17:31:15 -04:00
Jani Nikula
4f2a7993a5 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.
2017-03-01 19:33:52 -04:00
Jani Nikula
97f3d55ad9 completion: complete notmuch emacs-mua
With subcommand handling for external commands we can easily complete
'notmuch emacs-mua' using the existing completion system.
2017-03-01 19:33:33 -04:00
David Bremner
508b5c20fa Merge branch 'release'
Second gnugpg test suite fix
2017-02-28 21:21:07 -04:00
David Bremner
770d00a895 update version to 0.23.7 2017-02-28 20:49:24 -04:00