Discussion:
getting article numbers from message-ids?
Eric Abrahamsen
2014-06-02 08:15:43 UTC
Permalink
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-***@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
Eric Abrahamsen
2014-06-02 15:13:16 UTC
Permalink
Post by Eric Abrahamsen
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
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-***@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
Ted Zlatanov
2014-09-24 21:12:50 UTC
Permalink
On Mon, 02 Jun 2014 16:15:43 +0800 Eric Abrahamsen <***@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
Eric Abrahamsen
2014-09-25 00:15:42 UTC
Permalink
Post by Ted Zlatanov
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!
Ted Zlatanov
2014-09-25 12:36:18 UTC
Permalink
On Thu, 25 Sep 2014 08:15:42 +0800 Eric Abrahamsen <***@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
Eric Abrahamsen
2014-09-25 18:25:20 UTC
Permalink
Post by Ted Zlatanov
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).

Loading...