emacs: Use of seq-some breaks 'nil' values in notmuch-fcc-dirs

2021-07-30 Thread Toke Høiland-Jørgensen
Hi Commit 16b2db0986ce ("emacs: various cosmetic improvements") switched over notmuch-fcc-header-setup to use 'seq-some' to parse the notmuch-fcc-dirs variables. However, this seems to have broken the use of 'nil' values in the list. Specifically, I have notmuch-fcc-dirs set to something like:

Re: [PATCH v2 0/2] scaffolding for autocrypt support

2021-07-30 Thread Philip Kaludercic
Hi, I just wanted to note that the backend system in autocrypt.el was reworked, and that this patch should probably be adapted, in case the maintainers are still interested. The details are documented here[0]. The intention is to make extensions like these simpler, and removing direct

sorting in show tree

2021-07-30 Thread Jose Antonio Ortega Ruiz
Hi, I wanted to be able to sort oldest-first in notmuch-tree view (inside emacs). Turns out that needed 'notmuch show' to accept a --sort argument (as search does). I've given it a try (with the patient help of David on IRC) in this repo: https://jao.io/cgit/notmuch/log/?h=tree-sort. With

Re: [PATCH] doc: tweak hook configuration documentation.

2021-07-30 Thread Hannu Hartikainen
LGTM, but because there is an empty line after `**database.hook_dir**` that section has different indentation than others in the generated manpage. Might as well fix that too. See snippet below, from a rendered manpage on my machine. Hannu --- database.backup_dir Directory

[PATCH v3 3/3] emacs: Allow functions in notmuch-{tree,unthreaded}-result-format

2021-07-30 Thread Andrew Tropin
Hi! Is this patch already applied? Can't find it in the repo. Would be really cool to have an ability to use custom function for formating mail tree. For now I have to use and advice and override notmuch-tree-insert-tree. ___ notmuch mailing list --

Notmuch emacs string-trim

2021-07-30 Thread Sami M'Barek
Hello, I was just trying to get back into my notmuch solution in emacs and noticed the notmuch-hello-search function has changed From the looks of it on GitHub the commit 8d701cdc997a1310efb2b6e08b95d705da9062e6 changed how the function works as Emacs 24.4 goes string trimming natively. Not

emacs: honoring notmuch-show-insert-part-text/html for 'w3m renderer

2021-07-30 Thread Jose Antonio Ortega Ruiz
Hi, notmuch-show-insert-part-text/html correctly binds shr-blocked-images to notmuch-show-text/html-blocked-images when using 'shr as the mm-text-html-renderer. However, when the latter is not shr, the function only binds gnus-blocked-images, which is not used by the 'w3m rendered. The

[PATCH] Fix author-scan.sh on BSD systems.

2021-07-30 Thread Matt Armstrong
BSD xargs does not have the -d option. Here we use tr to convert newlines to NUL characters, then pass -0 to xargs (which BSD does support). I looked at passing -z to 'git ls-files', but I did not find a BSD grep option to turn on NUL deliminted line processing. --- devel/author-scan.sh | 2 +-

[m...@beyermatthias.de: notmuch INSTALL file outdated?]

2021-07-30 Thread Matthias Beyer
Hi ML, as requested by David this is a forward of my initial question. See below. - Forwarded message from Matthias Beyer - Message-ID: <20210207115020.3ze6au4mglcsnypz@hoshi> From: Matthias Beyer To: David Bremner , Carl Worth Date: Sun, 7 Feb 2021 12:50:22 +0100 Subject: notmuch

(setq notmuch-search-oldest-first nil) doesn't behave as expected

2021-07-30 Thread Firmin Martin
After upgraded notmuch (now 0.29.3), I realized that the following line in my init file (setq notmuch-search-oldest-first nil) didn't work anymore when I entered in "all mail". That is, my oldest emails show up firstly. However, when I evaled (notmuch-search "*") my newest emails are

Re: [PATCH] cli: remove extraneous space in message

2021-07-30 Thread David Bremner
Simon Branch writes: > --- > notmuch-setup.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) thanks, applied to master. Sorry for the delay. d ___ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to

[PATCH 24/27] lib/parse-sexp: support infix subqueries

2021-07-30 Thread David Bremner
This is necessary so that programs can take infix syntax queries from a user and use the sexp query syntax to construct e.g. a refinement of that query. --- doc/man7/notmuch-sexp-queries.rst | 7 + lib/parse-sexp.cc | 34 test/T081-sexpr-search.sh

