notmuch
47 hours agoemacs/reply: restrict what mime types are inlined by default master
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.

47 hours 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.

47 hours 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

47 hours 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.

47 hours 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.

2 days 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.

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

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

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

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

3 weeks agodebian: changelog for 0.36-1 release 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

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

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

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

3 weeks 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

3 weeks 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/`.

4 weeks 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>
4 weeks 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

4 weeks 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

4 weeks 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>
4 weeks 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.

4 weeks 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.

4 weeks 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

4 weeks 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

4 weeks 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

4 weeks 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.

4 weeks 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.

4 weeks 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.

4 weeks 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.

4 weeks 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
4 weeks 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.

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

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

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

8 weeks 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.

8 weeks 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.

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

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

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

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

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

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

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

2 months agoperf-test: allow running test_emacs from performance test suite.
David Bremner [Sat, 12 Feb 2022 20:27:35 +0000 (16:27 -0400)]
perf-test: allow running test_emacs from performance test suite.

test_require_external prereq has to move to test-lib-common.sh, and
the new shell functions print_emacs_header and time_emacs are provided.

The somewhat indirect way of printing the output is to avoid the extra
"" present on string values from emacsclient.

2 months agotest/emacs: split out tagging related tests
David Bremner [Sat, 12 Feb 2022 20:27:34 +0000 (16:27 -0400)]
test/emacs: split out tagging related tests

T310-emacs is one of the largest and longest running sets of
tests. Splitting out the tagging operations will help maintainability
as well as potentially improve the parallel running time of the test
suite. Some slowdown in running the tests sequentially may result
since there is repeated setup.

2 months agotest: split variable settings to their own file
David Bremner [Sat, 12 Feb 2022 20:27:33 +0000 (16:27 -0400)]
test: split variable settings to their own file

This allows sharing more variable settings between the (correctness)
tests and the performance-tests. Unfortunately it seems a bit tricky
to move settings to test-lib-common.sh, as that is sourced late in
test-lib.sh, and moving it earlier breaks things.

2 months agodoc/emacs: add minimal documentation for notmuch-unthreaded mode.
David Bremner [Sat, 12 Feb 2022 20:27:32 +0000 (16:27 -0400)]
doc/emacs: add minimal documentation for notmuch-unthreaded mode.

If nothing else it means the mode is discoverable by browsing the
documentation, and also provides a target for links when enumerating
modes.

2 months agodevel/notmuch-web: single user web front end using python-cffi
David Bremner [Sun, 16 Jan 2022 19:31:00 +0000 (15:31 -0400)]
devel/notmuch-web: single user web front end using python-cffi

Originally contributed by Brian Sniffen [1]. Quite a few unpublished
fixes from Daniel Kahn Gilmour. We've been running it a few years now
as the "official" archive of the notmuch mailing list. There also a
few fixes from myself and Austin Ray. Finally I converted it to the
new python bindings.

This commit squashes the several years of development history and
moves it under devel, in recognition of the now established role it
plays in the project infrastructure.

[1]: id:87tvyvp4f2.fsf@istari.evenmere.org

2 months agoremoved use of 'echo -n' (and echo -n -e ...)
Tomi Ollila [Sun, 20 Feb 2022 22:30:45 +0000 (00:30 +0200)]
removed use of 'echo -n' (and echo -n -e ...)

In most cases used printf %s ... instead.

echo -n > file  lines to create empty / truncate files were
changed to : > file lines, like done in in test-lib-emacs.sh

And one echo -n "  " replaced with use of sed "s/^/  /" in next line.

2 months agodoc: use hyperlinks for config options in notmuch-insert(1)
David Bremner [Sun, 6 Feb 2022 14:02:37 +0000 (10:02 -0400)]
doc: use hyperlinks for config options in notmuch-insert(1)

The tradeoff is no bold/italic in the man pages to get actual
hyperlinks in the html output.

2 months agodoc: add configuration section to notmuch-insert(1)
David Bremner [Sun, 6 Feb 2022 13:38:16 +0000 (09:38 -0400)]
doc: add configuration section to notmuch-insert(1)

This is partially redudant given some existing cross references, but
it is useful to have all of the config keys listed in one place, to
help keep track of them if nothing else.

2 months agodoc: add configuration section to notmuch-new(1)
David Bremner [Sun, 6 Feb 2022 13:28:14 +0000 (09:28 -0400)]
doc: add configuration section to notmuch-new(1)

Increase discoverability.

2 months agodoc: alphabetize options in notmuch-config(1)
David Bremner [Sun, 6 Feb 2022 13:07:13 +0000 (09:07 -0400)]
doc: alphabetize options in notmuch-config(1)

Originally (I think) these were in the order generated by notmuch
setup. As the number of options grows, and several are not in the
initial setup generated file, the original order becomes less useful
for users. This commit alphabetizes the keys to help users
search. There is only one content change, an added cross-reference
from user.other_email to user.primary_email.

2 months agoCLI/insert: escape envelope from
David Bremner [Sat, 12 Feb 2022 02:47:03 +0000 (22:47 -0400)]
CLI/insert: escape envelope from

The idea is to do as little parsing and modification of the delivered
message as possible. Luckily the position of the "envelope header"
lets us escape it by replacing the first 5 characters of the stream
with a regular header name (with ':').

2 months agoCLI/insert: split copy_fd
David Bremner [Sun, 13 Feb 2022 14:48:47 +0000 (10:48 -0400)]
CLI/insert: split copy_fd

This helps maintainability and enables code-reuse of our home-brewed
buffered-write code.

This commit is mostly code movement.

2 months agotest: add known broken test for insert with mbox as input
David Bremner [Sat, 12 Feb 2022 02:10:07 +0000 (22:10 -0400)]
test: add known broken test for insert with mbox as input

It seems reasonable that notmuch should try to avoid delivering
messages in formats it cannot index.

2 months agotest: start new corpus of test messages for indexing code
David Bremner [Sat, 5 Feb 2022 19:52:10 +0000 (15:52 -0400)]
test: start new corpus of test messages for indexing code

This particular message is not recognized by notmuch as mail, but is
fine according to e.g. mutt. The trigger for this bad behaviour seems
to be a second "From " ocurring at the beginning of the line but
inside an attachment.

2 months agopython-cffi: use config_pairs API in ConfigIterator
David Bremner [Wed, 9 Feb 2022 12:28:54 +0000 (08:28 -0400)]
python-cffi: use config_pairs API in ConfigIterator

This returns all of the config keys with non-empty values, not just
those that happen to be stored in the database.

2 months agotest: known broken test for list(db.config) in python-cffi bindings
David Bremner [Wed, 9 Feb 2022 01:01:16 +0000 (21:01 -0400)]
test: known broken test for list(db.config) in python-cffi bindings

As of notmuch 0.34.2 [1], the python-cffi bindings make available the
configuration from both a config file and the database when accessing
Database.config like a dictionary.  It is therefore confusing that the
iterator operations only work on the configuration information stored
in the database.

[1]: d7f95724132bf658fd151630185899737e2ed829

2 months agoemacs: escape quote in notmuch-search-result-format docstring
David Bremner [Wed, 16 Feb 2022 11:56:42 +0000 (07:56 -0400)]
emacs: escape quote in notmuch-search-result-format docstring

Prevent Emacs' mangling of quotes, which breaks the code sample.

3 months agoemacs: remove png logo
David Bremner [Sat, 5 Feb 2022 12:21:20 +0000 (08:21 -0400)]
emacs: remove png logo

Reduce chance of downstream packagers packing the wrong file.

3 months agodoc: make post-hook description more precise
inwit [Fri, 11 Feb 2022 16:56:32 +0000 (17:56 +0100)]
doc: make post-hook description more precise

Add the word "any" to the description of post-new hook description in
order to clarify that it is always run, even if there are no new
messages.

3 months agogitignore: add bindings/python-cffi/_notmuch_config.py 0.35
David Bremner [Sun, 6 Feb 2022 17:14:54 +0000 (13:14 -0400)]
gitignore: add bindings/python-cffi/_notmuch_config.py

This is generated by configure and should not be committed.

3 months agoversion: bump to 0.35
David Bremner [Sun, 6 Feb 2022 17:11:32 +0000 (13:11 -0400)]
version: bump to 0.35

3 months agoNEWS: set release date for 0.35
David Bremner [Sun, 6 Feb 2022 17:10:43 +0000 (13:10 -0400)]
NEWS: set release date for 0.35

3 months agodebian: start changelog for 0.35
David Bremner [Sun, 6 Feb 2022 16:15:44 +0000 (12:15 -0400)]
debian: start changelog for 0.35

3 months agoNEWS: remaining items for 0.35 release
David Bremner [Sat, 5 Feb 2022 12:43:28 +0000 (08:43 -0400)]
NEWS: remaining items for 0.35 release

These are my best guesses based on git commit messages.

3 months agoNEWS: emacs/notmuch-logo.svg is there in 0.35
Tomi Ollila [Mon, 31 Jan 2022 20:47:43 +0000 (22:47 +0200)]
NEWS: emacs/notmuch-logo.svg is there in 0.35

3 months agoNEWS: my changes for 0.35
David Bremner [Sun, 30 Jan 2022 13:23:26 +0000 (09:23 -0400)]
NEWS: my changes for 0.35

3 months agodebian: changelog for 0.35~rc0-2 archive/debian/0.35_rc0-2 debian/0.35_rc0-2
David Bremner [Sun, 30 Jan 2022 01:54:00 +0000 (21:54 -0400)]
debian: changelog for 0.35~rc0-2

3 months agodebian: add missing install file for notmuch-doc archive/debian/0.35_rc0-1 debian/0.35_rc0-1
David Bremner [Sat, 29 Jan 2022 22:50:48 +0000 (18:50 -0400)]
debian: add missing install file for notmuch-doc

This was missed from commit 11f03c87a205ffa99ff5e7b301b03bf996a8d562

3 months agoNEWS: add stub for 0.35 0.35_rc0
David Bremner [Sat, 29 Jan 2022 22:17:23 +0000 (18:17 -0400)]
NEWS: add stub for 0.35

3 months agodebian: add changelog for 0.34~rc0-1
David Bremner [Sat, 29 Jan 2022 22:15:05 +0000 (18:15 -0400)]
debian: add changelog for 0.34~rc0-1

3 months agolib: bump minor version to 6.
David Bremner [Sat, 29 Jan 2022 22:13:26 +0000 (18:13 -0400)]
lib: bump minor version to 6.

One new status value and one configuration value added.

3 months agoversion: bump to 0.35~rc0
David Bremner [Sat, 29 Jan 2022 22:12:58 +0000 (18:12 -0400)]
version: bump to 0.35~rc0

Start release process for 0.35

3 months agodebian: package HTML docs
David Bremner [Wed, 26 Jan 2022 13:30:46 +0000 (09:30 -0400)]
debian: package HTML docs

This is particularly useful for the docs for the notmuch2 python
bindings, which are otherwise not packaged.

3 months agodoc: replace :math: for subscripts in notmuch-sexp-queries(7)
David Bremner [Wed, 26 Jan 2022 13:30:45 +0000 (09:30 -0400)]
doc: replace :math: for subscripts in notmuch-sexp-queries(7)

Sphinx pulls in mathjax to do :math:, which complicates viewing the
html version offline. The direct :sub: is supported directly in html.

3 months agolib: strip trailing '/' from pathnames (sexp queries).
David Bremner [Fri, 21 Jan 2022 23:38:53 +0000 (19:38 -0400)]
lib: strip trailing '/' from pathnames (sexp queries).

This changes makes the sexp query parser consistent with the infix one
in ignoring trailing '/'. Here we do a bit better and ignore any
number of trailing '/'.

3 months agotest: add multiple path, folder sexp query tests
David Bremner [Fri, 21 Jan 2022 23:38:52 +0000 (19:38 -0400)]
test: add multiple path, folder sexp query tests

This is mainly to make sure we get trailing / removal correct. Also
add regression test for path: in the infix parser matching the
existing one for folder:.

3 months agolib: drop trailing slash for path and folder searches (infix)
David Bremner [Fri, 21 Jan 2022 23:38:51 +0000 (19:38 -0400)]
lib: drop trailing slash for path and folder searches (infix)

This resolves an old bug reported by David Edmondson in 2014. The fix
is only needed for the "boolean" case, as probabilistic / phrase
searching already ignores punctuation.

This fix is only for the infix (xapian provided) query parser.

[1]: id:cunoasuolcv.fsf@gargravarr.hh.sledj.net

3 months agotest/sexp: tests for path, folder, including trailing '/' (sexp)
David Bremner [Fri, 21 Jan 2022 23:38:50 +0000 (19:38 -0400)]
test/sexp: tests for path, folder, including trailing '/' (sexp)

This duplicates the bug reported in [1], as well as adding some simple
regression tests for 'path' and 'folder' searches which were
previously missing for sexp syntax.

[1]: id:cunoasuolcv.fsf@gargravarr.hh.sledj.net

3 months agotest: known broken tests for trailing / in path search (infix)
David Bremner [Fri, 21 Jan 2022 23:38:49 +0000 (19:38 -0400)]
test: known broken tests for trailing / in path search (infix)

In [1], David Edmondson observed that the trailing / added by many
completion mechanisms causes path searches to silently fail.  This
test reproduces that bug for both `path:' and `folder:' searches.

