notmuch
24 hours agodoc/sexp: document range queries. master
David Bremner [Sat, 4 Jun 2022 21:53:59 +0000 (18:53 -0300)]
doc/sexp: document range queries.

Give examples for date fields, as these are commonly useful for user
queries.

24 hours agolib/sexp: allow * as alias for "" in range searches.
David Bremner [Sat, 4 Jun 2022 21:53:58 +0000 (18:53 -0300)]
lib/sexp: allow * as alias for "" in range searches.

It can be tedious to use "" inside of a string, e.g. in a shell script.

24 hours agolib/sexp: special case "" as an argument in lastmod ranges.
David Bremner [Sat, 4 Jun 2022 21:53:57 +0000 (18:53 -0300)]
lib/sexp: special case "" as an argument in lastmod ranges.

Support this syntax for constincy with (data from to) ranges.

24 hours agotest/sexp: one sided range searches.
David Bremner [Sat, 4 Jun 2022 21:53:56 +0000 (18:53 -0300)]
test/sexp: one sided range searches.

The date range parsing machinery already knows how to do something
appropriate with an empty string, but the lastmod parsing blindly
tries to parse each atom as a number.

28 hours agolib: check for writable db in n_m_tags_maildir_flags
David Bremner [Wed, 25 May 2022 10:51:17 +0000 (07:51 -0300)]
lib: check for writable db in n_m_tags_maildir_flags

The database needs to be writable because the list of stored file
names will change in general.

28 hours agolib: add NOTMUCH_STATUS_CLOSED_DATABASE, use in _n_d_ensure_writable
David Bremner [Wed, 25 May 2022 10:51:16 +0000 (07:51 -0300)]
lib: add NOTMUCH_STATUS_CLOSED_DATABASE, use in _n_d_ensure_writable

In order for a database to actually be writeable, it must be the case that it
is open, not just the correct type of Xapian object. By explicitely
checking, we are able to provide better error reporting, in particular
for the previously broken test in T566-lib-message.

28 hours agolib: Add missing private status values.
David Bremner [Wed, 25 May 2022 10:51:15 +0000 (07:51 -0300)]
lib: Add missing private status values.

These were missed when the corresponding status codes were added.

28 hours agolib/tag: handle NULL argument to notmuch_tags_valid
David Bremner [Wed, 25 May 2022 10:51:14 +0000 (07:51 -0300)]
lib/tag: handle NULL argument to notmuch_tags_valid

Make the behaviour when passed NULL consistent with
notmuch_filenames_valid. The library already passes the result of
notmuch_message_get_tags without checking for NULL, so it should be
handled.

28 hours agotest: add known broken test for notmuch_tags_valid (NULL)
David Bremner [Wed, 25 May 2022 10:51:13 +0000 (07:51 -0300)]
test: add known broken test for notmuch_tags_valid (NULL)

This should return false, but currently segfaults.

Start a new file for tags library API related tests. This is maybe
overkill, but new C boilerplate which doesn't corrupt the database is
needed anyway.

28 hours agotest: error handling for n_m_tags_to_maildir_flags
David Bremner [Wed, 25 May 2022 10:51:12 +0000 (07:51 -0300)]
test: error handling for n_m_tags_to_maildir_flags

The closed database case should fail gracefully, but currently it
segfaults.

31 hours agotest: error handling in _n_message_{add,remove}_filename
David Bremner [Mon, 23 May 2022 23:39:01 +0000 (20:39 -0300)]
test: error handling in _n_message_{add,remove}_filename

Use a closed database to force throwing a Xapian exception. Leave the
check vague to accomodate a potential explicit check for open database.

31 hours agolib/message: check return status from _n_m_add_{path,folder}_terms
David Bremner [Mon, 23 May 2022 23:39:00 +0000 (20:39 -0300)]
lib/message: check return status from _n_m_add_{path,folder}_terms

Mainly to propagate information about Xapian exceptions.

31 hours agolib/message: check return status of _n_m_{add,remove}_term
David Bremner [Mon, 23 May 2022 23:38:59 +0000 (20:38 -0300)]
lib/message: check return status of _n_m_{add,remove}_term

Xapian exceptions are not something that can be ignored, in general.

31 hours agolib: define macro NODISCARD
David Bremner [Mon, 23 May 2022 23:38:58 +0000 (20:38 -0300)]
lib: define macro NODISCARD

