Gnus development mailing list
 help / color / mirror / Atom feed
* Virtual groups weirdness
@ 2011-05-11  9:46 Antoine Levitt
  2011-05-11 11:07 ` Antoine Levitt
  0 siblings, 1 reply; 6+ messages in thread
From: Antoine Levitt @ 2011-05-11  9:46 UTC (permalink / raw)
  To: ding

I'm trying to use virtual groups so as to have an "inbox+sent mail"
group (both on nnimap). Doing so I get what I can only describe as
erratic behaviour.

I did G V and edited the regexp to INBOX\\|Sent. Then I quit gnus and
run it again, and try to open the new virtual group. I get prompted with
how many messages I want to get, enter some value, and then not only do
I not get the summary buffer, but the group's unread count goes to the
total number of messages in both groups - even though I have no unread
messages.

The log says

Retrieving newsgroup: nnvirtual:inbox+sent...
Fetching headers for nnvirtual:inbox+sent...done
Making sparse threads...done
No unread news

This is on a blank .gnus.




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

* Re: Virtual groups weirdness
  2011-05-11  9:46 Virtual groups weirdness Antoine Levitt
@ 2011-05-11 11:07 ` Antoine Levitt
  2011-05-11 21:43   ` Ted Zlatanov
  0 siblings, 1 reply; 6+ messages in thread
From: Antoine Levitt @ 2011-05-11 11:07 UTC (permalink / raw)
  To: ding

11/05/11 11:46, Antoine Levitt
> I'm trying to use virtual groups so as to have an "inbox+sent mail"
> group (both on nnimap). Doing so I get what I can only describe as
> erratic behaviour.
>
> I did G V and edited the regexp to INBOX\\|Sent. Then I quit gnus and
> run it again, and try to open the new virtual group. I get prompted with
> how many messages I want to get, enter some value, and then not only do
> I not get the summary buffer, but the group's unread count goes to the
> total number of messages in both groups - even though I have no unread
> messages.
>
> The log says
>
> Retrieving newsgroup: nnvirtual:inbox+sent...
> Fetching headers for nnvirtual:inbox+sent...done
> Making sparse threads...done
> No unread news
>
> This is on a blank .gnus.

So yeah, I'm a moron. The virtual group was matching itself, producing
weird behaviour. There could be a check for that, though.

I tried the following fix, but it doesn't work because
nnvirtual-current-group is nil. Any other way to get this information?

=== modified file 'lisp/gnus/nnvirtual.el'                                     
--- lisp/gnus/nnvirtual.el      2011-01-25 04:08:28 +0000                      
+++ lisp/gnus/nnvirtual.el	2011-05-11 11:03:06 +0000
@@ -236,8 +236,13 @@
       ;; Go through the newsrc alist and find all component groups.
       (let ((newsrc (cdr gnus-newsrc-alist))
 	    group)
 	(while (setq group (car (pop newsrc)))
-	  (when (string-match nnvirtual-component-regexp group) ; Match
+	  (when (and (string-match nnvirtual-component-regexp group) ; Match
+		     (not (equal group nnvirtual-current-group)))
 	    ;; Add this group to the list of component groups.
 	    (setq nnvirtual-component-groups
 		  (cons group (delete group nnvirtual-component-groups)))))))




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

* Re: Virtual groups weirdness
  2011-05-11 11:07 ` Antoine Levitt
@ 2011-05-11 21:43   ` Ted Zlatanov
  2011-05-12  9:59     ` Antoine Levitt
  0 siblings, 1 reply; 6+ messages in thread
From: Ted Zlatanov @ 2011-05-11 21:43 UTC (permalink / raw)
  To: ding

On Wed, 11 May 2011 13:07:49 +0200 Antoine Levitt <antoine.levitt@gmail.com> wrote: 

AL> So yeah, I'm a moron. The virtual group was matching itself, producing
AL> weird behaviour. There could be a check for that, though.

AL> I tried the following fix, but it doesn't work because
AL> nnvirtual-current-group is nil. Any other way to get this information?

