From dea40c9dd68c14756c5a4ab108fe0597f2e6da2e Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sat, 15 Mar 2025 06:55:51 -0300 Subject: [PATCH 01/16] version: bump to 0.39 Identical to 0.39~rc3, except for release related documentation (e.g. NEWS). --- version.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.txt b/version.txt index edb4df4e..751b1ea0 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.39~rc3 +0.39 -- 2.45.2 From 8fdb713d2facc25bfb075f9152e9ff1d7ae39b48 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sat, 15 Mar 2025 07:04:26 -0300 Subject: [PATCH 02/16] debian: changelog stanza for 0.39-1 --- debian/changelog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/debian/changelog b/debian/changelog index b84bfed6..45c08461 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +notmuch (0.39-1) unstable; urgency=medium + + * New upstream release. + * Legacy python bindings (package python3-notmuch) are no longer + built. Consider switching to python3-notmuch2. + + -- David Bremner Sat, 15 Mar 2025 07:03:50 -0300 + notmuch (0.39~rc3-1) experimental; urgency=medium * New upstream pre-release -- 2.45.2 From a5214eabb63ba78b84f4563942de1aa8763f0914 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sat, 15 Mar 2025 19:04:35 -0300 Subject: [PATCH 03/16] NEWS: set release date --- NEWS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 2cac8151..0d284b11 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -Notmuch 0.39 (UNRELEASED) +Notmuch 0.39 (2025-03-15) ========================= General -- 2.45.2 From 14f7a8929abedc465e30e8ec77c1bea72db35d9d Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sat, 15 Mar 2025 19:45:14 -0300 Subject: [PATCH 04/16] debian: drop patches Those changes are now directly in git. --- debian/patches/debian-changes | 29 ----------------------------- debian/patches/series | 1 - 2 files changed, 30 deletions(-) delete mode 100644 debian/patches/debian-changes delete mode 100644 debian/patches/series diff --git a/debian/patches/debian-changes b/debian/patches/debian-changes deleted file mode 100644 index 44e5e3eb..00000000 --- a/debian/patches/debian-changes +++ /dev/null @@ -1,29 +0,0 @@ -Description: Autogenerated patch header for a single-debian-patch file. - The delta against upstream is either kept as a single patch, or maintained - in some VCS, and exported as a single patch instead of more manageable - atomic patches. -Forwarded: not-needed - ---- ---- notmuch-0.38.3.orig/test/T350-crypto.sh -+++ notmuch-0.38.3/test/T350-crypto.sh -@@ -453,6 +453,7 @@ y - | gpg --no-tty --quiet --import - output=$(notmuch show --format=json --verify subject:"test signed message 001" \ - | notmuch_json_show_sanitize \ -+ | sed -e 's/"key-\(revoked\|missing\)"/"key-revoked"/g' \ - | sed -e 's|"created": [1234567890]*|"created": 946728000|') - expected='[[[{"id": "XXXXX", - "match": true, ---- notmuch-0.38.3.orig/test/test-lib.el -+++ notmuch-0.38.3/test/test-lib.el -@@ -33,6 +33,9 @@ - - (require 'cl-lib) - -+;; Use old pretty print algorithm, so tests don't break with Emacs 30 -+(setq-default pp-default-function 'pp-28) -+ - ;; Ensure that the dynamic variables that are defined by this library - ;; are defined by the time that we let-bind them. This is needed - ;; because starting with Emacs 27 undeclared variables in evaluated diff --git a/debian/patches/series b/debian/patches/series deleted file mode 100644 index 7bb82529..00000000 --- a/debian/patches/series +++ /dev/null @@ -1 +0,0 @@ -debian-changes -- 2.45.2 From eaf3cd10db95b366c960a4f87e4a513dc9488e7f Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sat, 22 Feb 2025 13:42:49 -0400 Subject: [PATCH 05/16] doc/python: correct wording around container complexity. Based on a suggestion from Jakub Wilk. --- bindings/python-cffi/notmuch2/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bindings/python-cffi/notmuch2/__init__.py b/bindings/python-cffi/notmuch2/__init__.py index f281edc1..b1cd21c1 100644 --- a/bindings/python-cffi/notmuch2/__init__.py +++ b/bindings/python-cffi/notmuch2/__init__.py @@ -37,9 +37,9 @@ In these python bindings they have sometimes been exposed as like :class:`collections.abc.Set` or :class:`collections.abc.Mapping` etc. This gives a more natural API to work with, e.g. being able to treat tags as sets. However it does mean that the -:meth:`__contains__`, :meth:`__len__` and frieds methods on these are -usually more and essentially O(n) rather than O(1) as you might -usually expect from Python containers. +:meth:`__contains__`, :meth:`__len__` and similar methods on these are +usually more expensive and essentially O(n) rather than O(1) as you might +expect from Python containers. """ from notmuch2 import _capi -- 2.45.2 From d5ab2f0c02da4415e8775847ebc01559c9652e4c Mon Sep 17 00:00:00 2001 From: "len@realtimegenomics.com" Date: Tue, 18 Mar 2025 05:23:40 +0000 Subject: [PATCH 06/16] emacs: fix disabling notmuch-show-header-line via custom The defcustom had a typo that prevented it from working as intended. --- emacs/notmuch-show.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 8a8e6a7b..19b51753 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -104,7 +104,7 @@ notmuch-show functions such as Finally, if this variable is set to nil, no header is displayed." - :type '(choice (const :tag "No header" ni) + :type '(choice (const :tag "No header" nil) (const :tag "Subject" t) (string :tag "Format") (function :tag "Function")) -- 2.45.2 From d8ebc9cf80b6d10e72a01d7b0afa42aab6b31264 Mon Sep 17 00:00:00 2001 From: Jakub Wilk Date: Mon, 24 Mar 2025 08:55:42 +0100 Subject: [PATCH 07/16] python: make IndexOptions public Database docstrings refer to IndexOptions, so the latter should be public too. --- bindings/python-cffi/notmuch2/_database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python-cffi/notmuch2/_database.py b/bindings/python-cffi/notmuch2/_database.py index d7485b4d..d2671fdf 100644 --- a/bindings/python-cffi/notmuch2/_database.py +++ b/bindings/python-cffi/notmuch2/_database.py @@ -15,7 +15,7 @@ import notmuch2._query as querymod import notmuch2._tags as tags -__all__ = ['Database', 'AtomicContext', 'DbRevision'] +__all__ = ['Database', 'AtomicContext', 'DbRevision', 'IndexOptions'] def _config_pathname(): -- 2.45.2 From babacbd1b188004b388033cf20662eda51965365 Mon Sep 17 00:00:00 2001 From: Jakub Wilk Date: Wed, 19 Mar 2025 20:28:31 +0100 Subject: [PATCH 08/16] bindings/python-cffi: fix typos --- bindings/python-cffi/notmuch2/__init__.py | 2 +- bindings/python-cffi/notmuch2/_base.py | 4 ++-- bindings/python-cffi/notmuch2/_config.py | 2 +- bindings/python-cffi/notmuch2/_database.py | 4 ++-- bindings/python-cffi/notmuch2/_message.py | 10 +++++----- bindings/python-cffi/notmuch2/_tags.py | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/bindings/python-cffi/notmuch2/__init__.py b/bindings/python-cffi/notmuch2/__init__.py index b1cd21c1..978e01c2 100644 --- a/bindings/python-cffi/notmuch2/__init__.py +++ b/bindings/python-cffi/notmuch2/__init__.py @@ -22,7 +22,7 @@ Libnotmuch uses a hierarchical memory allocator, this means all objects have a strict parent-child relationship and when the parent is freed all the children are freed as well. This has some implications for these Python bindings as parent objects need to be kept alive. -This is normally schielded entirely from the user however and the +This is normally shielded entirely from the user however and the Python objects automatically make sure the right references are kept alive. It is however the reason the :class:`BaseObject` exists as it defines the API all Python objects need to implement to work diff --git a/bindings/python-cffi/notmuch2/_base.py b/bindings/python-cffi/notmuch2/_base.py index c83abd01..1b0b5b7e 100644 --- a/bindings/python-cffi/notmuch2/_base.py +++ b/bindings/python-cffi/notmuch2/_base.py @@ -28,7 +28,7 @@ class NotmuchObject(metaclass=abc.ABCMeta): However during some peculiar situations, e.g. interpreter shutdown, it is possible for the :meth:`__del__` method to have - been called, whele there are still references to an object. This + been called, while there are still references to an object. This could result in child objects asking their memory to be freed after the parent has already freed the memory, making things rather unhappy as double frees are not taken lightly in C. To @@ -174,7 +174,7 @@ class NotmuchIter(NotmuchObject, collections.abc.Iterator): :type parent: NotmuchObject :param iter_p: The CFFI pointer to the C iterator. :type iter_p: cffi.cdata - :param fn_destory: The CFFI notmuch_*_destroy function. + :param fn_destroy: The CFFI notmuch_*_destroy function. :param fn_valid: The CFFI notmuch_*_valid function. :param fn_get: The CFFI notmuch_*_get function. :param fn_next: The CFFI notmuch_*_move_to_next function. diff --git a/bindings/python-cffi/notmuch2/_config.py b/bindings/python-cffi/notmuch2/_config.py index 603fdcbf..4df03bd0 100644 --- a/bindings/python-cffi/notmuch2/_config.py +++ b/bindings/python-cffi/notmuch2/_config.py @@ -35,7 +35,7 @@ class ConfigIter(base.NotmuchIter): class ConfigMapping(base.NotmuchObject, collections.abc.MutableMapping): """The config key/value pairs loaded from the database, config file, - and and/or defaults. + and/or defaults. The entries are exposed as a :class:`collections.abc.MutableMapping` object. Note that setting a value to an empty string is the same as deleting it. diff --git a/bindings/python-cffi/notmuch2/_database.py b/bindings/python-cffi/notmuch2/_database.py index d2671fdf..f1451bf1 100644 --- a/bindings/python-cffi/notmuch2/_database.py +++ b/bindings/python-cffi/notmuch2/_database.py @@ -351,7 +351,7 @@ class Database(base.NotmuchObject): The returned context manager can be used to perform atomic operations on the database. - .. note:: Unlinke a traditional RDBMS transaction this does + .. note:: Unlike a traditional RDBMS transaction this does not imply durability, it only ensures the changes are performed atomically. @@ -416,7 +416,7 @@ class Database(base.NotmuchObject): :raises XapianError: A Xapian exception occurred. :raises FileError: The file referred to by ``pathname`` could not be opened. - :raises FileNotEmailError: The file referreed to by + :raises FileNotEmailError: The file referred to by ``pathname`` is not recognised as an email message. :raises ReadOnlyDatabaseError: The database is opened in READ_ONLY mode. diff --git a/bindings/python-cffi/notmuch2/_message.py b/bindings/python-cffi/notmuch2/_message.py index 7bd20331..79485238 100644 --- a/bindings/python-cffi/notmuch2/_message.py +++ b/bindings/python-cffi/notmuch2/_message.py @@ -344,7 +344,7 @@ class Message(base.NotmuchObject): Instead the map has an additional :meth:`PropertiesMap.getall` method which can be used to retrieve all properties of a given - key. This method also allows iterating of a a subset of the + key. This method also allows iterating of a subset of the keys starting with a given prefix. """ try: @@ -428,7 +428,7 @@ class PropertiesMap(base.NotmuchObject, collections.abc.MutableMapping): """A mutable mapping to manage properties. Both keys and values of properties are supposed to be UTF-8 - strings in libnotmuch. However since the uderlying API uses + strings in libnotmuch. However since the underlying API uses bytestrings you can use either str or bytes to represent keys and all returned keys and values use :class:`BinString`. @@ -486,7 +486,7 @@ class PropertiesMap(base.NotmuchObject, collections.abc.MutableMapping): return len(list(it)) def __getitem__(self, key): - """Return **the first** peroperty associated with a key.""" + """Return **the first** property associated with a key.""" if isinstance(key, str): key = key.encode('utf-8') value_pp = capi.ffi.new('char**') @@ -509,7 +509,7 @@ class PropertiesMap(base.NotmuchObject, collections.abc.MutableMapping): """Return a :class:`collections.abc.ItemsView` for this map. The ItemsView treats a ``(key, value)`` pair as unique, so - dupcliate ``(key, value)`` pairs will be merged together. + duplicate ``(key, value)`` pairs will be merged together. However duplicate keys with different values will be returned. """ items = set() @@ -524,7 +524,7 @@ class PropertiesMap(base.NotmuchObject, collections.abc.MutableMapping): return PropertiesItemsView(items) def values(self): - """Return a :class:`collecions.abc.ValuesView` for this map. + """Return a :class:`collections.abc.ValuesView` for this map. All unique property values are included in the view. """ diff --git a/bindings/python-cffi/notmuch2/_tags.py b/bindings/python-cffi/notmuch2/_tags.py index ee5d2a34..28528831 100644 --- a/bindings/python-cffi/notmuch2/_tags.py +++ b/bindings/python-cffi/notmuch2/_tags.py @@ -69,7 +69,7 @@ class ImmutableTagSet(base.NotmuchObject, collections.abc.Set): return self.iter(encoding='utf-8', errors='ignore') def iter(self, *, encoding=None, errors='strict'): - """Aternate iterator constructor controlling string decoding. + """Alternate iterator constructor controlling string decoding. Tags are stored as bytes in the notmuch database, in Python it's easier to work with unicode strings and thus is what the @@ -87,7 +87,7 @@ class ImmutableTagSet(base.NotmuchObject, collections.abc.Set): """ # self._cffi_fn should point either to # notmuch_database_get_all_tags, notmuch_thread_get_tags or - # notmuch_message_get_tags. nothmuch.h suggests these never + # notmuch_message_get_tags. notmuch.h suggests these never # fail, let's handle NULL anyway. tags_p = self._cffi_fn(self._ptr()) if tags_p == capi.ffi.NULL: @@ -155,7 +155,7 @@ class MutableTagSet(ImmutableTagSet, collections.abc.MutableSet): Tags are bytestrings and calling ``iter()`` will return an iterator yielding bytestrings. However the :meth:`iter` method can be used to return tags as unicode strings, while all other - operations accept either byestrings or unicode strings. In case + operations accept either bytestrings or unicode strings. In case unicode strings are used they will be encoded using utf-8 before being passed to notmuch. """ -- 2.45.2 From 63665f1ebd6eff7753b7798add657fd6dbd110d6 Mon Sep 17 00:00:00 2001 From: jonah Date: Sun, 1 Jun 2025 15:41:37 +0000 Subject: [PATCH 09/16] emacs/search: call notmuch-search-mode before popping to buffer This makes derived-mode matching in display-buffer-alist work. --- emacs/notmuch.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 29b2a9ed..69aff347 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -1091,10 +1091,10 @@ the configured default sort order." (let* ((query (or query (notmuch-read-query "Notmuch search: "))) (buffer (get-buffer-create (notmuch-search-buffer-title query)))) - (if no-display - (set-buffer buffer) - (pop-to-buffer-same-window buffer)) + (set-buffer buffer) (notmuch-search-mode) + (unless no-display + (pop-to-buffer-same-window buffer)) ;; Don't track undo information for this buffer (setq buffer-undo-list t) (setq notmuch-search-query-string query) -- 2.45.2 From 5f199e89c7e3f061f1c6403ac77fbacf564ecf85 Mon Sep 17 00:00:00 2001 From: Michael J Gruber Date: Fri, 20 Jun 2025 16:51:39 +0200 Subject: [PATCH 10/16] test: do not add legacy bindings to PYTHONPATH d526797a ("python: move legacy python bindings to contrib.", 2025-02-15) moved the legacy python bindings away from the location in `bindingss/`. Do not add that location to the PYTHONPATH since it is obsolete. --- test/test-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test-lib.sh b/test/test-lib.sh index 059e110c..5b3cd454 100644 --- a/test/test-lib.sh +++ b/test/test-lib.sh @@ -896,7 +896,7 @@ test_done () { test_python () { # Note: if there is need to print debug information from python program, # use stdout = os.fdopen(6, 'w') or stderr = os.fdopen(7, 'w') - PYTHONPATH="$NOTMUCH_BUILDDIR/bindings/python-cffi/build/stage:$NOTMUCH_SRCDIR/bindings/python${PYTHONPATH:+:$PYTHONPATH}" \ + PYTHONPATH="$NOTMUCH_BUILDDIR/bindings/python-cffi/build/stage${PYTHONPATH:+:$PYTHONPATH}" \ $NOTMUCH_PYTHON -B - > OUTPUT } -- 2.45.2 From 848e7ae6700ffeda9615584868f8207f9f71d394 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Wed, 14 Aug 2024 08:25:22 -0300 Subject: [PATCH 11/16] doc/emacs: start a section on notmuch-message-mode This is mostly just copying docstrings, but putting them into sections makes them more discoverable. --- doc/conf.py | 2 +- doc/notmuch-emacs.rst | 57 ++++++++++++++++++++++++++++++++++++------- 2 files changed, 49 insertions(+), 10 deletions(-) diff --git a/doc/conf.py b/doc/conf.py index 9cbcb432..1cc9961e 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -47,7 +47,7 @@ if tags.has('WITH_EMACS'): # Hacky reimplementation of include to workaround limitations of # sphinx-doc lines = ['.. include:: /../emacs/rstdoc.rsti\n\n'] # in the source tree - for file in ('notmuch.rsti', 'notmuch-lib.rsti', 'notmuch-hello.rsti', 'notmuch-show.rsti', 'notmuch-tag.rsti', 'notmuch-tree.rsti'): + for file in ('notmuch.rsti', 'notmuch-lib.rsti', 'notmuch-hello.rsti', 'notmuch-show.rsti', 'notmuch-tag.rsti', 'notmuch-tree.rsti', 'notmuch-maildir-fcc.rsti'): lines.extend(open(rsti_dir+'/'+file)) rst_epilog = ''.join(lines) del lines diff --git a/doc/notmuch-emacs.rst b/doc/notmuch-emacs.rst index 91af6d14..48f87458 100644 --- a/doc/notmuch-emacs.rst +++ b/doc/notmuch-emacs.rst @@ -671,6 +671,54 @@ Keybindings are the same as :any:`notmuch-tree`. See also :el:defcustom:`notmuch-search-result-format` and :el:defcustom:`notmuch-tree-result-format`. +notmuch-message +=============== + +Notmuch uses a slighly customized version of the standard emacs email +composition mode info:message. + +.. _notmuch-emacs-drafts: + +Drafts +------ + +.. el:define-key:: C-x C-p + M-x notmuch-draft-postpone + + Postpone (save and bury) a draft. + +.. el:define-key:: C-x C-s + M-x notmuch-draft-save + + Save a draft and continue editing. + +.. _notmuch-emacs-replies: + +.. _notmuch-emacs-fcc: + +Fcc +--- + +.. el:defcustom:: notmuch-fcc-dirs + + |docstring::notmuch-fcc-dirs| + +.. el:defcustom:: notmuch-maildir-use-notmuch-insert + + |docstring::notmuch-maildir-use-notmuch-insert| + +Replies +------- + +.. el:defcustom:: message-dont-reply-to-names + + When composing mail replies, Emacs's message mode uses the + variable :code:`message-dont-reply-to-names` to exclude + recipients matching a given collection of regular expressions + or satisfying an arbitrary predicate. Notmuch's MUA inherits + this standard mechanism and will honour your customization of + this variable. + Global key bindings =================== @@ -770,15 +818,6 @@ Sending Mail :code:`compose-mail`. To use ``notmuch`` for this, customize this variable to the symbol :code:`notmuch-user-agent`. -.. el:defcustom:: message-dont-reply-to-names - - When composing mail replies, Emacs's message mode uses the - variable :code:`message-dont-reply-to-names` to exclude - recipients matching a given collection of regular expressions - or satisfying an arbitrary predicate. Notmuch's MUA inherits - this standard mechanism and will honour your customization of - this variable. - Init File --------- -- 2.45.2 From 93539fa5ca54676a41398fb154dabe414795f628 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Wed, 14 Aug 2024 08:25:23 -0300 Subject: [PATCH 12/16] doc/emacs: refactor navigation commands The amount of space saved here is minimal, but I want to migrate to a more topic focused manual, as opposed to long alphabetical lists of commands. --- doc/notmuch-emacs.rst | 52 ++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 28 deletions(-) diff --git a/doc/notmuch-emacs.rst b/doc/notmuch-emacs.rst index 48f87458..bf862697 100644 --- a/doc/notmuch-emacs.rst +++ b/doc/notmuch-emacs.rst @@ -320,6 +320,27 @@ pressing RET after positioning the cursor on a hidden part. :ref:`show-copy` +.. el:define-key:: + + - + + Add or remove arbitrary tags from the current message. + +.. el:define-key:: ! + + |docstring::notmuch-show-toggle-elide-non-matching| + +.. el:define-key:: ? + + Display full set of key bindings + +.. _show-navigation: + +Navigation +---------- + +The following motion/navigation bindings are also available in +:ref:`notmuch-tree` and :ref:`notmuch-unthreaded`. + .. el:define-key:: N Move to next message @@ -336,18 +357,9 @@ pressing RET after positioning the cursor on a hidden part. Move to previous matching message -.. el:define-key:: + - - - - Add or remove arbitrary tags from the current message. - -.. el:define-key:: ! - - |docstring::notmuch-show-toggle-elide-non-matching| -.. el:define-key:: ? - - Display full set of key bindings +Configuration +------------- Display of messages can be controlled by the following variables; see also :ref:`show-large`. @@ -522,7 +534,7 @@ notmuch-tree ``notmuch-tree-mode`` displays the results of a "notmuch tree" of your email archives. Each line in the buffer represents a single message giving the relative date, the author, subject, and any -tags. +tags. For common navigation commands see :ref:`show-navigation`. .. el:define-key:: c @@ -532,22 +544,6 @@ tags. Displays that message. -.. el:define-key:: N - - Move to next message - -.. el:define-key:: P - - Move to previous message - -.. el:define-key:: n - - Move to next matching message - -.. el:define-key:: p - - Move to previous matching message - .. el:define-key:: o M-x notmuch-tree-toggle-order -- 2.45.2 From 9745ece67c7634a97be0d8ead1755e8280d822c5 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Wed, 14 Aug 2024 08:25:24 -0300 Subject: [PATCH 13/16] doc/emacs: update keybindings list for 'e' The mention of notmuch-tree-button-activate seems to have been an error / obsolete. --- devel/emacs-keybindings.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devel/emacs-keybindings.org b/devel/emacs-keybindings.org index d8b443e6..ac98cb66 100644 --- a/devel/emacs-keybindings.org +++ b/devel/emacs-keybindings.org @@ -5,7 +5,7 @@ | b | notmuch-search-scroll-down | notmuch-show-resend-message | notmuch-show-resend-message | | c | notmuch-search-stash-map | notmuch-show-stash-map | notmuch-show-stash-map | | d | | | | -| e | | | (notmuch-tree-button-activate) | +| e | | notmuch-show-resume-message | notmuch-tree-resume-message | | f | | notmuch-show-forward-message | notmuch-show-forward-message | | g | | | | | h | | notmuch-show-toggle-visibility-headers | | -- 2.45.2 From 3af10307d954f2e3ca69322748288edf967e3704 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Wed, 14 Aug 2024 08:25:25 -0300 Subject: [PATCH 14/16] doc/emacs: start subsection on message level actions In particular this gives a place for documenting how to resume editing drafts. --- doc/notmuch-emacs.rst | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/doc/notmuch-emacs.rst b/doc/notmuch-emacs.rst index bf862697..9c2dab47 100644 --- a/doc/notmuch-emacs.rst +++ b/doc/notmuch-emacs.rst @@ -357,6 +357,42 @@ The following motion/navigation bindings are also available in Move to previous matching message +Actions +------- + +The following actions on messages are also available in +:ref:`notmuch-tree` and :ref:`notmuch-unthreaded`. + +.. el:define-key:: b + M-x notmuch-show-resend-message + + Resend (*bounce*) message. + +.. el:define-key:: e + + Resume *editing* a message in :ref:`notmuch-message`. This is + particularly useful for :ref:`notmuch-emacs-drafts`, but can be + used for other messages as well. + +.. el:define-key:: f + M-x notmuch-show-forward-message + + Forward (as a MIME attachment) message + +.. el:define-key:: r + M-x notmuch-show-reply-to-sender + + Reply to sender (only) using :ref:`notmuch-message` + +.. el:define-key:: w + M-x notmuch-show-save-attachments + + |docstring::notmuch-show-save-attachments| + +.. el:define-key:: R + M-x notmuch-show-reply + + |docstring::notmuch-show-reply| Configuration ------------- @@ -667,6 +703,8 @@ Keybindings are the same as :any:`notmuch-tree`. See also :el:defcustom:`notmuch-search-result-format` and :el:defcustom:`notmuch-tree-result-format`. +.. _notmuch-message: + notmuch-message =============== -- 2.45.2 From 59d83bf958ef0b0c4811274ad928723b0f69112e Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 22 Jun 2025 16:32:21 -0300 Subject: [PATCH 15/16] python/doc: fix link to notmuch-config manpage This docstring has been like this a long time, but recently I noticed sphinx-doc complaining about :man:. This :any: link seems to work, and is consistent with the other links to the notmuch-config man page. --- bindings/python-cffi/notmuch2/_database.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bindings/python-cffi/notmuch2/_database.py b/bindings/python-cffi/notmuch2/_database.py index f1451bf1..c13d9fcf 100644 --- a/bindings/python-cffi/notmuch2/_database.py +++ b/bindings/python-cffi/notmuch2/_database.py @@ -833,7 +833,7 @@ class IndexOptions(base.NotmuchObject): """The decryption policy. This is an enum from the :class:`DecryptionPolicy`. See the - `index.decrypt` section in :man:`notmuch-config` for details + `index.decrypt` section in :any:`notmuch-config(1)` for details on the options. **Do not set this to :attr:`DecryptionPolicy.TRUE`** without considering the security of your index. -- 2.45.2 From 4547ae5aa8fc7fd5d05da801c9fa9c055d39636f Mon Sep 17 00:00:00 2001 From: Anton Khirnov Date: Sat, 5 Jul 2025 17:18:16 +0200 Subject: [PATCH 16/16] test: add another known broken test for uncaught DatabaseModifiedError This one is raised from _notmuch_message_create(). See also https://github.com/pazz/alot/issues/1460#issuecomment-2994101019 --- test/T641-database-modified-messages.sh | 83 +++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100755 test/T641-database-modified-messages.sh diff --git a/test/T641-database-modified-messages.sh b/test/T641-database-modified-messages.sh new file mode 100755 index 00000000..200a950d --- /dev/null +++ b/test/T641-database-modified-messages.sh @@ -0,0 +1,83 @@ +#!/usr/bin/env bash +test_description="handling DatabaseModifiedError from _notmuch_message_create" +. $(dirname "$0")/test-lib.sh || exit 1 + +# Triggering this exception is slightly magical. We need to +# - first create a query, and from it a messages iterator +# - then modify the database "enough"; it's not totally clear how much is +# enough, but adding the LKML corpus emails and doing some light tagging +# seems to work +# - finally, iterate through the messages iterator, which should trigger the +# DatabaseModifiedError exception + +# add default corpus for the initial query +add_email_corpus +# As per above, copy LKML corpus email files, but do not add them to the DB yet. +cp -a $NOTMUCH_SRCDIR/test/corpora/lkml ${MAIL_DIR}/ + +test_begin_subtest "catching DatabaseModifiedError in _notmuch_message_create" +test_subtest_known_broken + +test_C ${MAIL_DIR} < + +int +main (int argc, char **argv) +{ + const char *path = argv[1]; + + notmuch_database_t *rw_db, *ro_db; + notmuch_messages_t *messages_ro, *messages_rw; + notmuch_query_t *query_ro, *query_rw; + char* msg = NULL; + + EXPECT0 (notmuch_database_open_with_config (argv[1], + NOTMUCH_DATABASE_MODE_READ_ONLY, + "", NULL, &ro_db, &msg)); + if (msg) fputs (msg, stderr); + assert (ro_db); + + query_ro = notmuch_query_create (ro_db, ""); + assert (query_ro); + + EXPECT0 (notmuch_query_search_messages (query_ro, &messages_ro)); + + // index the previously copied LKML corpus files + EXPECT0 (system ("notmuch new --quiet")); + + EXPECT0 (notmuch_database_open_with_config (argv[1], + NOTMUCH_DATABASE_MODE_READ_WRITE, + "", NULL, &rw_db, &msg)); + if (msg) fputs (msg, stderr); + + query_rw = notmuch_query_create (rw_db, ""); + EXPECT0 (notmuch_query_search_messages (query_rw, &messages_rw)); + + for (; + notmuch_messages_valid (messages_rw); + notmuch_messages_move_to_next (messages_rw)) { + notmuch_message_t *message = notmuch_messages_get (messages_rw); + EXPECT0 (notmuch_message_add_tag (message, "tag")); + } + + notmuch_database_close (rw_db); + + for (; + notmuch_messages_valid (messages_ro); + notmuch_messages_move_to_next (messages_ro)) { + notmuch_message_t *message = notmuch_messages_get (messages_ro); + } + + printf ("SUCCESS\n"); + return 0; +} +EOF + +cat <<'EOF' >EXPECTED +== stdout == +SUCCESS +== stderr == +EOF +test_expect_equal_file EXPECTED OUTPUT + +test_done -- 2.45.2