Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Re: Semi-automatical update of article count in nnfolder?
       [not found]   ` <iluvfxetf9t.fsf@latte.josefsson.org>
@ 2003-04-17  6:10     ` Kai Großjohann
  2003-04-17 11:54       ` Simon Josefsson
  0 siblings, 1 reply; 3+ messages in thread
From: Kai Großjohann @ 2003-04-17  6:10 UTC (permalink / raw)


Simon Josefsson <jas@extundo.com> writes:

> I'm not sure.  For nnimap, the IMAP server really know the proper
> data, so nnimap simply asks the server and frobs some Gnus internal
> data structures, but nnfolder doesn't really know this
> authoritatively, does it?

In principle, it has the data.  So it just got to remember, is all.
I guess it now forgets.

> It could iterate through the entire file and count articles, but
> that seems sort of slow.  And counting lines in the NOV file seems
> less robust.  Hm.

nnfolder could store the necessary data in the active file; I guess
that translates to the nnfolder-group-alist variable somewhere.

But I haven't looked at the code closely.

How does nnimap do it?  (I mean where is the entry point into the
code where I need to start reading?)
-- 
file-error; Data: (Opening input file no such file or directory ~/.signature)


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

* Re: Semi-automatical update of article count in nnfolder?
  2003-04-17  6:10     ` Semi-automatical update of article count in nnfolder? Kai Großjohann
@ 2003-04-17 11:54       ` Simon Josefsson
  2003-04-20 14:43         ` Kai Großjohann
  0 siblings, 1 reply; 3+ messages in thread
From: Simon Josefsson @ 2003-04-17 11:54 UTC (permalink / raw)


kai.grossjohann@gmx.net (Kai Großjohann) writes:

> How does nnimap do it?  (I mean where is the entry point into the
> code where I need to start reading?)

(Warning: This code is so ugly it may make you go blind.)

gnus-fixup-nnimap-unread-after-getting-new-news is invoked via
gnus-setup-news-hook, and looks like:

(defun gnus-fixup-nnimap-unread-after-getting-new-news ()
  (let (server group info)
    (mapatoms
     (lambda (sym)
       (when (and (setq group (symbol-name sym))
		  (gnus-group-entry group)
		  (setq info (symbol-value sym)))
	 (gnus-sethash group (cons (nth 2 info) (cdr (gnus-group-entry group)))
		       gnus-newsrc-hashtb)))
     (if (boundp 'nnimap-mailbox-info)
	 (symbol-value 'nnimap-mailbox-info)
       (make-vector 1 0)))))

I.e., it iterates through all nnimap groups and forces the active info
to be what the variable nnimap-mailbox-info says, which is updated by
nnimap.


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

* Re: Semi-automatical update of article count in nnfolder?
  2003-04-17 11:54       ` Simon Josefsson
@ 2003-04-20 14:43         ` Kai Großjohann
  0 siblings, 0 replies; 3+ messages in thread
From: Kai Großjohann @ 2003-04-20 14:43 UTC (permalink / raw)


Simon Josefsson <jas@extundo.com> writes:

> kai.grossjohann@gmx.net (Kai Großjohann) writes:
>
>> How does nnimap do it?  (I mean where is the entry point into the
>> code where I need to start reading?)
>
> (Warning: This code is so ugly it may make you go blind.)
>
> gnus-fixup-nnimap-unread-after-getting-new-news is invoked via
> gnus-setup-news-hook, and looks like:

(Why is it called "after-getting-new-news" but invoked from
"setup-news-hook" instead of "after-getting-new-news-hook"?)

> (defun gnus-fixup-nnimap-unread-after-getting-new-news ()
>   (let (server group info)
>     (mapatoms
>      (lambda (sym)
>        (when (and (setq group (symbol-name sym))
> 		  (gnus-group-entry group)
> 		  (setq info (symbol-value sym)))
> 	 (gnus-sethash group (cons (nth 2 info) (cdr (gnus-group-entry group)))
> 		       gnus-newsrc-hashtb)))
>      (if (boundp 'nnimap-mailbox-info)
> 	 (symbol-value 'nnimap-mailbox-info)
>        (make-vector 1 0)))))
>
> I.e., it iterates through all nnimap groups and forces the active info
> to be what the variable nnimap-mailbox-info says, which is updated by
> nnimap.

Well...  How about making a new backend function
nnchoke-request-active-info, the corresponding
gnus-request-active-info front-end function, and then the
getting-new-news code looks whether the backends support that
function, and if so, does the above?

That would still be rather ugly, but it would be generalized to other
backends.

What do you think?
-- 
file-error; Data: (Opening input file no such file or directory ~/.signature)


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

end of thread, other threads:[~2003-04-20 14:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <hdd8yuc17vo.fsf@bacchus.pvv.ntnu.no>
     [not found] ` <84ades6qxt.fsf@lucy.is.informatik.uni-duisburg.de>
     [not found]   ` <iluvfxetf9t.fsf@latte.josefsson.org>
2003-04-17  6:10     ` Semi-automatical update of article count in nnfolder? Kai Großjohann
2003-04-17 11:54       ` Simon Josefsson
2003-04-20 14:43         ` Kai Großjohann

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