Re: [PATCH 1/1] emacs: Make notmuch-show-next-thread return nil on failure

Subject: Re: [PATCH 1/1] emacs: Make notmuch-show-next-thread return nil on failure

Date: Mon, 02 May 2022 18:50:10 +0200

To: notmuch@notmuchmail.org

Cc:

From: Leo Okawa Ericson


David Bremner <david@tethera.net> writes:

> Leo <git@relevant-information.com> writes:
>
>> From: Leo Okawa Ericson <git@relevant-information.com>
>>
>> Having notmuch-show-next-thread return non-nil on success and nil on
>> failure makes it easier for users to interact with notmuch via elisp.
>
> You talk about notmuch-show-next-thread, but you seem to be modifying
> notmuch-search-show-thread. That actually seems like a bit of a strange
> function to invoke programatically, since it deduces the argument from
> the current buffer.  It might be better for your code to call
> notmuch-show directly, since notmuch-search-show-thread is pretty tied
> to the internals of notmuch-search-mode.
>

I mentioned this in the reroll of the patch, but I modified
notmuch-search-show-thread because the return value of
notmuch-show-next-thread depends on it.  In case this is an XY
problem[1], what I want is the ability to go through each email in the
search buffer (like notmuch-show-next-thread does), and when there are
no more messages left I want to call a function.  Changing
notmuch-search-show-thread (and thereby notmuch-show-next-thread),
seemed to be the least intrusive way to do it.

[1] https://en.wikipedia.org/wiki/XY_problem

/Leo
_______________________________________________
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-leave@notmuchmail.org

Thread: