Commit graph

7002 commits

Author SHA1 Message Date
jao
13d49b8e16 CLI/show: tests for the new --sort option
New unit tests for notmuch show --sort, covering the basic use cases.
2021-07-03 20:27:39 -03:00
jao
8316fc3ca1 CLI/show: accept --sort
Add the command-line option --sort to the show command of the CLI
notmuch interface, with the same possible values as the same option in
notmuch search.
2021-07-03 20:27:33 -03:00
Michael J Gruber
1768b0c416 test: deduplicate T590
Test numbers are a concise way to communicate about tests and to remeber
them. Currently, there is one pait of duplicates:

T590-libconfig.sh
T590-thread-breakage.sh

Renumber the latter one to 592 since this keeps the alphabetic order and
leaves room in between.

Signed-off-by: Michael J Gruber <git@grubix.eu>
2021-06-29 13:43:24 -03:00
David Bremner
b6cfc8a61c debian: document new build-dependency 2021-06-28 22:48:29 -03:00
David Bremner
7b6f1b0f08 Commit Debian 3.0 (quilt) metadata
[dgit (9.13) quilt-fixup]
2021-06-28 22:44:24 -03:00
David Bremner
fef433f307 debian: add xapian-tools for tests
xapian-metadata is used by some of the new tests.

(cherry picked from commit 9f8458a998)
2021-06-28 22:23:13 -03:00
David Bremner
3f102654c6 debian/changelog: refinalize for upload 2021-06-28 22:09:54 -03:00
David Bremner
37f84d6d21 emacs/tree use notmuch-show-single-message
This is more efficient than notmuch-show-only-matching-messages, since
we do not parse the potentially large thread structure to find a
single message.

This is only a partial fix for notmuch-tree view, because displaying
the thread structure in the tree-mode window still crashes on long
threads. It is however enough to make unthreaded view handle long
threads.
2021-06-27 14:41:23 -03:00
David Bremner
563b2a0032 emacs/show: add parameter notmuch-show-single-message
This dynamically bound variable can be set when the caller of
notmuch-show guarantees that exactly one message will match the
query. It avoids transporting and parsing the complete thread
structure.
2021-06-27 14:37:45 -03:00
David Bremner
14326e6cb7 test: start test file for emacs unthreaded view.
Initial focus is on behaviour with large threads.

The second test replicates a bug reported by Alan Schmitt in
id:87lf7sojbq.fsf@m4x.org.
2021-06-27 14:29:08 -03:00
edef
fb4b45062f emacs: remap send-message and send-message-and-exit
All three of C-c C-c, <menu-bar> <Message> <Send Message>,
and <tool-bar> <Send Message> are bound to message-send-and-exit by
message.el, but notmuch-mua.el only had an explicit override for the
keyboard binding. This mostly manifests as confusing Fcc behaviour for
GUI users.

Patching the bindings for specific keys is rather brittle, since it has
to be aware of every relevant binding. This change switches to instead
using a remap binding, which turns any binding for message-send or
message-send-and-exit into a binding for the corresponding notmuch-mua
command.
2021-06-27 14:22:35 -03:00
Felipe Contreras
814abafc3e ruby: add keyword arguments to db.query
That way we don't need pass them to the query object ourselves.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-06-27 14:13:03 -03:00
David Bremner
6e7365fb20 lib: update transaction documentation
Partly this is to recognize the semantics we inherit from Xapian,
partly to mention the new autocommit feature.
2021-06-27 14:06:30 -03:00
David Bremner
42b5cb53ef doc: document database.autocommit variable
This exposes some database internals that most users will probably not
understand.
2021-06-27 14:04:43 -03:00
David Bremner
e2a3e5fa51 lib: autocommit after some number of completed transactions
This change addresses two known issues with large sets of changes to
the database.  The first is that as reported by Steven Allen [1],
notmuch commits are not "flushed" when they complete, which means that
if there is an open transaction when the database closes (or e.g. the
program crashes) then all changes since the last commit will be
discarded (nothing is irrecoverably lost for "notmuch new", as the
indexing process just restarts next time it is run).  This does not
really "fix" the issue reported in [1]; that seems rather difficult
given how transactions work in Xapian. On the other hand, with the
default settings, this should mean one only loses less than a minutes
worth of work.  The second issue is the occasionally reported "storm"
of disk writes when notmuch finishes. I don't yet have a test for
this, but I think committing as we go should reduce the amount of work
when finalizing the database.