[PATCH 20/27] lib: generate actual Xapian query for "*" and ""

2021-07-30 Thread David Bremner
The previous code had the somewhat bizarre effect that the (notmuch specific) query string was "*" (interpreted as MatchAll) and the allegedly parsed xapian_query was "MatchNothing". This commit also reduces code duplication. --- lib/query.cc | 34 ++ 1 file

[PATCH 17/27] lib/query: generalize exclude handling to s-expression queries

2021-07-30 Thread David Bremner
In fact most of the code path is in common, only the caching of terms in the query needs to be added for s-expression queries. --- lib/query.cc | 34 ++--- test/T081-sexpr-search.sh | 40 +++ 2 files changed, 63

[PATCH 03/27] lib: define notmuch_query_create_with_syntax

2021-07-30 Thread David Bremner
Set the parsing syntax when the (notmuch) query object is created. Initially the library always returns a trivial query that matches all messages when using s-expression syntax. It seems better to select the syntax at query creation time because the lazy parsing is an implementation detail. ---

[PATCH 13/27] lib/parse-sexp: add term prefix backed fields

2021-07-30 Thread David Bremner
We use "boolean" to describe fields that should generate terms literally without stemming or phrase splitting. This terminology might not be ideal but it is already enshrined in notmuch-search-terms(7). --- doc/man7/notmuch-sexp-queries.rst | 18 +- lib/parse-sexp.cc | 49

[PATCH 10/27] lib/parse-sexp: support subject field

2021-07-30 Thread David Bremner
The broken tests are because we do not yet handle phrase searches. --- doc/man7/notmuch-sexp-queries.rst | 57 +++ lib/parse-sexp.cc | 19 +-- test/T081-sexpr-search.sh | 56 ++ 3 files changed, 130

[PATCH 16/27] lib/parse-sexp: handle unprefixed terms.

2021-07-30 Thread David Bremner
This is equivalent to adding the same field name "" for multiple prefixes in the Xapian query parser, but we have to explicitely construct the resulting query. --- lib/parse-sexp.cc | 36 test/T081-sexpr-search.sh | 35

[PATCH 26/27] lib: factor out expansion of saved queries.

2021-07-30 Thread David Bremner
This is intended to allow use outside of the Xapian query parser. --- lib/database-private.h | 5 + lib/query-fp.cc| 22 +++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/lib/database-private.h b/lib/database-private.h index 9ee3b933..8b9d67fe

[PATCH 05/27] lib: add new status code for query syntax errors.

2021-07-30 Thread David Bremner
This will help provide more meaningful error messages without special casing on the client side. --- bindings/python-cffi/notmuch2/_build.py | 1 + bindings/python-cffi/notmuch2/_errors.py | 3 +++ lib/database.cc | 2 ++ lib/notmuch.h| 4

[PATCH 02/27] lib: split notmuch_query_create

2021-07-30 Thread David Bremner
Most of the function will be re-usable when creating a query from an s-expression. --- lib/query.cc | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/query.cc b/lib/query.cc index 792aba21..39b85e91 100644 --- a/lib/query.cc +++ b/lib/query.cc @@ -84,9

[PATCH 01/27] configure: optional library sfsexp

2021-07-30 Thread David Bremner
The configure part is essentially the same as the other checks using pkg-config. Since the optional inclusion of this feature changes what options are available to the user, include it in the "built_with" pseudo-configuration keys. --- configure| 26 +-

[PATCH 14/27] lib/parse-sexp: 'starts-with' wildcard searches

2021-07-30 Thread David Bremner
The many tests potentially overkill, but they could catch typos in the prefixes table. As a simplifying assumption, for now we assume a single argument to the wildcard operator, as this matches the Xapian semantics. The name 'starts-with' is chosen to emphasize the supported case of wildcards in

[PATCH 15/27] lib/parse-sexp: add '*' as syntactic sugar for '(starts-with "")'

2021-07-30 Thread David Bremner
Users that insist on using a literal '*' as a tag, can continue to do so by quoting it when searching. --- doc/man7/notmuch-sexp-queries.rst | 14 + lib/parse-sexp.cc | 5 test/T081-sexpr-search.sh | 48 +++ 3 files changed, 67

[PATCH 07/27] lib: leave stemmer object accessible

