| Age | Commit message (Collapse) | Author |
|
If the car of an element in notmuch-search-result-format is a
function, insert the result of calling the function into the buffer.
This allows a user to generate custom fields in the output of a search
result. For example, with:
(defun -notmuch-result-flags (format-string result)
(let ((tags-to-letters '(("flagged" . "!")
("unread" . "u")
("mine" . "m")
("sent" . "s")
("replied" . "r")))
(tags (plist-get result :tags)))
(format format-string
(mapconcat (lambda (t2l)
(if (member (car t2l) tags)
(cdr t2l)
" "))
tags-to-letters ""))))
(setq notmuch-search-result-format '((-notmuch-result-flags . "%s ")
("date" . "%12s ")
("count" . "%9s ")
("authors" . "%-30s ")
("subject" . "%s ")
("tags" . "(%s)")))
The first few characters on each line of the search result are used to
show information about some significant tags associated with the
thread.
|
|
Rather than lots of string-equal calls, use the pcase macro.
|
|
With [1: 16b2db09] we lost the (undocumented) option to use no Fcc
header only for From addresses matching a regexp. This brings back
that feature and documents it.
1: 2021-01-15 16b2db0986ce0ed7c420a69d0a98bb41e9ca4bd8
emacs: various cosmetic improvements
|
|
The trailing periods to smaller diff between devel/news2wiki.pl
output and what has been pushed to notmuch-wiki.
|
|
I chose to go with a somewhat terse synopsis to try to keep the length
of the page down.
|
|
We have to rewrite _optimize_tag_query here because it is generating
a query string in the infix Xapian syntax. Luckily this is easy to do
with the sexp query syntax.
|
|
The change in each case is to call notmuch_query_create_with_syntax,
relying on the already inherited shared options. As a bonus we get
improved error handling from the new query creation API.
The remaining subcommand is 'tag', which is a bit trickier.
|
|
This will allow easy addition of a query syntax option to other subcommands.
|
|
Macros implement lazy evaluation and lexical scope. The former is
needed to make certain natural constructs work sensibly (e.g. (tag
,param)) but the latter is mainly future-proofing in case the DSL is
is extended to allow local bindings.
For technical background, see chapters 6 and 17 of [1] (or some other
intermediate programming languages textbook).
[1] http://cs.brown.edu/courses/cs173/2012/book/
|
|
No functionality change, just an extra argument carried everywhere.
|
|
It turns out there is not really much code in query-fp.cc useful for
supporting the new syntax. The code we could potentially factor out
amounts to calling notmuch_database_get_config; both the key
construction and the parsing of the results are specific to the query
syntax involved.
|
|
This commit does not enable using saved s-expression queries, only
saving and retrieving them from the config file or the database. Use
in queries will be enabled in a following commit.
|
|
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).
|
|
This is intended to allow use outside of the Xapian query parser.
|
|
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.
|
|
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.
|
|
The code here is just gluing together _notmuch_query_expand with the
existing sexp parser infrastructure.
|
|
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.
|
|
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.
|
|
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.
|
|
At least to the degree that the Xapian QueryParser based parser
also supports them. Support short alias 'rx' as it seems to make more
complex queries nicer to read.
|
|
This will allow re-use of this code outside of the Xapian query parser.
|
|
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.
|
|
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.
|
|
Users that insist on using a literal '*' as a tag, can continue to do
so by quoting it when searching.
|
|
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 currrent (1.4.x) Xapian.
|
|
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).
|
|
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 case, it seems unlikely query parsing is very
often a bottleneck.
|
|
The omission of the 'extern "C"' machinery seems like an oversight.
|
|
The broken tests are because we do not yet handle phrase searches.
|
|
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.
|
|
This is somewhat less DWIM than the Xapian query parser, but it has
the advantage of simplicity.
|
|
This enables using the same stemmer in both query parsers.
|
|
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.
|
|
This will help provide more meaningful error messages without special
casing on the client side.
|
|
Initially support selection of query syntax in two subcommands to
enable testing.
|
|
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.
|
|
Most of the function will be re-usable when creating a query from an
s-expression.
|
|
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.
|
|
It turns out that now that we pass an open database into the
subcommands, it is easy to check any requested uuid against the
database at the same time as we process the other shared
arguments. This results in overall less boilerplate code, as well as
making a CLI scope function and variable file scope in notmuch.c.
|
|
|
|
|
|
These are failing on (surprisingly) the Debian amd64
autobuilder. There were also previous reports of failures on Ubuntu
s390x. Fixing this may require changing the way the default is
calculated.
|
|
|
|
The conffile in question is long gone, no need to retry removing it
forever.
|
|
|
|
|
|
|
|
|
|
This avoids some ugly error messages and exceptions, and hopes that
some gnus method will display message/rfc822 parts that have only a
file, no :content part.
|