Gnus development mailing list
 help / color / mirror / Atom feed
* Fetching Message-ID --> nnfolder
@ 2004-04-13 20:31 Michael Schierl
  2004-05-16 12:59 ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Schierl @ 2004-04-13 20:31 UTC (permalink / raw)


Hi,

I use the following code to fetch a list of message IDs
(`nnlater-mid-cache') into a nnfolder whenever I fetch news:

(defun nnlater-fetch-article (msgid)
  (unless (get-buffer "*Group*")
    (error "Gnus is not started"))
  (save-window-excursion
    (save-excursion
      (set-buffer (get-buffer "*Group*"))
      
      (gnus-group-jump-to-group "nnfolder:fetched") ; this folder must
					; exist and have at least one
					; article in it
      (gnus-group-select-group 0)
      (gnus-summary-refer-article msgid)
      (gnus-summary-mark-article nil gnus-unread-mark)
      (gnus-summary-copy-article 1 "nnfolder:fetched") ; otherwise it is
					; not saved
      (gnus-summary-exit))))
  
(defadvice gnus-agent-fetch-session (before nnlater-gafs-advice activate)
  (unless gnus-plugged
    (error "Can't fetch articles while Gnus is unplugged"))
  (mapc 'nnlater-fetch-article nnlater-mid-cache)
  (setq nnlater-mid-cache nil))

[there is some more code there to make gnus-refer-article-methods add
an otherwise unretrievable message ID to this list, but that is not
part of my problem...]

Now I have a few problems:

1. Sometimes I get an error that article -1 cannot be copied (however,
   when I want to hunt it down, it does not appear, so I cannot
   provide an exact error message). When I use move-article instead of
   copy-article, a similar error occurs most of the time ("Couldn't
   move Article (-1): Folder fetched selected"). The error message
   looks strange to me, but if moving does not work, I'll live with
   copying.

2. I could not find a way to make the "copy" unread. When the article
   is moved, it remains unread as it should, but the copy will become
   read. (Since the "Original" will disappear when the group is
   exited, the only article remaining will be read). 
   `gnus-preserve-marks' is `t'.

3. This solution looks a bit hackish to me. Is there some function to
   archieve that (message-ID --> nnfolder) which I missed?

Any ideas?




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

end of thread, other threads:[~2004-05-17 19:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-04-13 20:31 Fetching Message-ID --> nnfolder Michael Schierl
2004-05-16 12:59 ` Lars Magne Ingebrigtsen
2004-05-17 19:43   ` Michael Schierl

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