]> git.notmuchmail.org Git - notmuch/commit
emacs: Add new option notmuch-search-hide-excluded master
authorMohsin Kaleem <mohkale@kisara.moe>
Sun, 10 Mar 2024 18:57:41 +0000 (18:57 +0000)
committerDavid Bremner <david@tethera.net>
Sat, 6 Apr 2024 18:03:45 +0000 (15:03 -0300)
commitcd89065dc36e36b22a2a53832d2cac9b06fba41c
treea3d2bf48a7d9b647bea2b5d6be1c3ab7d91936af
parentde234097048c82be74dfb8ec265ac03704308a90
emacs: Add new option notmuch-search-hide-excluded

The new notmuch-search-hide-excluded option allows users to configure whether
to show or hide excluded messages (as determined by search.exclude_tags
in the local notmuch config file). It defaults to true for now to maintain
backwards-compatibility with how notmuch-{search,tree} already worked.

New commands notmuch-search-toggle-hide-excluded and
notmuch-tree-toggle-exclude have also been added. They toggle the value
of notmuch-search-hide-excluded for the search in the current search or
tree buffer. It's bound to "i" in the respective keymaps for these
modes.

Lastly I've amended some calls to notmuch-tree and notmuch-unthreaded
which didn't pass through the buffer local value of
notmuch-search-oldest-first (and now notmuch-search-exclude).
Examples of where I've done this include:
  + notmuch-jump-search
  + notmuch-tree-from-search-current-query
  + notmuch-unthreaded-from-search-current-query
  + notmuch-tree-from-search-thread

A new test file for Emacs has been added which covers the usage of the
new `notmuch-search-hide-excluded' option and interactively hiding or
showing mail with excluded tags. These test cover the basic usage of
the `notmuch-search-toggle-hide-excluded' command in notmuch-search,
notmuch-tree and notmuch-unthreaded searches. These tests also cover
the persistence of the current value of the hide-excluded mail option
as a user switches from between these different search commands.

[1]: id:87ilxlxsng.fsf@kisara.moe

Amended-by: db, fix indentation in T461-emacs-search-exclude.sh
17 files changed:
devel/emacs-keybindings.org
doc/notmuch-emacs.rst
emacs/notmuch-hello.el
emacs/notmuch-jump.el
emacs/notmuch-lib.el
emacs/notmuch-tree.el
emacs/notmuch.el
test/T310-emacs.sh
test/T460-emacs-tree.sh
test/T461-emacs-search-exclude.sh [new file with mode: 0755]
test/emacs-exclude.expected-output/notmuch-search-tag-inbox-with-excluded [new file with mode: 0644]
test/emacs-exclude.expected-output/notmuch-search-tag-inbox-without-excluded [new file with mode: 0644]
test/emacs-exclude.expected-output/notmuch-tree-tag-inbox-with-excluded [new file with mode: 0644]
test/emacs-exclude.expected-output/notmuch-tree-tag-inbox-without-excluded [new file with mode: 0644]
test/emacs-exclude.expected-output/notmuch-unthreaded-tag-inbox-with-excluded [new file with mode: 0644]
test/emacs-exclude.expected-output/notmuch-unthreaded-tag-inbox-without-excluded [new file with mode: 0644]
test/emacs-tree.expected-output/notmuch-tree-tag-inbox-oldest-first [new file with mode: 0644]