emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Sean Whitton <spwhitton-PEZ64Ft4C9UnzZ6mRAm98g@public.gmane.org>
To: racin-GANU6spQydw@public.gmane.org
Cc: notmuch <notmuch-gxuj+Tv9EO5zyzON3hdc1g@public.gmane.org>,
	emacs-orgmode <emacs-orgmode-mXXj517/zsQ@public.gmane.org>
Subject: Re: Bug: ol-notmuch.el: calls `notmuch-show' with arbitrary search query
Date: Tue, 26 Nov 2019 14:52:37 -0700	[thread overview]
Message-ID: <87tv6q1f16.fsf@iris.silentflame.com> (raw)
In-Reply-To: <1630223474.433436589.1574795847430.JavaMail.zimbra-GANU6spQydw@public.gmane.org>

Hello,

On Tue 26 Nov 2019 at 08:17PM +01, racin-GANU6spQydw@public.gmane.org wrote:

> Your approach probably works most of the time, but I don't like the idea
> of having to perform 2 queries when one should be enough.
>
> I think a better approach would be to change notmuch-show (or add a
> new version) that would allow taking arbitrary queries (and
> especially, message ids) as input. This probably used to be the case.
>
> Note that the command line notmuch show function does accept arbitrary
> search terms as an argument
>
> I think updating notmuch-show to compute the thread id from the query
> (instead of assuming that the input is a thread id) would be the best
> way to go, but you should see that with the notmuch developers.

I agree with you that it would be best if `notmuch-show' were extended
to accept arbitrary notmuch queries instead of only thread IDs.

However, I also believe that ol-notmuch.el should be updated in the
meantime.  notmuch.el presently exposes an API, `notmuch-show', which
takes a thread ID.  ol-notmuch.el is misusing that API by passing in a
value of a different type -- a notmuch query rather than a thread ID.

That's a bug: even if an API is more limited than we would like it to
be, we should use it in the way that it is documented to be used by its
developers.

This misuse of the API causes numerous other hard-to-diagnose bugs.  For
example, if you use `org-notmuch-follow-link' to open an Org-mode link
like "notmuch:id:foo-o+HKXD+gRuM@public.gmane.org", the standard notmuch command
`notmuch-show-filter-thread' doesn't work.  And if you use `C-u c i` to
yank the thread ID for pasting into a shell, say, you will yank a value
which is not a thread ID.

-- 
Sean Whitton

  parent reply	other threads:[~2019-11-26 21:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21 21:37 Bug: ol-notmuch.el: calls `notmuch-show' with arbitrary search query Sean Whitton
     [not found] ` <87h82wrjvb.fsf-TDhmT+1V6bdypu2/aTzxt1aTQe2KTcn/@public.gmane.org>
2019-11-26 17:41   ` Sean Whitton
2019-11-26 19:17     ` racin
     [not found]       ` <1630223474.433436589.1574795847430.JavaMail.zimbra-GANU6spQydw@public.gmane.org>
2019-11-26 21:52         ` Sean Whitton [this message]
2019-11-26 20:05   ` David Edmondson
     [not found]     ` <m24kyq9ze8.fsf-zDQXUQW/Few@public.gmane.org>
2019-11-26 21:57       ` Sean Whitton
     [not found]         ` <87r21u1et3.fsf-TDhmT+1V6bdypu2/aTzxt1aTQe2KTcn/@public.gmane.org>
2019-11-26 22:52           ` David Edmondson
     [not found]             ` <m2zhgi8d2x.fsf-zDQXUQW/Few@public.gmane.org>
2019-11-26 23:25               ` Sean Whitton
     [not found]                 ` <875zj61aqe.fsf-TDhmT+1V6bdypu2/aTzxt1aTQe2KTcn/@public.gmane.org>
2019-11-27 13:08                   ` David Edmondson

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://www.orgmode.org/

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

  git send-email \
    --in-reply-to=87tv6q1f16.fsf@iris.silentflame.com \
    --to=spwhitton-pez64ft4c9unzz6mram98g@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.org \
    --cc=notmuch-gxuj+Tv9EO5zyzON3hdc1g@public.gmane.org \
    --cc=racin-GANU6spQydw@public.gmane.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://git.savannah.gnu.org/cgit/emacs/org-mode.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).