Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Fetch an article from another package
@ 2007-03-25  9:25 Leo
  2007-03-25 13:03 ` Reiner Steib
  0 siblings, 1 reply; 5+ messages in thread
From: Leo @ 2007-03-25  9:25 UTC (permalink / raw)
  To: info-gnus-english

Hi all,

Org¹ mode uses the following function to open a Gnus link. However,
the downside it has when entering a large group is that Gnus will
prompt for how many articles to read. I'd like this function to just
get the article with minimal user interaction. It seems by changing
(gnus-group-read-group 0 nil group) to (gnus-group-read-group 1 nil
group) can solve this issue.

I am wondering is this the recommended way? Any comments?

,----
| (defun org-follow-gnus-link (&optional group article)
|   "Follow a Gnus link to GROUP and ARTICLE."
|   (require 'gnus)
|   (funcall (cdr (assq 'gnus org-link-frame-setup)))
|   (if gnus-other-frame-object (select-frame gnus-other-frame-object))
|   (cond ((and group article)
| 	 (gnus-group-read-group 0 nil group)
| 	 (gnus-summary-goto-article (string-to-number article) nil t))
| 	(group (gnus-group-jump-to-group group))))
`----

Footnotes: 
¹  http://staff.science.uva.nl/~dominik/Tools/org/
-- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

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

* Re: Fetch an article from another package
  2007-03-25  9:25 Fetch an article from another package Leo
@ 2007-03-25 13:03 ` Reiner Steib
  2007-03-26 18:28   ` Leo
  0 siblings, 1 reply; 5+ messages in thread
From: Reiner Steib @ 2007-03-25 13:03 UTC (permalink / raw)
  To: info-gnus-english

On Sun, Mar 25 2007, Leo wrote:

