unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Leo <git@relevant-information.com>
To: notmuch@notmuchmail.org
Cc: Leo Okawa Ericson <git@relevant-information.com>
Subject: [PATCH 0/1] emacs: Make notmuch-show-next-thread return nil on failure
Date: Thu, 28 Apr 2022 12:12:17 +0200	[thread overview]
Message-ID: <20220428101217.23844-1-git@relevant-information.com> (raw)

From: Leo Okawa Ericson <git@relevant-information.com>

Hello,

First some context on why I personally want this change.  I am
developing a package that allows users to interact with notmuch in a
specific way.  In particular, I need to know when
notmuch-show-next-thread succeeds or fails (there are no more messages
for this query).  See [1] for how I'm currently using notmuch.

I've implemented that change in this patch.  I've tested it manually,
but didn't understand how to make the test I wrote to work properly, so
I haven't included that in the patch.

Here is a basic test I tried to write in test/T450-emacs-show.sh, but
the first "assert" fails.

> test_begin_subtest "notmuch-search-show-thread returns non-nil on success"
> test_emacs_expect_t  '(notmuch-search "id:20091117203301.GV3165@dottiness.seas.harvard.edu")
> 	(unless (notmuch-search-show-thread)
>           (error "Expected non-nil when successfully showing a thread"))
> 	(when (notmuch-show-next-thread)
>         (error "Expected nil when there are no more threads"))
> t'


[1] https://git.sr.ht/~zetagon/el-secretario/tree/ab0572477ab2bdb2364256dd884555b052705659/item/el-secretario-notmuch.el#L109


Leo Okawa Ericson (1):
  emacs: Make notmuch-show-next-thread return nil on failure

 emacs/notmuch.el | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)


base-commit: e3ad0087f3453c89871acac8b11da8bab1ac54df
-- 
2.36.0

             reply	other threads:[~2022-04-28 12:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-28 10:12 Leo [this message]
2022-04-28 10:12 ` [PATCH 1/1] emacs: Make notmuch-show-next-thread return nil on failure Leo
2022-04-29 13:59   ` Tomi Ollila
2022-04-29 16:39     ` Leo Okawa Ericson
2022-04-30 16:18       ` David Bremner
2022-04-30 16:41   ` David Bremner
2022-05-02 16:50     ` Leo Okawa Ericson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220428101217.23844-1-git@relevant-information.com \
    --to=git@relevant-information.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).