Gnus development mailing list
 help / color / mirror / Atom feed
* getting article numbers from message-ids?
@ 2014-06-02  8:15 Eric Abrahamsen
  2014-06-02 15:13 ` Eric Abrahamsen
  2014-09-24 21:12 ` Ted Zlatanov
  0 siblings, 2 replies; 6+ messages in thread
From: Eric Abrahamsen @ 2014-06-02  8:15 UTC (permalink / raw)
  To: ding

I'm starting with a list of org-gnus links, and trying to create an
ephemeral group (via nnir) displaying those messages. I think
everything's working, except that what I've got is each message's
Message-ID, and nnir wants article numbers:

Incoming: "nnimap+Server:group-name#A9ED-1B41EF8FC63E@example-server.fr"

Outgoing: ["group-name" ARTICLE_NUMBER 100]

I could, for each message link, use org-gnus-open to actually visit the
message in its home group and get the article with
`gnus-summary-article-number', but I'm hoping there's a more direct way.

These message could be coming from any backend -- I can't know for sure
if they'll be imap, or maildir, or what have you.

Can the registry be used to save information like this? It would be nice
to look first in the registry, which I assume would be quickest, and
then fall back to something more manual and expensive.

Anyway, any tips would be much appreciated!

Eric




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: getting article numbers from message-ids?
  2014-06-02  8:15 getting article numbers from message-ids? Eric Abrahamsen
@ 2014-06-02 15:13 ` Eric Abrahamsen
  2014-09-24 21:12 ` Ted Zlatanov
  1 sibling, 0 replies; 6+ messages in thread
From: Eric Abrahamsen @ 2014-06-02 15:13 UTC (permalink / raw)
  To: ding

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> I'm starting with a list of org-gnus links, and trying to create an
> ephemeral group (via nnir) displaying those messages. I think
> everything's working, except that what I've got is each message's
> Message-ID, and nnir wants article numbers:
>
> Incoming: "nnimap+Server:group-name#A9ED-1B41EF8FC63E@example-server.fr"
>
> Outgoing: ["group-name" ARTICLE_NUMBER 100]
>
> I could, for each message link, use org-gnus-open to actually visit the
> message in its home group and get the article with
> `gnus-summary-article-number', but I'm hoping there's a more direct way.
>
> These message could be coming from any backend -- I can't know for sure
> if they'll be imap, or maildir, or what have you.
>
> Can the registry be used to save information like this? It would be nice
> to look first in the registry, which I assume would be quickest, and
> then fall back to something more manual and expensive.
>
> Anyway, any tips would be much appreciated!

Answering my own question:

(gnus-request-head "A9ED-1B41EF8FC63E@example-server.fr"
"nnimap+Server:group-name")

=>

("group-name" . ARTICLE_NUMBER)

No buffer setup or teardown, no messing about, extremely fast response.
A highly profitable two-and-a-half hours spent with the gnus codebase :)

E




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: getting article numbers from message-ids?
  2014-06-02  8:15 getting article numbers from message-ids? Eric Abrahamsen
  2014-06-02 15:13 ` Eric Abrahamsen
@ 2014-09-24 21:12 ` Ted Zlatanov
  2014-09-25  0:15   ` Eric Abrahamsen
  1 sibling, 1 reply; 6+ messages in thread
From: Ted Zlatanov @ 2014-09-24 21:12 UTC (permalink / raw)
  To: ding

On Mon, 02 Jun 2014 16:15:43 +0800 Eric Abrahamsen <eric@ericabrahamsen.net> wrote: 

EA> These message could be coming from any backend -- I can't know for sure
EA> if they'll be imap, or maildir, or what have you.

EA> Can the registry be used to save information like this? It would be nice
EA> to look first in the registry, which I assume would be quickest, and
EA> then fall back to something more manual and expensive.

The registry saves the group name by default. And once you know the
group name it's easy to switch to that group and ask the server with
`gnus-request-head' as you said.

Ted




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: getting article numbers from message-ids?
  2014-09-24 21:12 ` Ted Zlatanov
@ 2014-09-25  0:15   ` Eric Abrahamsen
  2014-09-25 12:36     ` Ted Zlatanov
  0 siblings, 1 reply; 6+ messages in thread
From: Eric Abrahamsen @ 2014-09-25  0:15 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> On Mon, 02 Jun 2014 16:15:43 +0800 Eric Abrahamsen <eric@ericabrahamsen.net> wrote: 
>
> EA> These message could be coming from any backend -- I can't know for sure
> EA> if they'll be imap, or maildir, or what have you.
>
> EA> Can the registry be used to save information like this? It would be nice
> EA> to look first in the registry, which I assume would be quickest, and
> EA> then fall back to something more manual and expensive.
>
> The registry saves the group name by default. And once you know the
> group name it's easy to switch to that group and ask the server with
> `gnus-request-head' as you said.
>
> Ted

Yup, it's all working nicely. Thanks for the registry, by the way --
I've reworked Gnorb to track email conversations with Org TODOs, using
the registry to record connections, and it works like a charm!




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: getting article numbers from message-ids?
  2014-09-25  0:15   ` Eric Abrahamsen
@ 2014-09-25 12:36     ` Ted Zlatanov
  2014-09-25 18:25       ` Eric Abrahamsen
  0 siblings, 1 reply; 6+ messages in thread
From: Ted Zlatanov @ 2014-09-25 12:36 UTC (permalink / raw)
  To: ding

On Thu, 25 Sep 2014 08:15:42 +0800 Eric Abrahamsen <eric@ericabrahamsen.net> wrote: 

EA> Yup, it's all working nicely. Thanks for the registry, by the way --
EA> I've reworked Gnorb to track email conversations with Org TODOs, using
EA> the registry to record connections, and it works like a charm!

Nice!  You can store extra keys per message ID, not just group names.
Perhaps that's useful to you.

Ted




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: getting article numbers from message-ids?
  2014-09-25 12:36     ` Ted Zlatanov
@ 2014-09-25 18:25       ` Eric Abrahamsen
  0 siblings, 0 replies; 6+ messages in thread
From: Eric Abrahamsen @ 2014-09-25 18:25 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> On Thu, 25 Sep 2014 08:15:42 +0800 Eric Abrahamsen <eric@ericabrahamsen.net> wrote: 
>
> EA> Yup, it's all working nicely. Thanks for the registry, by the way --
> EA> I've reworked Gnorb to track email conversations with Org TODOs, using
> EA> the registry to record connections, and it works like a charm!
>
> Nice!  You can store extra keys per message ID, not just group names.
> Perhaps that's useful to you.

Yeah, that's how it works -- message IDs have a key to Org heading IDs.
Fairly elegant (or it will be, once the bugs are worked out).




^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-09-25 18:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-02  8:15 getting article numbers from message-ids? Eric Abrahamsen
2014-06-02 15:13 ` Eric Abrahamsen
2014-09-24 21:12 ` Ted Zlatanov
2014-09-25  0:15   ` Eric Abrahamsen
2014-09-25 12:36     ` Ted Zlatanov
2014-09-25 18:25       ` Eric Abrahamsen

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 NNTP newsgroup(s).