Does `gnus-newsgroup-name' work?  I don't know if it will, just a guess.

Also I would disallow any group with a nnvirtual backend, not just the
one we're generating.  There's little point in making virtual groups of
virtual groups, so that would also fix the issue you're reporting.

Ted




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

* Re: Virtual groups weirdness
  2011-05-11 21:43   ` Ted Zlatanov
@ 2011-05-12  9:59     ` Antoine Levitt
  2011-05-12 12:58       ` Ted Zlatanov
  0 siblings, 1 reply; 6+ messages in thread
From: Antoine Levitt @ 2011-05-12  9:59 UTC (permalink / raw)
  To: ding

11/05/11 23:43, Ted Zlatanov
> On Wed, 11 May 2011 13:07:49 +0200 Antoine Levitt <antoine.levitt@gmail.com> wrote: 
>
> AL> So yeah, I'm a moron. The virtual group was matching itself, producing
> AL> weird behaviour. There could be a check for that, though.
>
> AL> I tried the following fix, but it doesn't work because
> AL> nnvirtual-current-group is nil. Any other way to get this information?
>
> Does `gnus-newsgroup-name' work?  I don't know if it will, just a guess.

Nope, also nil. There doesn't seem to be any way to know the group in
this function. There is a lot of

  (setq nnvirtual-component-groups
	(delete (nnvirtual-current-group) nnvirtual-component-groups))

scattered around the code which should in principle take care of this
issue, but somehow it doesn't for me. Maybe one is missing somewhere,
but it certainly would be nicer to just not add it in the first
place. Someone with knowledge of the control flow of the backend methods
should take a look at it.

> Also I would disallow any group with a nnvirtual backend, not just the
> one we're generating.  There's little point in making virtual groups of
> virtual groups, so that would also fix the issue you're reporting.

That'd certainly be easier to implement (just match
^nnvirtual). However, I'm not sure it's the right thing to do. Users
could in principle have a tree of virtual groups. I'm not sure if anyone
actually does that, but it seems arbitrary to forbid it.




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

* Re: Virtual groups weirdness
  2011-05-12  9:59     ` Antoine Levitt
@ 2011-05-12 12:58       ` Ted Zlatanov
  2011-05-30 19:49         ` Lars Magne Ingebrigtsen
  0 siblings, 1 reply; 6+ messages in thread
From: Ted Zlatanov @ 2011-05-12 12:58 UTC (permalink / raw)
  To: ding

On Thu, 12 May 2011 11:59:21 +0200 Antoine Levitt <antoine.levitt@gmail.com> wrote: 

AL> 11/05/11 23:43, Ted Zlatanov

>> Also I would disallow any group with a nnvirtual backend, not just the
>> one we're generating.  There's little point in making virtual groups of
>> virtual groups, so that would also fix the issue you're reporting.

AL> That'd certainly be easier to implement (just match
AL> ^nnvirtual). However, I'm not sure it's the right thing to do. Users
AL> could in principle have a tree of virtual groups. I'm not sure if anyone
AL> actually does that, but it seems arbitrary to forbid it.

If you think about the use cases, virtual groups are rare anyhow.
Meta-virtual groups are probably extremely rare as legitimate use cases.
But this is just my opinion; maybe others are using meta-virtuals happily.

Ted




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

* Re: Virtual groups weirdness
  2011-05-12 12:58       ` Ted Zlatanov
@ 2011-05-30 19:49         ` Lars Magne Ingebrigtsen
  0 siblings, 0 replies; 6+ messages in thread
From: Lars Magne Ingebrigtsen @ 2011-05-30 19:49 UTC (permalink / raw)
  To: ding

Ted Zlatanov <tzz@lifelogs.com> writes:

> If you think about the use cases, virtual groups are rare anyhow.
> Meta-virtual groups are probably extremely rare as legitimate use cases.

Yeah, I don't think that's something that people use.

Just excluding all nnvirtual groups should suffice.

-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/




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

end of thread, other threads:[~2011-05-30 19:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-11  9:46 Virtual groups weirdness Antoine Levitt
2011-05-11 11:07 ` Antoine Levitt
2011-05-11 21:43   ` Ted Zlatanov
2011-05-12  9:59     ` Antoine Levitt
2011-05-12 12:58       ` Ted Zlatanov
2011-05-30 19:49         ` Lars Magne Ingebrigtsen

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