2021-07-30 Thread David Bremner
This enables using the same stemmer in both query parsers. --- lib/database-private.h | 1 + lib/open.cc| 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/database-private.h b/lib/database-private.h index f206efaf..85d55299 100644 --- a/lib/database-private.h

[PATCH 18/27] lib: factor out query construction from regexp

2021-07-30 Thread David Bremner
This will allow re-use of this code outside of the Xapian query parser. --- lib/database-private.h | 5 +++ lib/regexp-fields.cc | 81 +- lib/regexp-fields.h| 6 3 files changed, 68 insertions(+), 24 deletions(-) diff --git

[PATCH 23/27] lib/parse-sexp: expand queries

2021-07-30 Thread David Bremner
The code here is just gluing together _notmuch_query_expand with the existing sexp parser infrastructure. --- doc/man7/notmuch-sexp-queries.rst | 20 +++ lib/parse-sexp.cc | 56 +-- test/T081-sexpr-search.sh | 52

[PATCH 21/27] lib/query: factor out _notmuch_query_string_to_xapian_query

2021-07-30 Thread David Bremner
When dealing with recursive queries (i.e. thread:{foo}) it turns out to be useful just to deal with the underlying Xapian objects, and not wrap them in notmuch objects. --- lib/database-private.h | 7 ++ lib/query.cc | 51 -- 2 files changed,

[PATCH 08/27] lib/parse-sexp: stem unquoted atoms

2021-07-30 Thread David Bremner
This is somewhat less DWIM than the Xapian query parser, but it has the advantage of simplicity. --- doc/man7/notmuch-sexp-queries.rst | 10 -- lib/parse-sexp.cc | 10 +++--- test/T081-sexpr-search.sh | 7 +-- 3 files changed, 20 insertions(+), 7

[PATCH 04/27] CLI/search+address: support sexpr queries

2021-07-30 Thread David Bremner
Initially support selection of query syntax in two subcommands to enable testing. --- notmuch-search.c | 13 + test/T080-search.sh | 5 + test/T095-address.sh | 5 + 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/notmuch-search.c b/notmuch-search.c

[PATCH 19/27] lib/parse-sexp: support regular expressions

2021-07-30 Thread David Bremner
At least to the degree that the Xapian QueryParser parser based parser also supports them. Support short alias 'rx' as it seems to make more complex queries nicer to read. --- doc/man7/notmuch-sexp-queries.rst | 8 lib/parse-sexp.cc | 54 ++-

[PATCH 25/27] lib/parse-sexp: parse user headers

2021-07-30 Thread David Bremner
One subtle aspect is the replacement of _find_prefix with _notmuch_database_prefix, which understands user headers. Otherwise the code mainly consists of creating a fake prefix record (since the user prefixes are not in the prefix table) and error handling. --- doc/man7/notmuch-sexp-queries.rst |

[PATCH 12/27] lib/parse-sexp: support phrase queries.

2021-07-30 Thread David Bremner
Anything that is quoted or not purely word characters is considered a phrase. Phrases are not stemmed, because the stems do not have positional information in the database. It is less efficient to scan the term twice, but it avoids a second pass to add prefixes, so maybe it balances out. In any

[PATCH 09/27] lib/parse-sexp: support and, not, and or.

2021-07-30 Thread David Bremner
All operations and (Xapian) fields will eventually have an entry in the prefixes table. The flags field is just a placeholder for now, but will eventually distinguish between various kinds of prefixes. --- doc/man7/notmuch-sexp-queries.rst | 16 --- lib/parse-sexp.cc | 76

[PATCH 06/27] lib/parse-sexp: parse single terms and the empty list.

2021-07-30 Thread David Bremner
There is not much of a parser here yet, but it already does some useful error reporting. Most functionality sketched in the documentation is not implemented yet; detailed documentation will follow with the implementation. --- doc/conf.py | 4 ++ doc/index.rst

[PATCH 11/27] util/unicode: allow calling from C++

2021-07-30 Thread David Bremner
The omission of the 'extern "C"' machinery seems like an oversight. --- util/unicode-util.h | 7 +++ 1 file changed, 7 insertions(+) diff --git a/util/unicode-util.h b/util/unicode-util.h index 32d1e6ef..1bb9336a 100644 --- a/util/unicode-util.h +++ b/util/unicode-util.h @@ -4,9 +4,16 @@