[1]: id:cunoasuolcv.fsf@gargravarr.hh.sledj.net

3 months agotest: sanitize generated message files names
David Bremner [Fri, 21 Jan 2022 23:38:48 +0000 (19:38 -0400)]
test: sanitize generated message files names

It is fragile to encode the generated names into tests, as it makes
tests break when e.g. new tests are added.  There is a possibility
that this will hide certain failures; in that case meaningful filenames
should be chosen for the generated messages.

3 months agolib/parse-sexp: handle lastmod queries.
David Bremner [Thu, 20 Jan 2022 13:36:05 +0000 (09:36 -0400)]
lib/parse-sexp: handle lastmod queries.

This particular choice of converting strings to integers requires C++11.

3 months agotest/sexpr-search: add known broken tests for lastmod queries
David Bremner [Thu, 20 Jan 2022 13:36:04 +0000 (09:36 -0400)]
test/sexpr-search: add known broken tests for lastmod queries

These are loosely modelled on the tests just above for date ranges,
since the error conditions are similar. Some ideas also borrowed from
T570-revision-tracking.

3 months agolib/parse-sexp: support actual date queries.
David Bremner [Thu, 20 Jan 2022 13:36:03 +0000 (09:36 -0400)]
lib/parse-sexp: support actual date queries.