In either C++17 (or later) mode, or when running cppcheck, this can be
used to selectively generate warnings about discarded return values.

31 hours agolib/message: drop _notmuch_message_get_thread_id_only
David Bremner [Mon, 23 May 2022 23:38:57 +0000 (20:38 -0300)]
lib/message: drop _notmuch_message_get_thread_id_only

This function has been unused since commit 4083fd8.

31 hours agotest: _notmuch_message_remove_term catches exceptions.
David Bremner [Mon, 23 May 2022 23:38:56 +0000 (20:38 -0300)]
test: _notmuch_message_remove_term catches exceptions.

Unfortunately we can't differentiate between the two distinct error
conditions for Document::remove_term.

31 hours agolib/message: catch exceptions in _n_m_add_term
David Bremner [Mon, 23 May 2022 23:38:55 +0000 (20:38 -0300)]
lib/message: catch exceptions in _n_m_add_term

Some code movement is needed to make sure the cache is only
invalidated when the Xapian operation succeeds.

31 hours agotest: define test_private_C
David Bremner [Mon, 23 May 2022 23:38:54 +0000 (20:38 -0300)]
test: define test_private_C

When testing error handling, it is sometimes difficult to cover a
particular error path deterministically. Introduce a test function to
allow calling lower level functions directly.

8 days agoCLI: set NOTMUCH_CONFIG in hooks.
David Bremner [Sat, 4 Jun 2022 11:11:19 +0000 (08:11 -0300)]
CLI: set NOTMUCH_CONFIG in hooks.

This addresses a bug report / feature request of Uwe Kleine-König. The
assumption is that we always load a config file in the CLI (i.e. we
never pass "" as the config file argument to
notmuch_database_open_with_config).

[1]: id:8baa58c3-7ab9-ec03-1bbd-28aa5be838f2@kleine-koenig.org

8 days agotest: add known broken tests for setting NOTMUCH_CONFIG in hooks
David Bremner [Mon, 30 May 2022 11:38:19 +0000 (08:38 -0300)]
test: add known broken tests for setting NOTMUCH_CONFIG in hooks

Setting this according to --config was requested by Uwe
Kleine-König. There are some other ways that the configuration file
might be found in current notmuch, so check those as well.

As a bonus, fix a bug in the hook tests that left NOTMUCH_CONFIG set
even though a config file was provided via NOTMUCH_PROFILE.

[1]: id:8baa58c3-7ab9-ec03-1bbd-28aa5be838f2@kleine-koenig.org

9 days agodebian: install notmuch-git
David Bremner [Thu, 7 Apr 2022 22:43:15 +0000 (17:43 -0500)]
debian: install notmuch-git

Use a separate binary package to avoid dragging in dependencies on
python and git for those that do not want them.

9 days agoCLI/git: add safety checks for checkout and commit
David Bremner [Sat, 14 May 2022 18:25:47 +0000 (15:25 -0300)]
CLI/git: add safety checks for checkout and commit

Commits or checkouts that modify a large fraction of the messages in
the database should be relatively rare (and in some automated process,
probably non-existent). For initial setup, where such operations are
expected, the user can pass --force.

9 days agoCLI/git: support configuration for repo location / prefix
David Bremner [Tue, 10 May 2022 10:32:48 +0000 (07:32 -0300)]
CLI/git: support configuration for repo location / prefix

This is probably more convenient than always passing a command line
argument.

Use notmuch-config for consistency with other notmuch CLI tools.

Now that there is something relevant in the config files, test the
--config option.

9 days agoCLI/git: change defaults for repo and prefix
David Bremner [Sat, 7 May 2022 13:32:18 +0000 (10:32 -0300)]
CLI/git: change defaults for repo and prefix

The previous defaults were not suitable for personal (i.e. not
bugtracking for notmuch development) use.

Provide two ways for the user to select nmbug compatible defaults;
command line argument and checking the name of the script.

9 days agodoc/notmuch-git: initial documentation
David Bremner [Fri, 8 Apr 2022 00:41:38 +0000 (19:41 -0500)]
doc/notmuch-git: initial documentation

This is mainly derived from the various help outputs from the script,
with some massaging of markup and addition of links.

9 days agoCLI/git: cache git indices
David Bremner [Tue, 19 Apr 2022 11:32:14 +0000 (08:32 -0300)]
CLI/git: cache git indices

