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.
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.
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.
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
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.
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.
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.
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.
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
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
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.
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
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.
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
David Bremner [Sun, 9 Jan 2022 14:38:04 +0000 (10:38 -0400)]
lib/config: move g_key_File_get_string before continue
In [1] Austin Ray reported some memory leaks in
notmuch_database_open. One of those leaks is caused by jumping to the
next key without freeing val. This change avoids that leak.
[1]: id:
20220105224538.m36lnjn7rf3ieonc@athena
David Bremner [Sun, 9 Jan 2022 14:38:03 +0000 (10:38 -0400)]
test: add known broken test for memory leaks in open
This duplicates the memory leaks reported in [1]
[1]: id:
20220105224538.m36lnjn7rf3ieonc@athena
David Bremner [Sun, 9 Jan 2022 14:38:02 +0000 (10:38 -0400)]
configure: check for ASAN support
This will allow conditionally running tests that use the address sanitizer.
David Bremner [Wed, 5 Jan 2022 01:06:06 +0000 (21:06 -0400)]
emacs: use --exclude=false when counting total messages
Even if a user excludes a large fraction of their messages, they still
nonetheless exist and are searchable.
David Bremner [Wed, 5 Jan 2022 01:06:05 +0000 (21:06 -0400)]
emacs: use --exclude=false when checking for empty searches
In particular tags that only occur on otherwise excluded messages do
not show up in "All tags" without this change. The reported numbers
_do_ take excludes into account, so it is possible that
searches (e.g. the aformentioned tags) will show up with a count of
zero.
David Bremner [Wed, 5 Jan 2022 01:06:04 +0000 (21:06 -0400)]
test/emacs: add known broken test for hidden tags
Gregor Zattler observed that tags could be unintentionally hidden in
the "All tags" view, and Tomi Ollia worked out [2] that the issue was tags
that only occured on excluded messages. This test reproduces that bug.
[1]: id:87wox1vovj.fsf@len.workgroup
[2]: id:m28t9faaim.fsf@guru.guru-group.fi
David Bremner [Wed, 19 Jan 2022 01:26:45 +0000 (21:26 -0400)]
CLI: print extra headers only for non-replies
If in the future we decide to output extra headers for replies, this
should be controlled by a separate configuration option.
David Bremner [Tue, 18 Jan 2022 13:39:05 +0000 (09:39 -0400)]
test/emacs: known broken test for reply with extra headers set.
Although it makes sense for the extra headers to be added to the copy
of the message headers included in the sexp/json, it is a bit
surprising for them to show in the new message constructed for the
reply, especially when, as here, they are always missing/empty.
David Bremner [Sat, 1 Jan 2022 12:01:36 +0000 (08:01 -0400)]
CLI: print extra headers in structured output
This is based on a patch from Johan Parin [1], which is in turn
responding to a bug report / feature requiest from Jan Malkhovski.
The update to the structured output documented in schemata is intended
to be upward compatible, so the format version stays the same
[1]: id:
20191116162723.18343-1-johan.parin@gmail.com
[2]: id:87h8sdemnr.fsf@oxij.org
David Bremner [Sat, 1 Jan 2022 12:01:35 +0000 (08:01 -0400)]
lib/config: add known config key "show.extra_headers"
Used in a following commit to enable including extra headers beyond
the default in structured output.
David Bremner [Sat, 1 Jan 2022 12:01:34 +0000 (08:01 -0400)]
CLI: stash pointer to database in sprinter structs
We already use an allocated (and presumably open) database as a talloc
context. Keeping the pointer in the allocated struct will allow us to
e.g. interrogate the configuration in a sprinter function without
threading the database all the way through the various levels of function.
David Bremner [Sat, 1 Jan 2022 12:47:16 +0000 (08:47 -0400)]
test: fix deprecation warning in symbol-test
Reduce the amount of noise in the build log.
David Bremner [Sun, 26 Dec 2021 12:24:10 +0000 (08:24 -0400)]
cli/new: only ignore .notmuch at top level
Since the bug was first reported in [1], notmuch has gained the
ability to have the database located outside the mail root, hence this
this change differs slightly from Jani's proposed solution [2] in not
using notmuch_database_get_path, but rather the already retrieved
mail_root.
[1]: id:87mwhifu9a.fsf@trouble.defaultvalue.org
[2]: id:87ios5v59p.fsf@nikula.org
David Bremner [Sun, 26 Dec 2021 12:24:09 +0000 (08:24 -0400)]
test: add known broken test for ignoring non-toplevel .notmuch
In [1] Rob observed that notmuch new ignored directories called
.notmuch everywhere in the tree, where they should only (and now, with
split configs, at most) be ignored at the top level. Add a test to
demonstrate the problem.
[1]: id:87mwhifu9a.fsf@trouble.defaultvalue.org
David Bremner [Sat, 25 Dec 2021 13:33:05 +0000 (09:33 -0400)]
lib/open: no default mail root in split configurations
If we know the configuration is split, but there is no mail root
defined, this indicates a (lack of) configuration error. Currently
this can only arise in XDG configurations.
David Bremner [Sat, 25 Dec 2021 13:33:04 +0000 (09:33 -0400)]
lib/config: make sure the config map exists when loading defaults
We should not rely on one of the other "_notmuch_config_load_*"
functions being called before this one.
David Bremner [Sat, 25 Dec 2021 13:33:03 +0000 (09:33 -0400)]
lib/open: use notmuch->params to track split status
Persisting this status will allow us to use the information in other
compilation units, in particular when setting configuration defaults.
David Bremner [Sat, 25 Dec 2021 13:33:02 +0000 (09:33 -0400)]
lib/open: use db struct as talloc ctx for choose_database_path
The extra talloc struct "local" was left over from before the notmuch
struct was allocated earlier. Having the notmuch struct available in
this function will allow more flexibility to track the configuration
variations (e.g. split vs. non-split).
David Bremner [Sat, 11 Dec 2021 12:49:12 +0000 (08:49 -0400)]
test/libconfig: add two tests for the config = "" case
If notmuch_database_open_with_config finds a database, but that
database is not in a legacy, non-split configuration, then it
currently incorrectly deduces the mail root and returns SUCCESS. Add
to two tests to demonstrate this bug.
David Bremner [Sat, 11 Dec 2021 12:49:11 +0000 (08:49 -0400)]
test/libconfig: save and restore config file
Currently the config file is unusable for further tests requiring a
valid database path.
LdBeth [Fri, 14 Jan 2022 13:15:00 +0000 (07:15 -0600)]
emacs/notmuch-tag.el: add xmlns attribute to svg icons
emacs-mac that compiled with OS X system API for image display
support cannot correctly render svg without xmlns parameter [1].
[1]: id:tencent_127AA231767438AC66FEE4DDB4BBF51DF909@qq.com
David Bremner [Wed, 12 Jan 2022 17:25:29 +0000 (13:25 -0400)]
Merge remote-tracking branch 'origin/release'
David Bremner [Tue, 11 Jan 2022 23:52:30 +0000 (19:52 -0400)]
test/gpgsm: use --with-colons when calculating fingerprint.
As stressed by the gpg documentation, the non-'with-colons' output
format is subject to change, and indeed it did in 2.3.x (x<=3). This
should make the the test suite more robust against such changes.
Michael J Gruber [Tue, 11 Jan 2022 10:13:34 +0000 (11:13 +0100)]
configure: Ignore more options that Fedora spec macros expect
Signed-off-by: Michael J Gruber <git@grubix.eu>
jao [Mon, 10 Jan 2022 03:05:23 +0000 (03:05 +0000)]
emacs: make header line in notmuch-show buffers optional
New notmuch-show-header-line customizable boolean to allow inhibiting
a header line in notmuch-show-mode buffers (for instance, because one
prefers to just include Subject in notmuch-message-headers).
David Bremner [Sun, 9 Jan 2022 23:34:58 +0000 (19:34 -0400)]
Merge tag '0.34.3'
notmuch 0.34.3 release
David Bremner [Sun, 9 Jan 2022 19:35:52 +0000 (15:35 -0400)]
doc: add 2022 to copyright years.
David Bremner [Sun, 9 Jan 2022 19:35:12 +0000 (15:35 -0400)]
version: bump to 0.34.3
David Bremner [Sun, 9 Jan 2022 19:31:03 +0000 (15:31 -0400)]
debian: changelog for 0.34.3-1
David Bremner [Sun, 9 Jan 2022 19:29:05 +0000 (15:29 -0400)]
NEWS: add NEWS for 0.34.3
David Bremner [Sat, 8 Jan 2022 21:21:43 +0000 (17:21 -0400)]
bindings/python-cffi: search for config by default
The previous (pre-0.34.2) constructor searched for a config file but
only if the database path was not specified, and only to retrieve
database.path. Neither of the available options (CONFIG.SEARCH or
CONFIG.NONE) matches this semantics exactly, but CONFIG.SEARCH causes
less breakage for people who relied on the old behaviour to set their
database.path [1]. Since it also seems like the friendlier option in
the long run, this commit switches to CONFIG.SEARCH as default.
This requires a certain amount of updating the pytest tests, but most
users will actually have a config file, unlike the test environment.
[1]: id:87fsqijx7u.fsf@metapensiero.it
David Bremner [Sun, 9 Jan 2022 13:20:56 +0000 (09:20 -0400)]
Merge branch 'release'
David Bremner [Sat, 8 Jan 2022 14:03:16 +0000 (10:03 -0400)]
python-cffi: returned OwnedMessage objects from Message.replies
If we return regular Message objects, python will try to destroy them,
and the underlying notmuch object, causing e.g. the crash [1].
[1]: id:87sfu6utxg.fsf@tethera.net
David Bremner [Sat, 8 Jan 2022 14:03:15 +0000 (10:03 -0400)]
test: add known broken tests for recursive traversal of replies.
This reproduces the bug reported at [1]. The second test hints at the
solution, making reply return OwnedMessage objects.
[1]: id:87sfu6utxg.fsf@tethera.net
Cédric Hannotier [Thu, 16 Dec 2021 17:40:53 +0000 (18:40 +0100)]
completion: use mail_root for path completion in bash/zsh
Since mail store and database directory can be different,
path and folder completions must use the directory given by
database.mail_root, not by database.path.
Cédric Hannotier [Thu, 16 Dec 2021 17:40:52 +0000 (18:40 +0100)]
doc: mail store is given by database.mail_root
The mail store directory is given by database.mail_root,
which can be different from database.path.
However, notmuch-insert documentation was still referencing the latter
as the provider of the maildir directory instead of the former.
David Bremner [Sat, 1 Jan 2022 14:36:43 +0000 (10:36 -0400)]
bindings/python-cffi: add matched property to message objects
Existing users of the legacy python bindings use
message.get_flags(Message.FLAG.MATCH) to determine which messages in a
thread matched. Since the bindings don't provide get_flags anymore,
they should provide a property analogous to the existing "excluded"
property.
David Bremner [Fri, 24 Dec 2021 18:29:05 +0000 (14:29 -0400)]
build: move {C,CXX}FLAGS to the end of FINAL_{C,CXX}FLAGS
In addition to avoiding problems with user specified include paths
picking up an installed version of notmuch.h, this should also enable
users to override more options (in particular they could override
warning options since the last one takes effect).
[1]: id:
7851CAB5-4556-4931-A0A2-
37003E56C927@ryandesign.com
David Bremner [Fri, 24 Dec 2021 18:29:04 +0000 (14:29 -0400)]
build: move CPPFLAGS after source directory includes.
In [1] Ryan Schmidt reported a problem on macports [2] with notmuch
finding an existing installed version of notmuch.h during the build.
This is a partial fix; the user might also specify -I in CFLAGS.
[1]: id:
7851CAB5-4556-4931-A0A2-
37003E56C927@ryandesign.com
[2]: The problem does not arise when notmuch.h is installed into a
"system" include path that the compiler searches by default.
David Bremner [Fri, 24 Dec 2021 18:29:03 +0000 (14:29 -0400)]
build: move LDFLAGS after notmuch libraries.
In [1] Ryan Schmidt reported a problem on macports [2] with notmuch
finding an existing installed version of libnotmuch during the build
when the user specified LDFLAGS including the libnotmuch install
directory.
This change should prevent that.
LDFLAGS also occurs in FINAL_LIBNOTMUCH_LDFLAGS. The only built
library linked to that is util/libtnotmuch_util.a, and that passed as
explicit (relative) path, and is thus not affected by -L.
[1]: id:
7851CAB5-4556-4931-A0A2-
37003E56C927@ryandesign.com
[2]: The problem does not arise when libnotmuch is installed into a
"system" library path that the compiler/linker searches by default.
David Bremner [Sat, 25 Dec 2021 23:31:12 +0000 (19:31 -0400)]
emacs: update coolj-line-prefix-regexp to make space optional
Jani reported that lines prefixed with '>' (as opposed to '> ') are
not highlighted properly [1]. David E responded with a updated regex
[2]. This change implements David E's suggestion.
[1]: id:87a8b5pcky.fsf@nikula.org
[2]: id:m2pok1e3gv.fsf@dme.org
David Bremner [Wed, 29 Dec 2021 18:20:49 +0000 (14:20 -0400)]
Merge branch 'release'
David Bremner [Thu, 23 Dec 2021 01:44:45 +0000 (21:44 -0400)]
configure: calculate NOTMUCH_BUILDDIR, write to Makefile.config
This will correct the current use of an undefined variable when
setting LD_LIBRARY_PATH in doc/Makefile.local
It is tempting to try to replace the use of test/export-dirs.sh, but
this is not as simple as it looks, as NOTMUCH_BUILDDIR is used to
locate sh.config, so probably cannot also sensibly be used to define
it.
David Bremner [Sat, 25 Dec 2021 21:22:56 +0000 (17:22 -0400)]
lib/open: do not consider .notmuch alone as an existing database.
It makes perfect sense for users to want to pre-create .notmuch,
e.g. to install hooks, so we should handle the case of a .notmuch
directory without an actual xapian database more gracefully.
David Bremner [Sat, 25 Dec 2021 21:22:55 +0000 (17:22 -0400)]
test/new: add known broken test for missing xapian directory.
`notmuch new' should go ahead and create the xapian database if it is
missing, even in the case where the parent .notmuch (or equivalent)
directory exists.
David Bremner [Sun, 26 Dec 2021 16:20:44 +0000 (12:20 -0400)]
test: test folder renames
In [1] Mark Walters reported a problem with messages being removed
from the database when the parent directory was renamed. Jani Nikula
proposed [2] these tests but observed
This test is not suitable for merging since it's not deterministic.
After applying Jani's patch [3], the tests now pass deterministically,
and could usefully act as regression tests.
[1]: id:87siray6th.fsf@qmul.ac.uk
[2]: id:
1393191650-28333-1-git-send-email-jani@nikula.org
[3]: id:
1441445731-4362-2-git-send-email-jani@nikula.org
David Bremner [Fri, 24 Dec 2021 16:20:31 +0000 (12:20 -0400)]
doc: add dep. on stamp file for rebuilding gzipped man pages.
In [1] Daniel observed that the gzipped man pages were only being
rebuild every second time when building with `make -j4'. This may be
caused by a race condition between sphinx-build rebuilding the roff
files and the recipe to gzip them. This commit sequentializes these
two steps by making the stamp file a prerequisite for (all of) the
gzip files.
[1]: id:87tveotn1g.fsf@fifthhorseman.net
David Bremner [Sun, 5 Dec 2021 13:56:03 +0000 (09:56 -0400)]
test: remove directory names from paths in exceptions
These cause failures when building out of tree.
Tomi Ollila [Tue, 21 Dec 2021 23:10:39 +0000 (01:10 +0200)]
emacs: add notmuch-logo.svg and use it in emacs mua on graphic displays
emacs/notmuch-logo.svg is handcrafted scalable vector graphics version
of the notmuch logo.
Emacs on graphic displays render this image four times in size compared
to the emacs/notmuch-logo.png, and the image is much sharper.
The rendered image size, 100x100 pixels, fits reasonably well with
text shown in various font sizes.
Scaling the image -- if desired -- may come in the future. For now
this is improvement on how the logo looked in notmuch-hello window.
David Bremner [Sat, 4 Dec 2021 23:47:51 +0000 (19:47 -0400)]
doc: introduce stamp file for info build
This partially fixes (i.e. just for sphinx) the problem reported by
Daniel in id:87r29wwgq2.fsf@fifthhorseman.net.
David Bremner [Sat, 4 Dec 2021 23:47:50 +0000 (19:47 -0400)]
doc: replace phony target with variable
Depending on a phony target seems like a good way to always trigger a
recipe.
Kyle Meyer [Sun, 5 Dec 2021 20:48:36 +0000 (15:48 -0500)]
emacs/tree: fix docstrings for author faces
The docstrings for notmuch-tree-match-author-face and
notmuch-tree-no-match-author-face incorrectly match the docstring of
notmuch-tree-match-date-face.
Tomi Ollila [Tue, 7 Dec 2021 19:11:41 +0000 (21:11 +0200)]
configure: have bash_absolute and perl_absolute always defined
Since set -u is used, without bash or perl, configure would fail.
This has gone unnoticed as (almost) everyone always had both
bash and perl installed (and in $PATH).
Thanks to FreeBSD ports this bug became visible; this change is
verbatim copy of `patch-configure` in FreeBSD ports tree.
David Bremner [Fri, 10 Dec 2021 22:53:57 +0000 (18:53 -0400)]
Merge tag 'debian/0.34.2-1'
notmuch release 0.34.2-1 for unstable (sid) [dgit]
[dgit distro=debian no-split --quilt=linear]
David Bremner [Fri, 10 Dec 2021 01:26:39 +0000 (21:26 -0400)]
debian: build only against default python version
This problem will will be solved in the next release of dh-python, but
the crude solution is needed for backports anyway.
David Bremner [Thu, 9 Dec 2021 12:54:15 +0000 (08:54 -0400)]
NEWS: mention fix for unprintable python exception
David Bremner [Thu, 9 Dec 2021 12:49:46 +0000 (08:49 -0400)]
debian: changelog for 0.34.2-1
David Bremner [Thu, 9 Dec 2021 12:47:15 +0000 (08:47 -0400)]
version: bump to 0.34.2
David Bremner [Thu, 9 Dec 2021 12:44:22 +0000 (08:44 -0400)]
NEWS: add NEWS for 0.34.2
David Bremner [Sun, 5 Dec 2021 14:40:07 +0000 (10:40 -0400)]
test/emacs: mark one test as fixed in newer emacs.
The remaining problem in this test is fixed upstream in Emacs
28. While most people are using earlier versions of emacs, the test
still provides some documentation of a known bug.
David Bremner [Sun, 31 Oct 2021 10:03:54 +0000 (07:03 -0300)]
python-cffi: fix out-of-tree build
The main idea is to replace the hack of copying version.txt into the
bindings source with a generated _notmuch_config.py file.
This will mean that the bindings only build after configuring and
building notmuch itself. Given those constraints, "pip install ."
should work.
David Bremner [Sun, 5 Dec 2021 13:02:50 +0000 (09:02 -0400)]
Merge branch 'release'
Floris Bruynooghe [Sat, 6 Nov 2021 11:02:37 +0000 (12:02 +0100)]
Fix error message when using notmuch_status_to_string
The python exception class was incorrectly loading the error message
which resulted in unprintable exception objects.
David Bremner [Sat, 30 Oct 2021 20:48:55 +0000 (17:48 -0300)]
python-cffi: introduce stamp file
Although the rebuild does not take long, it is a bit noisy, so assume
if it succeeds once, it doesn't need to re-invoke setup.py until the
shared library is rebuilt. This is a partial fix for [1].
[1]: id:87r29wwgq2.fsf@fifthhorseman.net
David Bremner [Sat, 30 Oct 2021 20:48:54 +0000 (17:48 -0300)]
ruby: don't use a directory as a target.
The directory is (neccesarily) not updated by the build, so it keeps
trying to build. The proposed fix is to use the name of the dynamic
library containing the extension. This is a partial fix for the
rebuilding reported at [1].
[1]: id:87r29wwgq2.fsf@fifthhorseman.net
David Bremner [Sat, 23 Oct 2021 17:05:24 +0000 (14:05 -0300)]
emacs: don't add space to tag completion candidates.
Apparently this messes up various third party completion
frameworks. This change does mean that users will have to hit space
after completing a tag change in order to enter another change.
As a bonus, remove the call to #'delete, since
completing-read-multiple already promises to remove empty strings.
David Bremner [Mon, 25 Oct 2021 01:15:15 +0000 (22:15 -0300)]
test/new: replace use of gdb in vanishing file test
Unlike the similar change in T060-new, no symlink creation is needed
here.
David Bremner [Mon, 25 Oct 2021 01:15:14 +0000 (22:15 -0300)]
test/count: replace use of gdb with a LD_PRELOAD shim
There is a certain amount of boilerplate to pass the call on the
original function, so abstract it out as a C preprocessor macro, plus
some extra includes in notmuch-test.h
David Bremner [Thu, 28 Oct 2021 12:32:34 +0000 (09:32 -0300)]
test: move system includes to notmuch-test.h
This removes some redudant includes, and will also make it easier to
introduce "#define _GNU_SOURCE", which must come before all system
includes.
David Bremner [Thu, 30 Sep 2021 18:59:54 +0000 (15:59 -0300)]
lib/config: use g_key_file_get_string to read config values
Unlike the previous g_key_file_get_value, this version processes
escape codes for whitespace and \. The remaining two broken tests from
the last commit are because "notmuch config get" treats every value as
a list, and thus the previously introduces stripping of leading
whitespace applies.
David Bremner [Thu, 30 Sep 2021 18:28:34 +0000 (15:28 -0300)]
test: known broken tests for escape characters in config files.
glib generates the following escape characters with their usual
meanings: \n, \t, \r, and \\, along with \s for _leading_
spaces. Currently notmuch fails to unescape these on reading the
config files. These tests demonstrate this bug; the one new test that
passes is because apparently glib only escapes tabs at the beginning
of a key.
David Bremner [Thu, 30 Sep 2021 17:17:48 +0000 (14:17 -0300)]
config: ignore leading/trailing spaces in ';'-delimited lists
In [1] Ciprian observed that it was easy for users to mistakenly
introduce leading and trailing space to new.tags when editing a
notmuch config file. This commit strips spaces on either side of the
';' delimiter when splitting.
In principle it would be possible to support tags (or other config
values) with leading or trailing spaces by processing '\s' escapes in
the input string. Currently such processing is not done.
[1]: id:CA+Tk8fzjPLaEd3vL1f9ebk_bF_RV8PDTLzDupraTkCLCpJAmCg@mail.gmail.com
David Bremner [Thu, 30 Sep 2021 17:17:47 +0000 (14:17 -0300)]
test: known broken tests for leading/trailing ws in config
These tests duplicate the bug/misfeature reported in
id:CA+Tk8fzjPLaEd3vL1f9ebk_bF_RV8PDTLzDupraTkCLCpJAmCg@mail.gmail.com
David Bremner [Mon, 13 Sep 2021 01:03:50 +0000 (22:03 -0300)]
emacs: run notmuch-search-hook lazily
In message id:YT3ueuZHKW931NW3@localhost, Fabio Natali isolated a
visual glitch caused by running notmuch-search-hook too early. This
change moves the running of that hook to
notmuch-search-process-filter, which ensures there is some output in
the buffer before running the hook. Since n-s-p-f can be called many
times for a given buffer, add a buffer local flag to make sure it is
only run once per buffer.
David Bremner [Sat, 4 Dec 2021 13:27:30 +0000 (09:27 -0400)]
Merge branch 'release'
David Bremner [Sat, 30 Oct 2021 16:22:35 +0000 (13:22 -0300)]
python-cffi: switch to notmuch_database_{open,create}_with_config
Since release 0.32, libnotmuch provides searching for database and
configuration paths. This commit changes the python module notmuch2 to
use those facilities.
This fixes the bug reported in [1], along with a couple of the
deprecation warnings in the python bindings.
Database.default_path is deprecated, since it no longer faithfully
reflects what libnotmuch is doing, and it is also no longer used in
the bindings themselves.
This commit choose the default of config=CONFIG.EMPTY (equivalent to
passing "" to notmuch_database_open_with_config). This makes the
change upward compatible API-wise (at least as far as the test suite
verifies), but changing the default to CONFIG.SEARCH would probably be
more convenient for bindings users.
[1]: id:87h7d4wp6b.fsf@tethera.net
David Bremner [Sat, 30 Oct 2021 16:22:34 +0000 (13:22 -0300)]
test: add known broken tests for python bindings in split configs
This reproduces the bug(s) reported in id:87h7d4wp6b.fsf@tethera.net
David Bremner [Sat, 30 Oct 2021 16:22:33 +0000 (13:22 -0300)]
test: add python-cffi bindings to path for test_python
This will allow testing the new python bindings using test_python, in
addition to the current invocation of pytest.
David Bremner [Sat, 30 Oct 2021 16:22:32 +0000 (13:22 -0300)]
python-cffi: fix typos in docstring for Database.default_path
These generate warnings from sphinx doc, which makes it harder to
debug documentation changes. They also corrupt the output.
David Bremner [Thu, 28 Oct 2021 01:34:19 +0000 (22:34 -0300)]
lib/config: don't overwrite database.path if the caller passed it
If the user passed a path, and we opened it, then we consider that
definitive definition of "database.path". This makes libnotmuch
respond more gracefully to certain erroneous combinations of
NOTMUCH_CONFIG settings and config file contents.
David Bremner [Thu, 28 Oct 2021 01:34:18 +0000 (22:34 -0300)]
lib/open: track which parameters are passed
This will be used to fine tune the loading of configuration for
certain special configuration items (initially just "database.path").
David Bremner [Thu, 28 Oct 2021 01:34:17 +0000 (22:34 -0300)]
test: add known broken test for conflict with database parameter
This is arguably user error: having configuration file with bad
settings in it (and/or having a bad NOTMUCH_CONFIG environment
variable). On the other hand returning a different path than was
actually opened is definitely a bug.
David Bremner [Sat, 4 Dec 2021 00:47:05 +0000 (20:47 -0400)]
test/libconfig: use 'export' for remaining sets of NOTMUCH_CONFIG
It makes the tests easier to understand if we always use export for
environment variables.
David Bremner [Sat, 30 Oct 2021 18:58:16 +0000 (15:58 -0300)]
emacs: drop C-tab binding in hello mode, document <backtab>.
The <backtab> binding has always been there, but the docs were
apparently mistakenly changed to say <backspace> [1]
Revert to <backtab> in the documentation.
The commit also drops the C-<tab> binding, since it seems redundant
and it interferes with tab-bar-mode.
[1]:
703dec7754da477b5683867c88cb940b8553be91.
David Bremner [Fri, 29 Oct 2021 14:54:59 +0000 (11:54 -0300)]
doc/python-cffi: import from built bindings, not installed module
Previously the python-cffi bindings either failed to build, or built
for the wrong module by using the installed module.
The fix requires correction the module path, building the bindings
before docs, and helping python find the built libnotmuch.
Based on patch / discussion from Micheal Gruber [1]
[1]: id:cover.
1634808719.git.git@grubix.eu
David Bremner [Sat, 30 Oct 2021 18:49:20 +0000 (15:49 -0300)]
rename built_with.sexpr_query to built_with.sexp_queries
It is confusing to use two different names (sexp vs sexpr) when
compared with the command line option --query=sexp and (furthermore)
singular vs plural when compared with the man page title.