The default argument processing overlaps somewhat with what is already
done in _notmuch_date_strings_to_query, but we can give more specific
error messages for the s-expression context.

The extra generality of _sexp_parse_range will be useful when we
implement additional range prefixes (at least 'lastmod' is needed).

3 months agolib/date: factor out date range parsing.
David Bremner [Thu, 20 Jan 2022 13:36:02 +0000 (09:36 -0400)]
lib/date: factor out date range parsing.

This will allow re-using the same logic in the s-expression parser.

3 months agolib/parse-sexp: support zero argument date queries
David Bremner [Thu, 20 Jan 2022 13:36:01 +0000 (09:36 -0400)]
lib/parse-sexp: support zero argument date queries

These are not too practical, although they may simplify some user
query generation code. Mainly this adds a new prefix keyword to the
parser.

3 months agotest/search: add known broken tests for 'date' prefix
David Bremner [Thu, 20 Jan 2022 13:36:00 +0000 (09:36 -0400)]
test/search: add known broken tests for 'date' prefix

This is documented, but apparently not implemented. Add tests for
planned supported syntax and error messages.

3 months agoemacs: use cached encoded copy for fcc
David Bremner [Thu, 20 Jan 2022 03:22:07 +0000 (23:22 -0400)]
emacs: use cached encoded copy for fcc