[PATCH 22/27] lib/thread-fp: factor out query expansion, rewrite in Xapian

2021-07-30 Thread David Bremner
It will be convenient not to have to construct a notmuch query object when parsing subqueries, so the commit rewrites the query expansion (currently only used for thread:{} queries) using only Xapian. As a bonus it seems about 15% faster in initial experiments. --- lib/database-private.h | 16

[PATCH 27/27] lib/parse-sexp: handle saved queries

2021-07-30 Thread David Bremner
This provides functionality analogous to query: in the Xapian QueryParser based parser. Perhaps counterintuitively, the saved queries currently have to be in the original query syntax (i.e. not s-expressions). --- doc/man7/notmuch-sexp-queries.rst | 6 ++ lib/parse-sexp.cc |

v3 sexpr query parser

2021-07-30 Thread David Bremner
This obsoletes and replaces [1]. I updated the syntax to be more orthogonal, and documented it [2]. The examples in the documentation now show solutions for several outstanding feature requests, so even if you don't feel up to reviewing the patch series, have a look at the user syntax [2] and

Compacting the database: xapian-compact vs notmuch-compact

2021-07-30 Thread Antoine Amarilli
Hi all, I'm confused by this page of the notmuch website , specifically the section "Compact your database", which talks about compacting the notmuch database using "xapian-compact". I don't understand how this relates to the command "notmuch compact"

Re: [Kevin McCarthy] Bug#966100: notmuch-mutt: symlinking now fails for indexed mailboxes with a space in the name

2021-07-30 Thread Greg Anders
On Sat Aug 1, 2020 at 2:22 PM MDT, David Bremner wrote: > Greg Anders writes: > > > From 92221d856e663450c1f55b9ec9a6aa69b4d27b3d Mon Sep 17 00:00:00 2001 > > From: Greg Anders > > Date: Sun, 26 Jul 2020 14:57:56 -0600 > > Subject: [PATCH] notmuch-mutt: quote variables to prevent word splitting

Re: [Kevin McCarthy] Bug#966100: notmuch-mutt: symlinking now fails for indexed mailboxes with a space in the name

2021-07-30 Thread Greg Anders
From 92221d856e663450c1f55b9ec9a6aa69b4d27b3d Mon Sep 17 00:00:00 2001 From: Greg Anders Date: Sun, 26 Jul 2020 14:57:56 -0600 Subject: [PATCH] notmuch-mutt: quote variables to prevent word splitting This fixes a bug where mail under directories with spaces in their names would not be found.

Re: [Kevin McCarthy] Bug#966100: notmuch-mutt: symlinking now fails for indexed mailboxes with a space in the name

2021-07-30 Thread Kevin J. McCarthy
On Thu, Jul 23, 2020 at 06:58:42PM +0300, Tomi Ollila wrote: This could work, cannot test (compiles OK w/ perl -c when I outcommented packages I don't have. I'm not subscribed to the mailing list, so my reply there will probably bounce. A quick test of your patch seemed to work for me.

Re: [Kevin McCarthy] Bug#966100: notmuch-mutt: symlinking now fails for indexed mailboxes with a space in the name

2021-07-30 Thread Stefano Zacchiroli
Heya, thanks for the heads up. I don't think I was involved in that specific commit though, so I'm shamelessly punting to the author (added to Cc:) :-) (FWIW, I don't see either at first sight why it would break anything...) Cheers On Thu, Jul 23, 2020 at 06:50:29AM -0300, David Bremner wrote:

old held messages

2021-07-30 Thread David Bremner
For reasons I don't completely understand, we have a substantial backlog of messages (e.g. from non-subscribers) that mailman held for us, but didn't forward to moderators. I'm currently working my way through, and I apologize in advance for the odd spam that sneaks through and/or the old

Re: [PATCH] completion: remove "setup" from the list of possible completions

2021-07-30 Thread Lukasz Stelmach
It was <2020-07-02 czw 15:55>, when Daniel Kahn Gillmor wrote: > On Wed 2020-06-24 21:44:01 +1000, Peter Wang wrote: >> On Mon, 22 Jun 2020 12:22:50 +0200 Lukasz Stelmach >> wrote: >>> It was <2020-06-20 sob 12:53>, when Reto wrote: On Fri, Jun 19, 2020 at 12:40:49PM +0200, Łukasz Stelmach