If the private index file matches a previously known revision of the
database, we can update the index incrementally using the recorded
lastmod counter. This is typically much faster than a full update,
although it could be slower in the case of large changes to the
database.

The "git-read-tree HEAD" is also a bottleneck, but unfortunately
sometimes is needed. Cache the index checksum and hash to reduce the
number of times the operation is run. The overall design is a
simplified version of the PrivateIndex class.

9 days agoCLI/git: add @timed decorator, time a few functions
David Bremner [Sat, 16 Apr 2022 22:44:10 +0000 (19:44 -0300)]
CLI/git: add @timed decorator, time a few functions

Perf will show which binaries are using the CPU cycles, and standard
python profilers will show which python functions, but neither is
great at finding which call to an external binary is taking time, or
locating I/O hotspots.

9 days agoCLI/git: replace enumeration of tags with sexp query.
David Bremner [Sun, 10 Apr 2022 17:22:57 +0000 (14:22 -0300)]
CLI/git: replace enumeration of tags with sexp query.

Unlike the (current) infix query parser provided by Xapian, the
notmuch specific sexp query parser supports prefixed wildcard queries,
so use those. In addition to being somewhat faster, this avoids
needing to escape all of the user's tags to pass via the shell.

9 days agotest/git: add known broken test for tag with quotes.
David Bremner [Sun, 10 Apr 2022 17:06:14 +0000 (14:06 -0300)]
test/git: add known broken test for tag with quotes.

There is current insufficient sanitization and/or escaping of tag names
internally in notmuch-git.

9 days agoCLI/git: suppress warnings about initial branch name
David Bremner [Sun, 3 Apr 2022 22:17:16 +0000 (16:17 -0600)]
CLI/git: suppress warnings about initial branch name

The canonical nmbug repository still uses "master" as the main branch
name, so defer any potential switch away from that name.

9 days agoCLI/git: rename environment variables.
David Bremner [Sun, 15 May 2022 16:47:54 +0000 (13:47 -0300)]
CLI/git: rename environment variables.

Although the code required to support both new and old environment
variables is small, it complicates the semantics of configuration, and
make the documentation harder to follow.

9 days agotest: initial tests for notmuch-git
David Bremner [Sun, 20 Mar 2022 21:33:54 +0000 (18:33 -0300)]
test: initial tests for notmuch-git

Exercise the main functionality of notmuch-git.  add_git_repos() will
hopefully be simplifed when an init subcommand is added.

9 days agoCLI/git: Add an 'init' command
W. Trevor King [Mon, 19 Jan 2015 00:40:10 +0000 (16:40 -0800)]
CLI/git: Add an 'init' command

For folks that want to start versioning a new tag-space, instead of
cloning one that someone else has already started.

The empty-blob hash-object call avoids errors like:

  $ nmbug commit
  error: invalid object 100644 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 for
'tags/...'
  fatal: git-write-tree: error building trees
  'git HASH(0x9ef3eb8) write-tree' exited with nonzero value

David Bremner suggested [1]:

  $ git hash-object -w /dev/null

instead of my Python version of:

  $ git hash-object -w --stdin <&-