This fixes the bug reported by dkg in [1]. The movement of the call to
n-m-setup-message-for-saving is so the cleanup of Fcc headers happens
in the encoded version (otherwise Fcc headers may be saved to disk).

[1]: id:87k1zm225v.fsf@fifthhorseman.net

3 months agotest/emacs: known broken test for matching fcc and sent message
David Bremner [Thu, 20 Jan 2022 01:23:30 +0000 (21:23 -0400)]
test/emacs: known broken test for matching fcc and sent message

Based on the method outlined by Daniel Kahn Gillmor in
id:87k1zm225v.fsf@fifthhorseman.net.  With a delay of 0.2 seconds the
test becomes flaky on my machine. With a 1 second delay it fails
consistently for more than 1600 iterations.

3 months agotest: define test_expect_equal_message_body
David Bremner [Thu, 20 Jan 2022 11:48:35 +0000 (07:48 -0400)]
test: define test_expect_equal_message_body

This is a relatively simple sed invocation, but rather than write a
comment everywhere, give it a descriptive name.

3 months agotest/emacs: match mml settings in emacs_{fcc,deliver}_message
David Bremner [Thu, 20 Jan 2022 00:50:49 +0000 (20:50 -0400)]
test/emacs: match mml settings in emacs_{fcc,deliver}_message

