Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* nnml filename from summary buffer
@ 2005-06-30 18:27 John Hunter
  2005-07-01 18:32 ` Ted Zlatanov
  0 siblings, 1 reply; 4+ messages in thread
From: John Hunter @ 2005-06-30 18:27 UTC (permalink / raw)



I would like to get the full path to the file containing an nnml
article from the summary buffer of an nnml group.  I know I can get
the article number with 

(gnus-summary-article-number)

but am unsure how to get the full path

Thanks!
JDH

Oort Gnus v0.13


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

* Re: nnml filename from summary buffer
  2005-06-30 18:27 nnml filename from summary buffer John Hunter
@ 2005-07-01 18:32 ` Ted Zlatanov
  2005-07-01 18:47   ` John Hunter
  0 siblings, 1 reply; 4+ messages in thread
From: Ted Zlatanov @ 2005-07-01 18:32 UTC (permalink / raw)


On Thu, 30 Jun 2005, jdhunter@ace.bsd.uchicago.edu wrote:

> I would like to get the full path to the file containing an nnml
> article from the summary buffer of an nnml group.  I know I can get
> the article number with 
> 
> (gnus-summary-article-number)
> 
> but am unsure how to get the full path

There's probably a way to do it in the API, but why do you need the
file name?  It's usually better to work in file-independent ways, so
your code can be adapted to nnimap or nntp for example.

Ted

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----


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

* Re: nnml filename from summary buffer
  2005-07-01 18:32 ` Ted Zlatanov
@ 2005-07-01 18:47   ` John Hunter
  2005-07-05 15:31     ` Ted Zlatanov
  0 siblings, 1 reply; 4+ messages in thread
From: John Hunter @ 2005-07-01 18:47 UTC (permalink / raw)


>>>>> "Ted" == Ted Zlatanov <tzz@lifelogs.com> writes:

    Ted> There's probably a way to do it in the API, but why do you
    Ted> need the file name?  It's usually better to work in
    Ted> file-independent ways, so your code can be adapted to nnimap
    Ted> or nntp for example.

I need to pass the article contents off to an external script which
takes a filename.  Alternatively I could get the entire buffer
contents as a string and write it to a temporary file - do you know
which function/variable provides access to the raw, unwashed, article
which I could dump to a temp file?

JDH


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

* Re: nnml filename from summary buffer
  2005-07-01 18:47   ` John Hunter
@ 2005-07-05 15:31     ` Ted Zlatanov
  0 siblings, 0 replies; 4+ messages in thread
From: Ted Zlatanov @ 2005-07-05 15:31 UTC (permalink / raw)


On Fri, 01 Jul 2005, jdhunter@ace.bsd.uchicago.edu wrote:

>>>>>> "Ted" == Ted Zlatanov <tzz@lifelogs.com> writes:
> 
>     Ted> There's probably a way to do it in the API, but why do you
>     Ted> need the file name?  It's usually better to work in
>     Ted> file-independent ways, so your code can be adapted to nnimap
>     Ted> or nntp for example.
> 
> I need to pass the article contents off to an external script which
> takes a filename.  Alternatively I could get the entire buffer
> contents as a string and write it to a temporary file - do you know
> which function/variable provides access to the raw, unwashed, article
> which I could dump to a temp file?

Yes, I've done that in spam.el to pass to an external process.  The
discussion below applies to nntp, nnimap, nnml, etc. backends so it's
a clean solution to your problem.

Anyhow, here's how you can get an article into a buffer and then
return the string (from spam.el):

(defun spam-get-article-as-string (article)
  (when (numberp article)
    (with-temp-buffer
      (gnus-request-article-this-buffer
       article
       gnus-newsgroup-name)
      (buffer-string))))

This uses the CURRENT gnus-newsgroup-name, so if you are not in the
summary buffer or gnus-newsgroup-name is unset for another reason, it
won't work (gnus-newsgroup-name is set every time you enter a group
summary buffer).

Is there no way the external script can take STDIN rather than a file?
Many Unix utilities will take a "-" as an argument to mean "read from
STDIN."  That way, you can just get the article into a buffer and then
use the call-process-region function, instead of getting a string back
as this function does.

If you must put it into a file, use make-temp-file and write the
string or the temp-buffer contents to it with write-region...

Ted

----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----


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

end of thread, other threads:[~2005-07-05 15:31 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-30 18:27 nnml filename from summary buffer John Hunter
2005-07-01 18:32 ` Ted Zlatanov
2005-07-01 18:47   ` John Hunter
2005-07-05 15:31     ` Ted Zlatanov

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