[1]: id:20151025210215.GA3754@stebalien.com
2021-06-27 14:03:00 -03:00
David Bremner
8aabddb043 test: add known broken test for closing with open transaction
The expected output may need adjusting, but what is clear is that
saving none of the changes is not desirable.
2021-06-27 14:01:26 -03:00
David Bremner
2f608d2a94 lib/config: add NOTMUCH_CONFIG_AUTOCOMMIT
This will be used to control how often atomic transactions are
committed.
2021-06-27 13:59:42 -03:00
David Bremner
65f923219e database/close: remove misleading code / comment
Unfortunately, it doesn't make a difference if we call
cancel_transaction or not, all uncommited changes are discarded if
there is an open (unflushed) transaction.
2021-06-27 13:58:17 -03:00
David Bremner
49893c2c61 lib/database: fix style mistake.
The spacing of the declaration was wrong in ea30110.
2021-06-27 13:52:43 -03:00
Protesilaos Stavrou
5cc106b0e3 emacs: use new face for notmuch-jump and related
The minibuffer-prompt face that was used before made it impossible to
differentiate between two distinct UI elements: (i) the prompt's text
which itself cannot be acted upon, (ii) the actionable keys used to
jump to searches/tags.

The use of a named face, notmuch-jump-key, makes it possible for users
or theme developers to apply properties that are specific to each of
those two cases.

In the interest of backward compatibility, the new face inherits from
minibuffer-prompt.
2021-06-27 12:28:54 -03:00
David Bremner
d21e72c9f9 notmuch 0.32.2 release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEkiyHYXwaY0SiY6fqA0U5G1WqFSEFAmDYa+AACgkQA0U5G1Wq
 FSHDpA/+JAZc5RIBs7joGQTBGdiXbTw9dt0LFrnUr1AdckfMje+T5n9H56QFKFHN
 upzSL0S4JtPyW6Up1GhJFZhZxZgRYOj42UbFAuJTCwD+CMhZY5EtRdAi28vug6Vc
 9XtvD+uLE/ogP8X3x7yJtK4aMBQeDwMjvEi5yjO734oOaWYZpjEkbPxMol0T8gJq
 TBhFzrVfUBI5yNX1tRqPOPR+nn/v9/AJVFHvQNRyNEaPewxU761cRF/gtQsFZPkG
 4a5pN6sKTSmMvhiEffJbCtGrEhd+BEI8+pnIZwqlH1bj9bdea/68g48ruh0sicPj
 NP7CRkOH6TwEASGrzi7eMsGv6k1F3INeIawLXN3DP/lJQ5z6Q9cq2WY7vR4a6fyj
 gYWEeepS4dYwH/+hgXRLQ/1HTDbh8Ikm87cGm8cWC3KNSwlPxTGQEueP1kj5DkXa
 ruSXrvM/pIR6CyeBxWZ+/p55SBnH6Rd426mE4b5oHYQvanFu3zxrRcy4bFI4KnzT
 qMGHQ9nxeBTpKP18864HwU1ji4iIjWbWHKXE1cC/Y1UFKXqndh4tk9OvAA9qM8H2
 yBDq+PTyzOyApQBytosn7n5gHg90DlrynnUsNP6v3V/eSB6Z+DsI7UP7uOullul0
 2q+EiId/B8gBrHRKODIPeV5l0Vhgi2eIm0MDlikv0ReR3RRt/DU=
 =1AuX
 -----END PGP SIGNATURE-----

Merge tag '0.32.2'

