Gnus development mailing list
 help / color / mirror / Atom feed
* how do I subscribe to a group as a string from code?
@ 2011-10-20 14:22 Ted Zlatanov
  0 siblings, 0 replies; 7+ messages in thread
From: Ted Zlatanov @ 2011-10-20 14:22 UTC (permalink / raw)
  To: ding

(resending, original had "subscribe" at the beginning of a line and got
stalled, so ding-owner@lists.math.uh.edu can disregard it--thanks!)

I need this for my gnus-sync.el work.  I have save and read working, now
I want to be able to sync subscriptions.  As soon as that's working I'll
put it out.

Given a string: "nntp+news.gwene.org:gwene.org.slashdot" I want to make
a subscription to that group.  The server is not necessarily defined,
but it's OK to fail in that case.

I looked at `gnus-browse-unsubscribe-group'.  It's very tightly tied to
the server browsing buffer.  I can dig into the backend functionality
more, but was hoping someone could save me a few hours of poking around.

Thanks
Ted




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

* Re: how do I subscribe to a group as a string from code?
  2011-10-20 14:20 Ted Zlatanov
  2011-10-20 19:07 ` Tassilo Horn
@ 2011-10-21 14:44 ` Steinar Bang
  1 sibling, 0 replies; 7+ messages in thread
From: Steinar Bang @ 2011-10-21 14:44 UTC (permalink / raw)
  To: ding

>>>>> Ted Zlatanov <tzz@lifelogs.com>:

> I need this for my gnus-sync.el work.  I have save and read working,
> now I want to be able to sync subscriptions.  As soon as that's
> working I'll put it out.

Cool!  Are we past the emacs 24 feature freeze?




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

* Re: how do I subscribe to a group as a string from code?
  2011-10-20 20:11     ` Tassilo Horn
@ 2011-10-20 21:19       ` Ted Zlatanov
  0 siblings, 0 replies; 7+ messages in thread
From: Ted Zlatanov @ 2011-10-20 21:19 UTC (permalink / raw)
  To: ding

On Thu, 20 Oct 2011 22:11:40 +0200 Tassilo Horn <tassilo@member.fsf.org> wrote: 

TH> Ted Zlatanov <tzz@lifelogs.com> writes:

>> Whoa, how the .... does that work?  I don't have a "Gmane" server
>> defined in my backends, but it subscribed to it and I can look at that
>> group on Gmane.  This also works in my original case, where I have
>> that foreign server defined:
>> 
>> (gnus-subscribe-newsgroup "nntp+news.gwene.org:gwene.org.slashdot")
>> 
>> so I guess it solves my problem, but I'm really curious why the
>> "Gmane" server worked without a definition and I am not sure if I can
>> rely on this behavior for general sync.

TH> Oh, I chose Gmane, cause that's the name of the select method with
TH> nntp-server news.gmane.org here.  Not sure why that also works for you
TH> without such a select method.  I wouldn't assume that in the general
TH> case.

Exactly.  It's weird--I'd rather see it fail!

TH> However, I'm pretty sure that'll always work if you feed in a valid
TH> select method name.  Can't you just iterate the select methods comparing
TH> the server addresses for picking the right one?

Yup.  I'll assume it will work, since I ask y/n on subscription anyhow.

TH> Well, ok, it's possible to have several select methods for the same
TH> server, say, different imap accounts.  In that case, you are probably
TH> lost.

It's OK, these are backends that can't store marks, usually nntp.  You
don't normally see multiple accounts with those so I think it's OK.

Thanks for your help!
Ted




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

* Re: how do I subscribe to a group as a string from code?
  2011-10-20 19:28   ` Ted Zlatanov
@ 2011-10-20 20:11     ` Tassilo Horn
  2011-10-20 21:19       ` Ted Zlatanov
  0 siblings, 1 reply; 7+ messages in thread
From: Tassilo Horn @ 2011-10-20 20:11 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> TH> I've just tried
>
> TH>   (gnus-subscribe-newsgroup "nntp+Gmane:gwene.org.slashdot")
>
> TH> and that did the trick.  Do I understand your question wrongly, or did
> TH> you miss the forest for the trees?
>
> Whoa, how the .... does that work?  I don't have a "Gmane" server
> defined in my backends, but it subscribed to it and I can look at that
> group on Gmane.  This also works in my original case, where I have
> that foreign server defined:
>
> (gnus-subscribe-newsgroup "nntp+news.gwene.org:gwene.org.slashdot")
>
> so I guess it solves my problem, but I'm really curious why the
> "Gmane" server worked without a definition and I am not sure if I can
> rely on this behavior for general sync.