> Org¹ mode uses the following function to open a Gnus link. However,
> the downside it has when entering a large group is that Gnus will
> prompt for how many articles to read. I'd like this function to just
> get the article with minimal user interaction. It seems by changing
> (gnus-group-read-group 0 nil group) to (gnus-group-read-group 1 nil
> group) can solve this issue.
>
> I am wondering is this the recommended way? Any comments?
>
> ,----
> | (defun org-follow-gnus-link (&optional group article)
> |   "Follow a Gnus link to GROUP and ARTICLE."

I'd suggest to use the functions from `gnus-art.el' that handle
buttons like <nntp://news.gmane.org/gmane.emacs.gnus.user/8816> or
<nntp://news.gmane.org/gmane.emacs.gnus.user>:

At least in the trunk version of `gnus-button-fetch-group', you can eval
(gnus-button-fetch-group "nntp://news.gmane.org/gmane.emacs.gnus.user/8816")
directly:

,----
| 2007-01-14  Reiner Steib  <Reiner.Steib@gmx.de>
| [...]
| 	* gnus-art.el [...]
| 	(gnus-button-fetch-group): Extend for use in
| 	`browse-url-browser-function'.
`----

`gnus-large-ephemeral-newsgroup' might also be useful.

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

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

* Re: Fetch an article from another package
  2007-03-25 13:03 ` Reiner Steib
@ 2007-03-26 18:28   ` Leo
  2007-03-26 20:56     ` Reiner Steib
  0 siblings, 1 reply; 5+ messages in thread
From: Leo @ 2007-03-26 18:28 UTC (permalink / raw)
  To: info-gnus-english

On 2007-03-25, Reiner Steib said:

> On Sun, Mar 25 2007, Leo wrote:
>
>> Org¹ mode uses the following function to open a Gnus link. However,
>> the downside it has when entering a large group is that Gnus will
>> prompt for how many articles to read. I'd like this function to just
>> get the article with minimal user interaction. It seems by changing
>> (gnus-group-read-group 0 nil group) to (gnus-group-read-group 1 nil
>> group) can solve this issue.
>>
>> I am wondering is this the recommended way? Any comments?
>>
>> ,----
>> | (defun org-follow-gnus-link (&optional group article)
>> |   "Follow a Gnus link to GROUP and ARTICLE."
>
> I'd suggest to use the functions from `gnus-art.el' that handle
> buttons like <nntp://news.gmane.org/gmane.emacs.gnus.user/8816> or
> <nntp://news.gmane.org/gmane.emacs.gnus.user>:
[...]
> `gnus-large-ephemeral-newsgroup' might also be useful.
>
> Bye, Reiner.

The link is of the format: gnus:gmane.emacs.gnus.user#8816 it is then
parsed into two variables GROUP and ARTICLE and passed to
org-follow-gnus-link.

It seems gnus-button-fetch-group is not the right function for this
task and gnus-large-ephemeral-newsgroup does not help either.

Let me rephrase the question, I now have group name and article number
outside gnus, what's the best way to fetch that article?

Thanks,
-- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

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

* Re: Fetch an article from another package
  2007-03-26 18:28   ` Leo
@ 2007-03-26 20:56     ` Reiner Steib
  2007-04-12 14:49       ` Leo
  0 siblings, 1 reply; 5+ messages in thread
From: Reiner Steib @ 2007-03-26 20:56 UTC (permalink / raw)
  To: info-gnus-english

On Mon, Mar 26 2007, Leo wrote:

> The link is of the format: gnus:gmane.emacs.gnus.user#8816 

Well, that format is not at all standard.

> it is then parsed into two variables GROUP and ARTICLE and passed to
> org-follow-gnus-link.
>
> It seems gnus-button-fetch-group is not the right function for this
> task

It is:

(gnus-button-fetch-group  "news.gmane.org/gmane.emacs.gnus.user/1853")
(gnus-button-fetch-group  "nntp://news.gmane.org/gmane.emacs.gnus.user/1853")

> Let me rephrase the question, I now have group name and article number
> outside gnus, what's the best way to fetch that article?

A group name plus an article number only makes sense if also the
server is specified.  Then, you can use `gnus-button-fetch-group' or
`browse-url':

(browse-url "nntp://news.gmane.org/gmane.emacs.gnus.user/8816")

,----[ <f1> v browse-url-browser-function RET ]
| browse-url-browser-function is a variable defined in `browse-url'.
| Its value is 
| (("^mailto:" . browse-url-mail)
|  ("^\\(news\\|nntp\\)://" . gnus-button-fetch-group)
|  ("." . rs-browse-url-by-killing))
`----

Bye, Reiner.
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo---  |  PGP key available  |  http://rsteib.home.pages.de/

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

* Re: Fetch an article from another package
  2007-03-26 20:56     ` Reiner Steib
@ 2007-04-12 14:49       ` Leo
  0 siblings, 0 replies; 5+ messages in thread
From: Leo @ 2007-04-12 14:49 UTC (permalink / raw)
  To: info-gnus-english

Dear Reiner,

----- Reiner Steib (2007-03-26) wrote:-----

> On Mon, Mar 26 2007, Leo wrote:
>
>> The link is of the format: gnus:gmane.emacs.gnus.user#8816 
>
> Well, that format is not at all standard.
>
>> it is then parsed into two variables GROUP and ARTICLE and passed to
>> org-follow-gnus-link.
>>
>> It seems gnus-button-fetch-group is not the right function for this
>> task
>
> It is:
>
> (gnus-button-fetch-group  "news.gmane.org/gmane.emacs.gnus.user/1853")
> (gnus-button-fetch-group  "nntp://news.gmane.org/gmane.emacs.gnus.user/1853")

Gnus-button-fetch-group looks quite convenient. What's the best way to
get current article's "url" so that it is ready to use by
gnus-button-fetch-group?

>> Let me rephrase the question, I now have group name and article number
>> outside gnus, what's the best way to fetch that article?
>
> A group name plus an article number only makes sense if also the
> server is specified.  Then, you can use `gnus-button-fetch-group' or
> `browse-url':
>
> (browse-url "nntp://news.gmane.org/gmane.emacs.gnus.user/8816")
>
> ,----[ <f1> v browse-url-browser-function RET ]
> | browse-url-browser-function is a variable defined in `browse-url'.
> | Its value is 
> | (("^mailto:" . browse-url-mail)
> |  ("^\\(news\\|nntp\\)://" . gnus-button-fetch-group)
> |  ("." . rs-browse-url-by-killing))
> `----
>
> Bye, Reiner.


regards,
-- 
Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)

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

end of thread, other threads:[~2007-04-12 14:49 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-25  9:25 Fetch an article from another package Leo
2007-03-25 13:03 ` Reiner Steib
2007-03-26 18:28   ` Leo
2007-03-26 20:56     ` Reiner Steib
2007-04-12 14:49       ` Leo

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