notmuch 0.32.2 release
2021-06-27 09:34:00 -03:00
David Bremner
af56f3bcdc NEWS: finalize for 0.32.2 2021-06-27 08:56:21 -03:00
David Bremner
dd5cd14476 changelog for 0.31.4-2 2021-06-26 22:44:36 -03:00
David Bremner
dab32dc70c lib/n_d_index_file: re-use thread-id of existing message
This prevents the message document getting multiple thread-id terms
when there are multiple files with the same message-id.

This change shifts some thread ids, requiring adjustments to other tests.

(cherry picked from commit 3f4de98e7c)
2021-06-26 22:39:07 -03:00
David Bremner
41873f3505 debian: changelog for 0.32.2-1 2021-06-26 22:34:30 -03:00
David Bremner
0740ee69fb NEWS: mention fix for memory leak. 2021-06-26 22:26:09 -03:00
Daniel Kahn Gillmor
29d43b7f44 emacs: Prefer email address over User ID when showing valid signature
Most concrete verification steps are likely only taken on the e-mail
address in the first place, and e-mail addresses render more
intelligibly than arbitrary User IDs in the first place.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Amended-by: db, apply dme restructuring suggestions.
2021-06-26 13:34:54 -03:00
Daniel Kahn Gillmor
8c29a5da09 cli/show: produce "email" element in sigstatus
When the certificate that signs a message is known to be valid, GMime
is capable of reporting on the e-mail address embedded in the
certificate.

We pass this information along to the caller of "notmuch show", as
often only the e-mail address of the certificate has actually been
checked/verified.

Furthermore, signature verification should probably at some point
compare the e-mail address of the caller against the sender address of
the message itself.  Having to parse what gmime thinks is a "userid"
to extract an e-mail address seems clunky and unnecessary if gmime
already thinks it knows what the e-mail address is.

See id:878s41ax6t.fsf@fifthhorseman.net for more motivation and discussion.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2021-06-26 13:07:47 -03:00
David Bremner
4b0c6fb2f1 Merge branch 'release' 2021-06-25 09:34:29 -03:00
David Bremner
ea301102ab lib: write talloc report in notmuch_database_destroy
Since most memory allocation is (ultimately) in the talloc context
defined by a notmuch_database_t pointer, this gives a more complete
view of memory still allocated at program shutdown.