but I expect that closing stdin is more portable than the /dev/null
path (which doesn't exist on Windows, for example).

The --bare init and use of NMBGIT as the work tree (what could go
wrong with an empty commit?) are suggestions from Michal Sojka [2].

[1]: id:87y4vu6uvf.fsf@maritornes.cs.unb.ca
     http://thread.gmane.org/gmane.mail.notmuch.general/18626/focus=18720
[2]: id:87a93a5or2.fsf@resox.2x.cz
     http://thread.gmane.org/gmane.mail.notmuch.general/19495/focus=19767

9 days agoCLI/git: make existance of config branch optional on clone
David Bremner [Mon, 4 Apr 2022 03:05:36 +0000 (21:05 -0600)]
CLI/git: make existance of config branch optional on clone

This branch is actually only used by an associated
utility (notmuch-report), and notmuch-git works fine without it.

9 days agonotmuch-git: add --git-dir, --tag-prefix arguments
David Bremner [Sun, 20 Mar 2022 16:13:06 +0000 (13:13 -0300)]
notmuch-git: add --git-dir, --tag-prefix arguments

It is often more convenient to use command line arguments than
environment variables.

9 days agoCLI/git: drop support for python < 3.2
David Bremner [Sat, 7 May 2022 16:53:08 +0000 (13:53 -0300)]
CLI/git: drop support for python < 3.2

Debian stable had python 3.4.2 3 releases ago (approximately 6 years
ago), so attempting to keep track of the changes in python is probably
no longer worthwhile. We already require python 3.5 for the
python-cffi bindings (although those are not yet used in notmuch-git).

9 days agonmbug: promote to user tool "notmuch-git"
David Bremner [Sun, 20 Mar 2022 12:03:36 +0000 (09:03 -0300)]
nmbug: promote to user tool "notmuch-git"

Initially just a rename, and drop the --version argument that clashes
with the global notmuch --version argument.

10 days agoemacs: use message-dont-reply-to-names when composing replies
jao [Thu, 9 Jun 2022 02:11:45 +0000 (03:11 +0100)]
emacs: use message-dont-reply-to-names when composing replies

notmuch-mua functions for replies now use the built-in customizable
variable message-dont-reply-to-names with the same semantics as
message-mode.

13 days agoemacs: Make notmuch-show-next-thread return nil on failure
Leo Okawa Ericson [Thu, 9 Jun 2022 15:18:22 +0000 (17:18 +0200)]
emacs: Make notmuch-show-next-thread return nil on failure

Having notmuch-show-next-thread return non-nil on success and nil on
failure makes it easier for users to interact with notmuch via elisp.

This commit changes notmuch-search-show-thread too since the return
value of notmuch-show-next-thread depends on notmuch-search-show-thread.

Amended by db: fix whitespace in T450-emacs-show

13 days agoCLI: document handling of --config for external commands
David Bremner [Tue, 31 May 2022 11:51:00 +0000 (08:51 -0300)]
CLI: document handling of --config for external commands

Create a section of the notmuch(1) manpage to have some place to put
this documentation.

13 days agoCLI: pass --config to external commands via NOTMUCH_CONFIG.
David Bremner [Tue, 31 May 2022 11:50:59 +0000 (08:50 -0300)]
CLI: pass --config to external commands via NOTMUCH_CONFIG.

This makes `notmuch --config foo external-subcommand` work
consistently with the built in subcommands.

13 days agotest: initial tests for external commands
David Bremner [Tue, 31 May 2022 11:50:58 +0000 (08:50 -0300)]
test: initial tests for external commands

The main goal is to test the setting of NOTMUCH_CONFIG, but also
include a basic sanity test for execing scripts.

13 days agoCLI: mention sexp-queries in help topics, alphabetize
David Bremner [Sun, 29 May 2022 18:22:04 +0000 (15:22 -0300)]
CLI: mention sexp-queries in help topics, alphabetize

There does not seem to be an easy way to automate maintaining this
list, but new topics are not added very often.

13 days agoCLI: simplify help command
David Bremner [Sun, 29 May 2022 18:22:03 +0000 (15:22 -0300)]
CLI: simplify help command

This will allow "notmuch help" to work for arbitrary external commands
and for any added non-command topics (such as notmuch-sexp-queries).

3 weeks agoemacs: change where notmuch-mua-mail moves point
Damien Cassou [Wed, 1 Jun 2022 19:50:48 +0000 (21:50 +0200)]
emacs: change where notmuch-mua-mail moves point

Move point to the position that makes the most sense instead of always
moving point to the TO.  This is useful when TO/SUBJECT are passed as
argument.

Amended by db: move news item to UNRELEASED.

3 weeks agoemacs: notmuch-show-header-line: allow format strings and functions
jao [Wed, 1 Jun 2022 09:53:36 +0000 (10:53 +0100)]
emacs: notmuch-show-header-line: allow format strings and functions

If a string value is assigned to notmuch-show-header-line, it's used
as a format string to be passed passed to format-spec with `%s`
substituted by the message's subject.  If a function is given, it's
called with the subject as argument, and its return value used as
header line.

As before, t means displaying the subject and nil not using any header
line.

Signed-off-by: jao <jao@gnu.org>
Amended-by: db, docstring spelling fix
4 weeks agotest: replace deprecated use of notmuch_database_create
David Bremner [Sat, 21 May 2022 18:06:31 +0000 (15:06 -0300)]
test: replace deprecated use of notmuch_database_create

Like notmuch_database_open, we need to conditionally print the error
message.

4 weeks agotest: replace deprecated use of notmuch_database_open
David Bremner [Sat, 21 May 2022 18:06:30 +0000 (15:06 -0300)]
test: replace deprecated use of notmuch_database_open

This is a bit more involved than replacing the use of
notmuch_database_open_verbose, as we have to effectively inline the
definition of notmuch_database_open.

4 weeks agotest: replace deprecated use of notmuch_database_open_verbose
David Bremner [Sat, 21 May 2022 18:06:29 +0000 (15:06 -0300)]
test: replace deprecated use of notmuch_database_open_verbose

We need to do it some day, and it is a bit annoying to read
deprecation messages in broken tests.

4 weeks agodoc/emacs: document a few notmuch-hello customizable variables.
David Bremner [Mon, 16 May 2022 10:46:10 +0000 (07:46 -0300)]
doc/emacs: document a few notmuch-hello customizable variables.

A user asked about the thousands separator on IRC, and I had to check
the source.

4 weeks agotest: make T450 independent of application/octet-stream interpretation
Michael J Gruber [Thu, 26 May 2022 16:52:32 +0000 (18:52 +0200)]
test: make T450 independent of application/octet-stream interpretation

The actual content type of `application/octet-stream` is up to content
type detection of the reader, and thus may not be stable across
implementations or versions. This showed up when

fd46fc19 ("emacs:  document/defcustom notmuch-multipart/alternative-discouraged", 2022-05-14)

introduced a test for omitting a part of type `text/html` because it
expected a part of type `application/octet-stream` to remain in place,
i.e. a part of "unstable type". In particular, tests with `fd46fc19`
would succeed on RHEL/EPEL but fail on all current Fedoras with

```
 FAIL   multipart/alternative hides html by default
--- T450-emacs-show.16.notmuch-show-multipart-alternative 2022-05-26 15:34:42.100557244 +0000
+++ T450-emacs-show.16.OUTPUT 2022-05-26 15:34:42.102557207 +0000
@@ -24,7 +24,7 @@
 uses 64 as the
 buffer size.
 [ text/html (hidden) ]
-[ 0001-Deal-with-situation-where-sysconf-_SC_GETPW_R_SIZE_M.patch: application/octet-stream (as text/x-diff) ]
+[ 0001-Deal-with-situation-where-sysconf-_SC_GETPW_R_SIZE_M.patch: application/octet-stream (as text/x-patch) ]
 From e3bc4bbd7b9d0d086816ab5f8f2d6ffea1dd3ea4 Mon Sep 17 00:00:00 2001
 From: Alexander Botero-Lowry <alex.boterolowry@gmail.com>
 Date: Tue, 17 Nov 2009 11:30:39 -0800
```

due to the different type detected.

Fix this by giving that message a specicific type of `text/x-diff` in
the test corpus, and adjust all affected test outputs.

Signed-off-by: Michael J Gruber <git@grubix.eu>
Amended-by: db, fix some trailing whitespace
4 weeks agoMerge branch 'release'
David Bremner [Thu, 26 May 2022 11:35:16 +0000 (08:35 -0300)]
Merge branch 'release'

4 weeks agolib/message: use false from stdbool.h release
David Bremner [Thu, 26 May 2022 11:30:00 +0000 (08:30 -0300)]
lib/message: use false from stdbool.h

As far as I know, this is just a style / consistency thing, unless
notmuch code starts defining FALSE inconsistently with false.

4 weeks agomerge uninitialized field fix from release
David Bremner [Thu, 26 May 2022 11:18:27 +0000 (08:18 -0300)]
merge uninitialized field fix from release

4 weeks agolib: fix uninitialized field in message objects.
David Bremner [Fri, 20 May 2022 12:46:39 +0000 (09:46 -0300)]
lib: fix uninitialized field in message objects.

Initially reported by Eliza Vasquez [1] (via valgrind).

[1]: id:87o7zxj086.fsf@eliza.

5 weeks agoemacs: document/defcustom notmuch-multipart/alternative-discouraged
David Bremner [Sat, 14 May 2022 11:26:38 +0000 (08:26 -0300)]
emacs:  document/defcustom notmuch-multipart/alternative-discouraged

This variable is important for people who want to change the default
behaviour when displaying multipart/alternative messages.  Previously
it was undocumented.  Add a defcustom to help users and copy some
documentation from the wiki. The usual machinery of re-using
docstrings is a bit tricky to use here because it mangles the example
lisp code, and the link to the info node should not be in e.g. the
html page.

Add a simple test to make sure the switch from defvar to defcustom did
not break something obvious.

5 weeks agodoc: define and use semantic markup for configuration items
David Bremner [Thu, 12 May 2022 11:52:30 +0000 (08:52 -0300)]
doc: define and use semantic markup for configuration items

This makes sure each configuration item is cross referenceable without
extra markup, and also adds index entries.

5 weeks agoemacs/reply: restrict what mime types are inlined by default
David Bremner [Sat, 19 Mar 2022 10:07:54 +0000 (07:07 -0300)]
emacs/reply: restrict what mime types are inlined by default

Apply the previously factored-out function used by notmuch-show.

5 weeks agoemacs: factor out calculation of mm-inline-override-types
David Bremner [Sat, 19 Mar 2022 10:07:53 +0000 (07:07 -0300)]
emacs: factor out calculation of mm-inline-override-types

The intended use case of this new function is to make reply behaviour
track that of show with respect to attachments.

Also fix the glob (which worked by fluke) into the documented regexp.

5 weeks agotest: add known broken test for inlining in emacs/reply
David Bremner [Sat, 19 Mar 2022 10:07:52 +0000 (07:07 -0300)]
test: add known broken test for inlining in emacs/reply

The same mitigation already applied for show should also be applied
for reply

5 weeks agotest/emacs: add regression test for display of tar attachments
David Bremner [Sat, 19 Mar 2022 10:07:51 +0000 (07:07 -0300)]
test/emacs: add regression test for display of tar attachments

These should continue to display as buttons by default, even as we
update the handling for reply.

5 weeks agotest: start corpus for attachments
David Bremner [Sat, 19 Mar 2022 10:07:50 +0000 (07:07 -0300)]
test: start corpus for attachments

Initially these are to test the emacs frontend.

6 weeks agodoc/emacs: document notmuch-show-toggle-toggle-elide-non-matching
David Bremner [Thu, 12 May 2022 10:47:52 +0000 (07:47 -0300)]
doc/emacs: document notmuch-show-toggle-toggle-elide-non-matching

Recently there was a question on the mailing list about the existence
of this function, so let us try to make it more discoverable.

8 weeks agodoc/sexp-queries: be more consistent about ending example text
David Bremner [Sat, 30 Apr 2022 17:18:37 +0000 (14:18 -0300)]
doc/sexp-queries: be more consistent about ending example text

Most, but not all of the the explanatory texts already end in
'.'. This makes the remainder match.

8 weeks agodoc/sexp-queries: fix example
David Bremner [Sat, 30 Apr 2022 17:13:03 +0000 (14:13 -0300)]
doc/sexp-queries: fix example

Update the explanatory text to match the query.

8 weeks agodoc/sexp-queries: escape @ in non-verbatim text
David Bremner [Thu, 28 Apr 2022 23:46:07 +0000 (20:46 -0300)]
doc/sexp-queries: escape @ in non-verbatim text

This prevents sphinx-doc from creating spurious mailto: links. Thanks
to Jakub Wilk for telling me about the fix.

2 months agoMerge branch 'release'
David Bremner [Mon, 25 Apr 2022 12:07:45 +0000 (09:07 -0300)]
Merge branch 'release'

2 months agodebian: changelog for 0.36-1 0.36 archive/debian/0.36-1 debian/0.36-1
David Bremner [Mon, 25 Apr 2022 11:48:07 +0000 (08:48 -0300)]
debian: changelog for 0.36-1

2 months agoNEWS: set release date
David Bremner [Mon, 25 Apr 2022 11:47:07 +0000 (08:47 -0300)]
NEWS: set release date

2 months agoversion: bump to 0.36
David Bremner [Mon, 25 Apr 2022 11:45:12 +0000 (08:45 -0300)]
version: bump to 0.36

2 months agoMerge branch 'release'
David Bremner [Fri, 22 Apr 2022 12:30:51 +0000 (09:30 -0300)]
Merge branch 'release'

2 months agoNEWS: user visible changes for 0.36
David Bremner [Sat, 16 Apr 2022 12:27:02 +0000 (09:27 -0300)]
NEWS: user visible changes for 0.36

2 months agoNEWS: fix location for notmuch-web
David Bremner [Sat, 16 Apr 2022 12:27:01 +0000 (09:27 -0300)]
NEWS: fix location for notmuch-web

It actually lives under 'devel/', not 'contrib/`.

2 months agoconfigure: avoid warning with -Wall
Michael J Gruber [Mon, 18 Apr 2022 14:48:50 +0000 (16:48 +0200)]
configure: avoid warning with -Wall

7228fe68 ("configure: restructure gmime cert validity checker code",
2022-04-09) restructured generated C code to repurpose it later on. This
put usage of `validity` within an `#if`, resulting in an "unused
warning" if that `#if` is not executed.

Put the variable declariation inside the same if branch and, thus,  quel
the warning.

Signed-off-by: Michael J Gruber <git@grubix.eu>
2 months agodebian: changelog for 0.36~rc1-1 archive/debian/0.36_rc1-1 debian/0.36_rc1-1
David Bremner [Sat, 16 Apr 2022 11:38:04 +0000 (08:38 -0300)]
debian: changelog for 0.36~rc1-1

2 months agoversion: bump to new release candidate 0.36_rc1
David Bremner [Sat, 16 Apr 2022 11:26:27 +0000 (08:26 -0300)]
version: bump to new release candidate

2 months agofix build without sfsexp
Michael J Gruber [Fri, 15 Apr 2022 16:23:46 +0000 (18:23 +0200)]
fix build without sfsexp

a1d139de ("lib: add sexp: prefix to Xapian (infix) query parser.",
2022-04-09) introduced sfsexp infix queries. This requires the infix
preprocessor to be built in in a way which does not require sfsexp when
notmuch is built without it.

Make the preprocessor throw a Xapian error in this case (and fix the
build).

Signed-off-by: Michael J Gruber <git@grubix.eu>
2 months agorelease: automate upload of pre-release tarballs 0.36_rc0 archive/debian/0.36_rc0-1 debian/0.36_rc0-1
David Bremner [Fri, 15 Apr 2022 12:17:30 +0000 (09:17 -0300)]
release: automate upload of pre-release tarballs

The tarballs were requested by some distro-packagers, and this
automation will hopefully reduce the number of errors from the current
manual process.

2 months agorelease: save more release files to releases/
David Bremner [Fri, 15 Apr 2022 12:11:28 +0000 (09:11 -0300)]
release: save more release files to releases/

The main change is to move the signatures to releases/ when invoking
the pre-release target; also stash the debian symlink for the release
target.

2 months agoNEWS: add header for 0.36
David Bremner [Fri, 15 Apr 2022 11:47:37 +0000 (08:47 -0300)]
NEWS: add header for 0.36

2 months agodebian: changelog for 0.36~rc0-1
David Bremner [Fri, 15 Apr 2022 11:45:28 +0000 (08:45 -0300)]
debian: changelog for 0.36~rc0-1

2 months agoversion: bump to 0.36~rc0
David Bremner [Fri, 15 Apr 2022 11:42:22 +0000 (08:42 -0300)]
version: bump to 0.36~rc0

2 months agolib: add sexp: prefix to Xapian (infix) query parser.
David Bremner [Sat, 9 Apr 2022 19:45:48 +0000 (16:45 -0300)]
lib: add sexp: prefix to Xapian (infix) query parser.

This is analogous to the "infix" prefix provided by the s-expression
based query parser.

2 months agotest/sexp: add test for and of stemmed terms.
David Bremner [Sat, 9 Apr 2022 19:45:47 +0000 (16:45 -0300)]
test/sexp: add test for and of stemmed terms.

Previously only singled stemmed terms were tested.

2 months agoconfigure: clean up new test source and binary files.
David Bremner [Wed, 13 Apr 2022 11:23:04 +0000 (08:23 -0300)]
configure: clean up new test source and binary files.

The previous source was renamed and a new binary generated in
commit 8723e707c15f7b435f07f5d5ea693496bb9769bb.

2 months agodebian: don't skip test smime.4
David Bremner [Wed, 13 Apr 2022 11:15:10 +0000 (08:15 -0300)]
debian: don't skip test smime.4

The test is fixed now.

2 months agotest/smime: fix signature verification test with newer gmime.
David Bremner [Tue, 12 Apr 2022 20:15:56 +0000 (22:15 +0200)]
test/smime: fix signature verification test with newer gmime.

The extra machinery to check for the actual output format is justified
by the possibility that distros may patch this newer output format
into older versions of gmime.

Amended-by: Michael J Gruber <git@grubix.eu>
Signed-off-by: Michael J Gruber <git@grubix.eu>
Amended-again-by: db
2 months agoconfigure: restructure gmime cert validity checker code
David Bremner [Sat, 9 Apr 2022 12:34:52 +0000 (09:34 -0300)]
configure: restructure gmime cert validity checker code

The goal is to generalize this to also check the output format of
g_mime_certificate_get_email.

2 months agoMerge branch 'release'
David Bremner [Thu, 7 Apr 2022 22:48:16 +0000 (17:48 -0500)]
Merge branch 'release'

2 months agodebian: upload 0.35-2 ; disable failing test archive/debian/0.35-2 debian/0.35-2
David Bremner [Mon, 28 Mar 2022 13:56:22 +0000 (07:56 -0600)]
debian: upload 0.35-2 ; disable failing test

We should fix this flaky test upstream, but for now, fix the build.

3 months agotest: unset XDG_DATA_HOME and MAILDIR for tests.
David Bremner [Fri, 25 Mar 2022 17:51:02 +0000 (11:51 -0600)]
test: unset XDG_DATA_HOME and MAILDIR for tests.

The some of the tests (and the library functions they exercise) that
rely on XDG_CONFIG_HOME also check XDG_DATA_HOME and MAILDIR.

3 months agolib: do not phrase parse prefixed bracketed subexpressions
David Bremner [Fri, 25 Feb 2022 02:41:03 +0000 (22:41 -0400)]
lib: do not phrase parse prefixed bracketed subexpressions

Since Xapian does not preserve quotes when passing the subquery to a
field processor, we have to make a guess as to what the user
intended. Here the added assumption is that a string surrounded by
parens is not intended to be a phrase.

3 months agotest: known broken tests for bracketed terms in subject
David Bremner [Fri, 25 Feb 2022 02:41:02 +0000 (22:41 -0400)]
test: known broken tests for bracketed terms in subject

The heuristics in the field processor currently incorrectly trigger
phrase parsing.

3 months agoemacs: whitespace cleanup for keybindings
David Bremner [Sat, 12 Feb 2022 20:27:42 +0000 (16:27 -0400)]
emacs: whitespace cleanup for keybindings

Changing the width of a column requires rewriting all the rows.

3 months agoemacs: Document undo binding.
David Bremner [Sat, 12 Feb 2022 20:27:41 +0000 (16:27 -0400)]
emacs: Document undo binding.

This messes up whitespace, which will require a global change to fix.

3 months agoemacs: redirect undo to notmuch-tag-undo
David Bremner [Sat, 12 Feb 2022 20:27:40 +0000 (16:27 -0400)]
emacs: redirect undo to notmuch-tag-undo

The double remap is a bit ugly, but it seems better than adding
another layer of keymaps for those modes where notmuch-tag-undo makes
sense.

3 months agoemacs: add notmuch-tag-undo
David Bremner [Sat, 12 Feb 2022 20:27:39 +0000 (16:27 -0400)]
emacs: add notmuch-tag-undo

Keybindings are deferred to a future commit.

3 months agoemacs/tag: keep tag history
David Bremner [Sat, 12 Feb 2022 20:27:38 +0000 (16:27 -0400)]
emacs/tag: keep tag history

This buffer local list will be used to provide an undo facility for
tagging operations. Keeping history can be disabled with the new
OMIT-HIST option.

3 months agoemacs: remove non-batch code path from function notmuch-tag
David Bremner [Sat, 12 Feb 2022 20:27:37 +0000 (16:27 -0400)]
emacs: remove non-batch code path from function notmuch-tag

It is no slower (according to T06-emacs) to use batch for everything,
and it simplifies the code.

3 months agoperf-test: emacs tagging
David Bremner [Sat, 12 Feb 2022 20:27:36 +0000 (16:27 -0400)]
perf-test: emacs tagging

Time tag operations, to see if it is worthwhile keeping both the
batch and the non-batch calls to notmuch tag.