Oh, I chose Gmane, cause that's the name of the select method with
nntp-server news.gmane.org here.  Not sure why that also works for you
without such a select method.  I wouldn't assume that in the general
case.

However, I'm pretty sure that'll always work if you feed in a valid
select method name.  Can't you just iterate the select methods comparing
the server addresses for picking the right one?

Well, ok, it's possible to have several select methods for the same
server, say, different imap accounts.  In that case, you are probably
lost.

Bye,
Tassilo
-- 
Sent from my Emacs



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

* Re: how do I subscribe to a group as a string from code?
  2011-10-20 19:07 ` Tassilo Horn
@ 2011-10-20 19:28   ` Ted Zlatanov
  2011-10-20 20:11     ` Tassilo Horn
  0 siblings, 1 reply; 7+ messages in thread
From: Ted Zlatanov @ 2011-10-20 19:28 UTC (permalink / raw)
  To: ding

On Thu, 20 Oct 2011 21:07:50 +0200 Tassilo Horn <tassilo@member.fsf.org> wrote: 

TH> Ted Zlatanov <tzz@lifelogs.com> writes:
>> I need this for my gnus-sync.el work.  I have save and read working,
>> now I want to be able to sync subscriptions.  As soon as that's
>> working I'll put it out.
>> 
>> Given a string: "nntp+news.gwene.org:gwene.org.slashdot" I want to
>> subscribe to that group.  The server is not necessarily defined, but
>> it's OK to fail in that case.

TH> I've just tried

TH>   (gnus-subscribe-newsgroup "nntp+Gmane:gwene.org.slashdot")

TH> and that did the trick.  Do I understand your question wrongly, or did
TH> you miss the forest for the trees?

Whoa, how the .... does that work?  I don't have a "Gmane" server
defined in my backends, but it subscribed to it and I can look at that
group on Gmane.  This also works in my original case, where I have that
foreign server defined:

(gnus-subscribe-newsgroup "nntp+news.gwene.org:gwene.org.slashdot")

so I guess it solves my problem, but I'm really curious why the "Gmane"
server worked without a definition and I am not sure if I can rely on
this behavior for general sync.

Ted




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

* Re: how do I subscribe to a group as a string from code?
  2011-10-20 14:20 Ted Zlatanov
@ 2011-10-20 19:07 ` Tassilo Horn
  2011-10-20 19:28   ` Ted Zlatanov
  2011-10-21 14:44 ` Steinar Bang
  1 sibling, 1 reply; 7+ messages in thread
From: Tassilo Horn @ 2011-10-20 19:07 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> I need this for my gnus-sync.el work.  I have save and read working,
> now I want to be able to sync subscriptions.  As soon as that's
> working I'll put it out.
>
> Given a string: "nntp+news.gwene.org:gwene.org.slashdot" I want to
> subscribe to that group.  The server is not necessarily defined, but
> it's OK to fail in that case.

I've just tried

  (gnus-subscribe-newsgroup "nntp+Gmane:gwene.org.slashdot")

and that did the trick.  Do I understand your question wrongly, or did
you miss the forest for the trees?

Bye,
Tassilo
-- 
Sent from my Emacs



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

* how do I subscribe to a group as a string from code?
@ 2011-10-20 14:20 Ted Zlatanov
  2011-10-20 19:07 ` Tassilo Horn
  2011-10-21 14:44 ` Steinar Bang
  0 siblings, 2 replies; 7+ messages in thread
From: Ted Zlatanov @ 2011-10-20 14:20 UTC (permalink / raw)
  To: ding

I need this for my gnus-sync.el work.  I have save and read working, now
I want to be able to sync subscriptions.  As soon as that's working I'll
put it out.

Given a string: "nntp+news.gwene.org:gwene.org.slashdot" I want to
subscribe to that group.  The server is not necessarily defined, but
it's OK to fail in that case.

I looked at `gnus-browse-unsubscribe-group'.  It's very tightly tied to
the server browsing buffer.  I can dig into the backend functionality
more, but was hoping someone could save me a few hours of poking around.

Thanks
Ted




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

end of thread, other threads:[~2011-10-21 14:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-20 14:22 how do I subscribe to a group as a string from code? Ted Zlatanov
  -- strict thread matches above, loose matches on Subject: below --
2011-10-20 14:20 Ted Zlatanov
2011-10-20 19:07 ` Tassilo Horn
2011-10-20 19:28   ` Ted Zlatanov
2011-10-20 20:11     ` Tassilo Horn
2011-10-20 21:19       ` Ted Zlatanov
2011-10-21 14:44 ` Steinar Bang

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).