Commit graph

7066 commits

Author SHA1 Message Date
David Bremner
8908779999 doc: drop note about early versions of Xapian
Mathias Beyer [1] points out that this note is redudant since Xapian
no longer builds with the problematic versions of Xapian.

[1]: id:20210207124404.yldgtzjrsagacrl4@hoshi
2021-08-03 19:29:34 -03:00
Felipe Contreras
7415b53fa5 ruby: split database close and destroy
Mirrors the C API: 7864350c (Split notmuch_database_close into two
functions, 2012-04-25).

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-08-02 13:49:29 -03:00
Simon Branch
e8fa42a97a cli: remove extraneous space in message 2021-07-30 10:05:44 -03:00
Jonas Bernoulli
b649b0c871 emacs: notmuch-tree: mark the initial message at point as read
When moving between message in a tree or show buffer, the message at
point is marked as read.  Likewise when creating such a buffer, then
the message that is initially at point is supposed to be marked as
read as well.

The latter worked for `notmuch-show' but not for `notmuch-tree'.
Press "RET" or "M-RET" in a search buffer to observe these behaviors.

In both cases the marking is supposed to be done by the function
`notmuch-show-command-hook'.  In the case of `notmuch-show' that
function is added directly to `post-command-hook'.

`notmuch-tree' instead adds the function `notmuch-tree-command-hook'
to `post-command-hook' and that calls `notmuch-show-command-hook',
in the respective show buffer, but of course only if that exists.

Because the tree buffer is created asynchronously, the show buffer
doesn't exist yet by the time the `post-command-hook' is run, so
we have to explicitly run `notmuch-tree-command-hook' once the
show buffer exists.

The show buffer is created when `notmuch-tree-goto-and-insert-msg'
calls `notmuch-tree-show-message-in'.  `notmuch-tree-process-filter'
is what finally brings us here.
2021-07-25 15:15:33 -03:00
David Bremner
bed62eb8be emacs: remove useless lexically bound variable
A let binding without a value is just an obfuscated way of saying
nil, especially if you are not going to mutate the variable.
2021-07-19 08:32:49 -03:00
Felipe Contreras
1a7f9fe055 ruby: enable garbage collection using talloc
We basically steal all the objects from their notmuch parents, therefore
they are completely under Ruby's gc control.

The order at which these objects are freed does not matter any more,
because destroying the database does not destroy all the children
objects, since they belong to Ruby now.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-07-18 17:08:53 -03:00
Felipe Contreras
02b1621160 ruby: create an actual wrapper struct
Currently Ruby data points directly to a notmuch object (e.g.
notmuch_database_t), since we don't need any extra data that is fine.

However, in the next commit we will need extra data, therefore we create
a new struct notmuch_rb_object_t wrapper which contains nothing but a
pointer to the current pointer (e.g. notmuch_database_t).

This struct is tied to the Ruby object, and is freed when the Ruby
object is freed by the garbage collector.

We do nothing with this wrapper, so no functionality should be changed.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-07-18 17:08:42 -03:00
Felipe Contreras
02cf4a50bb perf-test: add ruby test
Simply list the message-id of all the messages in a loop 100 times.

Suggested-by: David Bremner <david@tethera.net>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
2021-07-18 16:50:27 -03:00
David Bremner
d8a5fba4fe emacs: update declaration of notmuch-tree
This fixes an a warning from the byte-compiler.  The commit
74ab62a340 changed the function
signature but did not update the declaration.
2021-07-13 09:55:00 -03:00
David Bremner
04f378e673 emacs: fix typo in variable name
This error crept in during my style rewrite of dkg's proposed change.
2021-07-06 22:25:57 -03:00
David Bremner
dd91621d80 replace references to freenode with references to libera
I left the reference to freenode in the test suite data, since it is
historical.
2021-07-06 17:20:03 -03:00
jao
32f42581e3 doc: new notmuch show --sort and related emacs commands
New --sort CLI option documented in notmuch-show's man page, and
notmuch-search-toggle-order mentioned in doc/notmuch-emacs.rst and
devel/emacs-keybindings.org (in the latter, there's also some
whitespace changes in a table introduced by org-mode).
2021-07-03 20:38:34 -03:00
jao
e333debbd8 emacs/tree: command to toggle search sort order in tree mode
New command notmuch-tree-toggle-order for switching the sort order (by
reissuing the search with a different flag) in a notmuch-tree buffer.
2021-07-03 20:36:37 -03:00
jao
74ab62a340 emacs/hello: honouring :sort-order in threaded queries
Now that notmuch show accepts --sort, we can, on the emacs side, use
it according to the value of :sort-order in the definition of saved
queries.
2021-07-03 20:28:48 -03:00
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