This will allow the sending of signed messages via smtp in the test
suite.

3 months agodoc: document new option `show.extra_headers`
David Bremner [Tue, 18 Jan 2022 13:26:59 +0000 (09:26 -0400)]
doc: document new option `show.extra_headers`

Increase discoverability by cross referencing from the notmuch-show
manual entry to the notmuch-config manual entry.

3 months agoCLI/setup: special case single item lists
David Bremner [Mon, 17 Jan 2022 23:54:53 +0000 (19:54 -0400)]
CLI/setup: special case single item lists

This matches the heuristic used by "notmuch config set" to decide if
something is a list.

This change fixes the bug reported at [1].

[1]: id:6O3LTUhoXlrnkPWCtPJCP4cagU7mFVEdyTpcC_37BoSzStlARXDBa7oczy6hB0jyjGjBQvgj_jFV58cw0aNx-jUg1h1O-FQ7820k68C0X4M=@protonmail.com

3 months agotest/setup: add known broken test for single items
David Bremner [Mon, 17 Jan 2022 23:54:52 +0000 (19:54 -0400)]
test/setup: add known broken test for single items

In [1] Ian observed that notmuch setup was inconsistent with notmuch
config set when adding single items, namely adding an unneeded
semi-colon at the end. This test replicates that bug.

[1]: id:6O3LTUhoXlrnkPWCtPJCP4cagU7mFVEdyTpcC_37BoSzStlARXDBa7oczy6hB0jyjGjBQvgj_jFV58cw0aNx-jUg1h1O-FQ7820k68C0X4M=@protonmail.com

3 months agoemacs: customizable names for search buffers
jao [Sun, 23 Jan 2022 19:54:17 +0000 (19:54 +0000)]
emacs: customizable names for search buffers

Customizable names for buffers presenting search results, via two
custom variables (notmuch-search-buffer-name-format and
notmuch-saved-search-buffer-name-format), defaulting to values
currently used for plain searches and including too tree and
unthreaded search buffers.

Amended by db: spelling fix.

3 months agoemacs: define, use option :disable-excludes for n-h-query-counts
David Bremner [Sat, 22 Jan 2022 17:44:40 +0000 (13:44 -0400)]
emacs: define, use option :disable-excludes for n-h-query-counts

Initially only use in notmuch-hello-insert-alltags. This is a more
narrow resolution of [1], which (unlike [2]) does not disable exclude
processing for regular saved searches.

[1]: id:87wox1vovj.fsf@len.workgroup
[2]: id:20220105010606.2034601-2-david@tethera.net

3 months agoRevert "emacs: use --exclude=false when checking for empty searches"
David Bremner [Sat, 22 Jan 2022 17:44:39 +0000 (13:44 -0400)]
Revert "emacs: use --exclude=false when checking for empty searches"

Revert commit 8370e3cfe2dd8a79323613c2bbf2f11db6134dac, and remark the
corresponding test as broken. Also update the expected output of the
broken test to show excludes active in the user defined saved searches.

3 months agolib/database: delete stemmer on destroy
David Bremner [Sun, 9 Jan 2022 14:38:05 +0000 (10:38 -0400)]
lib/database: delete stemmer on destroy

Commit [0] left the stemmer object accessible, but did not add
de-allocation code to notmuch_database_destroy. This commit corrects
that oversight.

Leak originally reported by Austin Ray [1].

[0]: 3202e0d1feba1ab955ba1c07098c00208f8f0ada
[1]: id:20220105224538.m36lnjn7rf3ieonc@athena