Gnus development mailing list
 help / color / mirror / Atom feed
From: Colin Rafferty <colin@xemacs.org>
Cc: GNUS Mailing List <ding@gnus.org>
Subject: Re: gnus-group-get-new-nnml
Date: 21 Jan 1998 11:47:50 -0500	[thread overview]
Message-ID: <ocr3eihu62x.fsf@ml.com> (raw)
In-Reply-To: stephen farrell's message of "21 Jan 1998 09:35:23 -0600"

stephen farrell writes:

> A while back you posted a function called gnus-group-get-new-nnml()
> which gets new mail only in nnml groups (and hence is fast).  I've
> been using it ever since, but one thing has always plagued me about
> it:  about 1/3 of the time it failed to actually *notice* that I had
> new mail, so I have to go back to the old, slow way!

> I finally took a good look at what was going on today and noticed that 
> the problem is that the variable nnml-get-new-mail is set to nil... I
> tried setting it to t in your function but then I got on to the real
> problem:  nnml-current-directory, nnml-current-group, etc were all set 
> for the last nndir group I'd read (mailing lists)!

Thanks for pointing out the problem -- I was able to recreate it.  Here
is a better fix to the problem:

(defun gnus-group-get-new-nnml ()
  "Get new mail only."
  (interactive)
  (let ((gnus-group-new-mail-list nil)
	(method '(nnml ""))
	(nnml-prepare-save-mail-hook
	 (cons '(lambda ()
		  (setq gnus-group-new-mail-list
			(union gnus-group-new-mail-list
			       (mapcar 'car group-art))))
	       nnml-prepare-save-mail-hook)))
    (when (gnus-check-server method)
      (gnus-request-scan nil method))
    (let ((gnus-group-marked (mapcar '(lambda (group)
					(concat "nnml:" group))
				     gnus-group-new-mail-list)))
      (gnus-group-get-new-news-this-group))
    (when gnus-goto-next-group-when-activating
      (gnus-group-next-unread-group 1 t))
    (gnus-summary-position-point)
    (gnus-group-list-groups)
    gnus-group-new-mail-list))

-- 
Colin


       reply	other threads:[~1998-01-21 16:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87vhvdyh50.fsf@phaedrus.uchicago.edu>
1998-01-21 16:47 ` Colin Rafferty [this message]
1998-01-21 17:11   ` gnus-group-get-new-nnml Wes Hardaker
1998-01-21 20:40     ` gnus-group-get-new-nnml Colin Rafferty
1998-01-21 22:02       ` gnus-group-get-new-nnml Wes Hardaker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ocr3eihu62x.fsf@ml.com \
    --to=colin@xemacs.org \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).