We also change the talloc report in notmuch.c to mode "a" to avoid
clobbering the newly reported log.
2021-06-25 09:20:37 -03:00
David Bremner
35d559eb18 lib/config: fix memory leak
This commit fixes a small memory leak (per iterator restart) by
actually using the talloc context intended to be blown away on
restart.
2021-06-25 09:13:04 -03:00
David Bremner
636e03a9ca version: bump to 0.32.2 2021-06-25 09:02:54 -03:00
Ori
2c96956b3b emacs: Add compatibility for org-msg.el
Enable `notmuch-company` with `org-msg`, which does not derive from
`message-mode` in composing. This change was first proposed in the
discussion here:
https://github.com/jeremy-compostella/org-msg/issues/53
2021-06-24 17:26:43 -03:00
David Bremner
5be9e024d1 doc: tweak hook configuration documentation.
Add a historical note, and hint to look below for more about hooks.
Capitalized the heading for consistency, removed blank line.
2021-06-23 08:42:48 -03:00
David Bremner
7406abf5e0 test/libconfig: make indexing more consistent
The other tests have converted to two digit decimal, the commit does
the same to the remaining test that was printing out indices in hex.
2021-06-21 06:57:17 -03:00
David Bremner
8dbd5deb8d Merge branch 'release' 2021-06-20 17:15:20 -03:00
David Bremner
86818626b3 NEWS: fix typo
Oops. Apparently our release checks do not check the spelling of
UNRELEASED (although Tomi's wiki conversion script does).
2021-06-20 16:59:30 -03:00
David Bremner
ce0fa835d3 NEWS: start NEWS for 0.32.2 2021-06-20 16:41:03 -03:00
David Bremner
dda50ede05 emacs: require seq for seq-some
Although the function dates from 2015, the autoload is newer. In
particular [1] it is not found in Emacs 25.3.

[1]: id:874ke85tqx.fsf@cgc-instruments.com
2021-06-08 20:12:33 -03:00
David Bremner
a19d2b0d2b test: check openssl prequisite for add_gpgsm_home
This is a fix for the test failures reported by Dan Čermák [1].

It is more robust to check for the prerequisite inside the function
that uses it, rather than in every test file that calls the function.

[1]: id:87k0n4fqgm.fsf@tethera.net
2021-06-08 17:15:46 -03:00
Tomi Ollila
6f0f83660e test: aggregate-results updates
notmuch-test will now call aggregate-results.sh with file list
that it compiles based on the test ran, and aggregate-results
will report failure is any of the test files are missing.

With this notmuch-test no longer has to exit in non-parallel
run if some test fail to write its report file -- so it works
as parallel tests in this sense.

Changed test_done() in test-lib.sh write report file in one write(2),
so there is (even) less chance it being partially written. Also,
now it writes 'total' last and aggregate-results.sh expects this
line to exist in all report files for reporting to be successful.

Added 'set -eu' to notmuch-test and modified code to work with
these settings. That makes it harder to get mistakes slipped
into committed code.
2021-06-07 20:16:33 -03:00
David Bremner
651a1b085b lib/message: use passed database for error handling
'message' should always be initialized if we reach here, but in case it
is not, we still want to be able to log an error message.
2021-06-05 15:41:28 -03:00
David Bremner
b0a11dbc38 lib/{open,message}: make some internal functions static
They are not used outside their file, so being extern seems like an oversight
2021-06-05 15:40:00 -03:00
Jani Nikula
87234a8ef3 emacs: update default mailing list archives for stashing links
Gmane web interface is long gone, remove it. Make MARC the new
default. Update LKML to Lore, where it already redirects anyway. Also
add Notmuch web archive.
2021-06-05 15:39:53 -03:00
David Bremner
2c85cc29bd test: add known broken test for indexing RFC822 group names
Austin Clements diagnosed this indexing problem in [1].

[1]: id:20130711215207.GR2214@mit.edu
2021-06-05 15:31:03 -03:00
Tomi Ollila
03366a3c5a emacs: fix declare-function definitions with related line breaks
- declare-function notmuch-unthreaded lacked file name
- declare-function notmuch-search had differently named last arg
  - note: check-declare-directory did not complain about that
- declare-function notmuch-search-show-thread without nil
- some functions declared to be in different file than those
  existed ("notmuch" -> "notmuch-lib")

- some related function/declare lines were (/are now) wider than
  80-columns; added line breaks (and proper indentation) there
2021-06-05 08:24:51 -03:00
David Bremner
d7ddfa0d0e emacs: drop setting mail-user-agent, and document how to set it
After some discussion [1], I decided it is better to make notmuch users
who rely on this behaviour customize mail-user-agent. This is
consistent with the behaviour of other emacs mail packages.

[1]: id:87k0nuhfrk.fsf@toryanderson.com
2021-06-04 20:05:31 -03:00
Tomi Ollila
572af27950 test: source $NOTMUCH_SRCDIR/test/test-lib-emacs.sh
Sourcing test-lib.sh will cd to TMP_DIRECTORY, so
relative path in $0 will not work in previous version
 . $(dirname "$0")/test-lib-emacs.sh

Now individual test scripts -- e.g. ./test/T310-emacs.sh
will work.
2021-06-03 09:29:27 -03:00
David Bremner
100106a45d Merge remote-tracking branch 'origin/release' 2021-05-31 20:26:31 -03:00
Daniel Kahn Gillmor
0478c0e077 NEWS/emacs: document changes in 0.32 that affect keybindings.
See list discussion in thread starting with
id:87h7ip2baq.fsf@fifthhorseman.net for more details.

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
Amended-by: David Bremner (s/.emacs/Emacs configuration/)
2021-05-31 20:25:23 -03:00