* nnvirtual groups and article warping @ 2022-03-03 16:54 Eric S Fraga 2022-03-03 19:38 ` Eric Abrahamsen 0 siblings, 1 reply; 16+ messages in thread From: Eric S Fraga @ 2022-03-03 16:54 UTC (permalink / raw) To: ding Hello all, I use virtual groups to collect emails from a number of groups (all nnml). When reading the virtual group, there are times where I would like to jump to the originating group. In groups that are the result of searches, I can do this with A W (gnus-warp-to-article). Is the same functionality available with an nnvirtual group? (I haven't been able to find it, if it exists.) Thank you, eric -- Eric S Fraga with org 9.5.2 in Emacs 29.0.50 on Debian 11.2 ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: nnvirtual groups and article warping 2022-03-03 16:54 nnvirtual groups and article warping Eric S Fraga @ 2022-03-03 19:38 ` Eric Abrahamsen 2022-03-03 23:15 ` Andrew Cohen 2022-03-04 8:01 ` Eric S Fraga 0 siblings, 2 replies; 16+ messages in thread From: Eric Abrahamsen @ 2022-03-03 19:38 UTC (permalink / raw) To: ding Eric S Fraga <e.fraga@ucl.ac.uk> writes: > Hello all, > > I use virtual groups to collect emails from a number of groups (all > nnml). When reading the virtual group, there are times where I would > like to jump to the originating group. In groups that are the result of > searches, I can do this with A W (gnus-warp-to-article). Is the same > functionality available with an nnvirtual group? (I haven't been able > to find it, if it exists.) It doesn't exist, but it wouldn't be too hard to write. Basically, nnvirtual would have to have a function called `nnvirtual-warp-to-article', which did something like: (let* ((gnus-override-method nil) (gnus-newsgroup-name (gnus-group-prefixed-name (car (nnvirtual-map-article (gnus-summary-article-number))))) (gnus-command-method (gnus-find-method-for-group gnus-newsgroup-name))) (when (gnus-check-backend-function 'warp-to-article (car gnus-command-method)) (funcall (gnus-get-function gnus-command-method 'warp-to-article)))) The weird thing, poking into the code, is that no backends seem to implement *-warp-to-article, except nnselect. Doesn't that seem weird? So this function would instead have to do pretty much what nnselect-warp-to-article does, namely: (deffoo nnvirtual-warp-to-article () (let* ((cur (if (> (gnus-summary-article-number) 0) (gnus-summary-article-number) (error "Can't warp to a pseudo-article"))) (group-art (nnvirtual-map-article cur))) (gnus-summary-read-group-1 (car group-art) t t nil nil (list (cdr group-art))))) Does that work? ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: nnvirtual groups and article warping 2022-03-03 19:38 ` Eric Abrahamsen @ 2022-03-03 23:15 ` Andrew Cohen 2022-03-04 17:28 ` Eric Abrahamsen 2022-03-06 12:49 ` Eric S Fraga 2022-03-04 8:01 ` Eric S Fraga 1 sibling, 2 replies; 16+ messages in thread From: Andrew Cohen @ 2022-03-03 23:15 UTC (permalink / raw) To: ding >>>>> "EA" == Eric Abrahamsen <eric@ericabrahamsen.net> writes: EA> Eric Abrahamsen writes [...] EA> The weird thing, poking into the code, is that no backends seem EA> to implement *-warp-to-article, except nnselect. Doesn't that EA> seem weird? Err, no? Aside from nnselect and nnvirtual, every article is already in its original group so warping should be a no-op. I added warping early on to nnir simply because nnir was completely ephemeral: that is, no changes made would propagate back to the original article (i.e. if you wanted to tick an article it wouldn't stick if you did so after a search---warping was a hack to deal with that). Now that nnselect does everything a regular backend does, there shouldn't be much use for warping. I never used nnvirtual so I never made changes for it. I see no reason NOT to add a warping for nnvirtual which should be straightforward (as you describe below). But I am curious what the use case is? nnvirtual already does (some) propagation back to the originating groups. (BTW I think the stuff I posted some weeks ago does pretty well at replacing nnvirtual in nnselect. I haven't tested it very much but if it lacks something I can look into it). EA> So this function would instead have to do pretty much what EA> nnselect-warp-to-article does, namely: EA> (deffoo nnvirtual-warp-to-article () (let* ((cur (if (> EA> (gnus-summary-article-number) 0) (gnus-summary-article-number) EA> (error "Can't warp to a pseudo-article"))) (group-art EA> (nnvirtual-map-article cur))) (gnus-summary-read-group-1 (car EA> group-art) t t nil nil (list (cdr group-art))))) -- Andrew Cohen ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: nnvirtual groups and article warping 2022-03-03 23:15 ` Andrew Cohen @ 2022-03-04 17:28 ` Eric Abrahamsen 2022-03-05 3:02 ` Andrew Cohen 2022-03-06 12:49 ` Eric S Fraga 1 sibling, 1 reply; 16+ messages in thread From: Eric Abrahamsen @ 2022-03-04 17:28 UTC (permalink / raw) To: ding Andrew Cohen <acohen@ust.hk> writes: >>>>>> "EA" == Eric Abrahamsen <eric@ericabrahamsen.net> writes: > > EA> Eric Abrahamsen writes > > [...] > > EA> The weird thing, poking into the code, is that no backends seem > EA> to implement *-warp-to-article, except nnselect. Doesn't that > EA> seem weird? > > Err, no? Aside from nnselect and nnvirtual, every article is already in > its original group so warping should be a no-op. > > I added warping early on to nnir simply because nnir was completely > ephemeral: that is, no changes made would propagate back to the original > article (i.e. if you wanted to tick an article it wouldn't stick if you > did so after a search---warping was a hack to deal with that). Now that > nnselect does everything a regular backend does, there shouldn't be much > use for warping. I guess it just struck me as odd that there's a whole backend deffoo for it, when it's only used in one place. Some of the earlier code commits mention using it for nndoc, but it looks like that never happened. > I never used nnvirtual so I never made changes for it. I see no reason > NOT to add a warping for nnvirtual which should be straightforward (as > you describe below). But I am curious what the use case is? nnvirtual > already does (some) propagation back to the originating groups. > > (BTW I think the stuff I posted some weeks ago does pretty well at > replacing nnvirtual in nnselect. I haven't tested it very much but if it > lacks something I can look into it). I agree that there's less and less need for nnvirtual, but also that there's no harm in adding an `nnvirtual-warp-to-article' deffoo, for completeness' sake. I was going to bring this up again, regarding full nnvirtual feature coverage for nnselect: Eric F's original query was about using nnselect exactly as nnvirtual is used: you add the component groups, put in *no* specification about which articles to display, and then when you enter the select group it simply shows you all articles from the component groups. (I've never looked closely at the nnvirtual code and I don't know how it decides which articles to draw from which component groups. If none of the groups have unread articles, and you request 100 articles from the virtual group, how does it handle sorting and limiting?) Anyway, I spent twenty minutes or so trying to come up with a nnselect-spec that would do this, and failed. If you could point out how we'd go about this, then I think we could say nnselect has a full superset of nnvirtual functionality. Eric ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: nnvirtual groups and article warping 2022-03-04 17:28 ` Eric Abrahamsen @ 2022-03-05 3:02 ` Andrew Cohen 2022-03-05 6:49 ` Andrew Cohen 0 siblings, 1 reply; 16+ messages in thread From: Andrew Cohen @ 2022-03-05 3:02 UTC (permalink / raw) To: ding >>>>> "EA" == Eric Abrahamsen <eric@ericabrahamsen.net> writes: EA> Andrew Cohen <acohen@ust.hk> writes: >>>>>>> "EA" == Eric Abrahamsen <eric@ericabrahamsen.net> writes: >> EA> Eric Abrahamsen writes >> >> [...] >> [...] EA> I agree that there's less and less need for nnvirtual, but also EA> that there's no harm in adding an `nnvirtual-warp-to-article' EA> deffoo, for completeness' sake. Totally agree. EA> I was going to bring this up again, regarding full nnvirtual EA> feature coverage for nnselect: Eric F's original query was about EA> using nnselect exactly as nnvirtual is used: you add the EA> component groups, put in *no* specification about which articles EA> to display, and then when you enter the select group it simply EA> shows you all articles from the component groups. Err, if you mean this literally, then its just the function I have posted several times before. Here it is again: #+begin_src emacs-lisp (defun my-test-virtual (groups) "Combine GROUPS into a virtual group. The nnvirtual backend has a complicated algorithm to interleave the articles from the component groups. This function just concatenates them." (let ((rsv 1) list) (dolist (group groups) (pcase-let ((`(,min . ,max) (gnus-active group))) (push (list group (cons rsv (cons min max))) list))) list)) #+end_src This will do what you say: entering the group will show you all the unread articles from all the component groups. Or if you ask for ALL the articles, it will show you all of them. If you ask for some subset (e.g. with a prefix arg or setting a limit) it will show you that too---just not evenly divided among the component groups. (In some previous versions that I posted I set a limit argument, which ensured that you always retrieved at least this many articles from each group.) But you know this :) The issue is always how we decide to mix articles from the different groups. EA> (I've never looked closely at the nnvirtual code and I don't EA> know how it decides which articles to draw from which component EA> groups. If none of the groups have unread articles, and you EA> request 100 articles from the virtual group, how does it handle EA> sorting and limiting?) It uses a complicated algorithm to achieve what it describes as "fair mixing" among the component groups. I have never had the patience to try to understand it. And it seemed odd anyway---if one of the component groups has had no new messages for years it would still be mixed in equally. And it also favored groups with larger numbers of postings (I think---my memory is fuzzy). EA> Anyway, I spent twenty minutes or so trying to come up with a EA> nnselect-spec that would do this, and failed. If you could point EA> out how we'd go about this, then I think we could say nnselect EA> has a full superset of nnvirtual functionality. Well, try the one above :) But you won't be totally happy. I think I finally figured out how we can implement it---we can use the RSV! (I know, ironic that in our last email exchange I was advocating removing it :)) The issue is that, for lots of reasons, nnselect always collects articles by group; so its a pain to interleave articles. But we should be able to do this rather easily using the RSV---we just have an algorithm to assign RSVs based on something (maybe date? but really we could use any algorithm we like) and then sort first by RSV, and secondly by group (which I think is what nnselect does now anyway). I'll try to find a few minutes to test this. In the meantime, Eric F. can continue to use the existing nnvirtual backend:) Best, Andy -- Andrew Cohen ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: nnvirtual groups and article warping 2022-03-05 3:02 ` Andrew Cohen @ 2022-03-05 6:49 ` Andrew Cohen 0 siblings, 0 replies; 16+ messages in thread From: Andrew Cohen @ 2022-03-05 6:49 UTC (permalink / raw) To: ding >>>>> "AC" == Andrew Cohen <acohen@ust.hk> writes: [...] AC> I think I finally figured out how we can implement it---we can AC> use the RSV! (I know, ironic that in our last email exchange I AC> was advocating removing it :)) Well what do you know, it works! It requires a small modification to the artlist compression routine to prevent resorting by group, but that is no problem. So we just have to decide on the algorithm for mixing the groups and we will have a full replacement for nnvirtual with nnselect. My access rights to the repository are in limbo right now (my copyright assignment needs updating) so I can't push, but once that is sorted out I'll update. -- Andrew Cohen ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: nnvirtual groups and article warping 2022-03-03 23:15 ` Andrew Cohen 2022-03-04 17:28 ` Eric Abrahamsen @ 2022-03-06 12:49 ` Eric S Fraga 2022-03-06 13:04 ` Andrew Cohen 2022-03-06 13:11 ` Andrew Cohen 1 sibling, 2 replies; 16+ messages in thread From: Eric S Fraga @ 2022-03-06 12:49 UTC (permalink / raw) To: ding On Friday, 4 Mar 2022 at 07:15, Andrew Cohen wrote: > Now that nnselect does everything a regular backend does, there > shouldn't be much use for warping. [...] > But I am curious what the use case is? nnvirtual > already does (some) propagation back to the originating groups. The one reason I use warping is to then be able to ask for the thread of messages for the given message. I.e. I often do "A W" followed by "A T". Doing this within nnvirtual (or nnselect) groups does not do anything. -- Eric S Fraga with org 9.5.2 in Emacs 29.0.50 on Debian 11.2 ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: nnvirtual groups and article warping 2022-03-06 12:49 ` Eric S Fraga @ 2022-03-06 13:04 ` Andrew Cohen 2022-03-07 15:35 ` Eric S Fraga 2022-03-06 13:11 ` Andrew Cohen 1 sibling, 1 reply; 16+ messages in thread From: Andrew Cohen @ 2022-03-06 13:04 UTC (permalink / raw) To: ding >>>>> "ESF" == Eric S Fraga <e.fraga@ucl.ac.uk> writes: ESF> On Friday, 4 Mar 2022 at 07:15, Andrew Cohen wrote: >> Now that nnselect does everything a regular backend does, there >> shouldn't be much use for warping. ESF> [...] >> But I am curious what the use case is? nnvirtual already does >> (some) propagation back to the originating groups. ESF> The one reason I use warping is to then be able to ask for the ESF> thread of messages for the given message. I.e. I often do "A ESF> W" followed by "A T". Doing this within nnvirtual (or ESF> nnselect) groups does not do anything. That is a bug (at least for nnselect). I use this constantly in nnselect and it works fine. We should try to track this down; if I had to guess it has something to do with the search engine you are using---I can't recall but think it is notmuch? Best, Andy -- Andrew Cohen ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: nnvirtual groups and article warping 2022-03-06 13:04 ` Andrew Cohen @ 2022-03-07 15:35 ` Eric S Fraga 2022-03-07 23:07 ` Andrew Cohen 0 siblings, 1 reply; 16+ messages in thread From: Eric S Fraga @ 2022-03-07 15:35 UTC (permalink / raw) To: ding On Sunday, 6 Mar 2022 at 21:04, Andrew Cohen wrote: > That is a bug (at least for nnselect). I use this constantly in nnselect > and it works fine. We should try to track this down; if I had to guess > it has something to do with the search engine you are using---I can't > recall but think it is notmuch? Sorry, maybe I confused things: A W works just fine with notmuch searches and nnselect. I was commenting on the need for A W for nnvirtual groups to allow me to see a whole tread using A T (which doesn't work in an nnvirtual group); the question I was answering was what the use case for A W would be if marks etc. were all propagated back to the actual groups. -- Eric S Fraga with org 9.5.2 in Emacs 29.0.50 on Debian 11.2 ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: nnvirtual groups and article warping 2022-03-07 15:35 ` Eric S Fraga @ 2022-03-07 23:07 ` Andrew Cohen 2022-03-08 8:59 ` Eric S Fraga 0 siblings, 1 reply; 16+ messages in thread From: Andrew Cohen @ 2022-03-07 23:07 UTC (permalink / raw) To: ding >>>>> "ESF" == Eric S Fraga <e.fraga@ucl.ac.uk> writes: ESF> On Sunday, 6 Mar 2022 at 21:04, Andrew Cohen wrote: >> That is a bug (at least for nnselect). I use this constantly in >> nnselect and it works fine. We should try to track this down; if >> I had to guess it has something to do with the search engine you >> are using---I can't recall but think it is notmuch? ESF> Sorry, maybe I confused things: A W works just fine with ESF> notmuch searches and nnselect. I was commenting on the need ESF> for A W for nnvirtual groups to allow me to see a whole tread ESF> using A T (which doesn't work in an nnvirtual group); the ESF> question I was answering was what the use case for A W would be ESF> if marks etc. were all propagated back to the actual groups. Got it, thanks. So the use is to get the functionality of A T when using nnvirtual, but not anything else. Thats good, since I think I have solved the remaining issues with emulating nnvirtual with nnselect (in which case A T works correctly). In the end its all pretty trivial except for managing the combined group information (nnvirtual doesn't store any of it, while nnselect does---the information is pretty large because of the interleaving of groups and would cause the newsrc size to balloon if we didn't do something; this is the only change needed to nnselect to make it work). My push rights are in limbo over copyright confusion, but once that is settled I'll push it and get some testing. It should work as an exact drop-in replacement, but we will see if anything is missing. (And I still encourage the alternate paradigm I previously pushed for, which I think would work much better for you :)) Best, Andy -- Andrew Cohen ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: nnvirtual groups and article warping 2022-03-07 23:07 ` Andrew Cohen @ 2022-03-08 8:59 ` Eric S Fraga 0 siblings, 0 replies; 16+ messages in thread From: Eric S Fraga @ 2022-03-08 8:59 UTC (permalink / raw) To: ding On Tuesday, 8 Mar 2022 at 07:07, Andrew Cohen wrote: > Got it, thanks. So the use is to get the functionality of A T when using > nnvirtual, but not anything else. Yes, correct. > My push rights are in limbo over copyright confusion, > but once that is settled I'll push it and get some testing. And I will be happy to test. Thank you, eric -- Eric S Fraga with org 9.5.2 in Emacs 29.0.50 on Debian 11.2 ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: nnvirtual groups and article warping 2022-03-06 12:49 ` Eric S Fraga 2022-03-06 13:04 ` Andrew Cohen @ 2022-03-06 13:11 ` Andrew Cohen 1 sibling, 0 replies; 16+ messages in thread From: Andrew Cohen @ 2022-03-06 13:11 UTC (permalink / raw) To: ding >>>>> "ESF" == Eric S Fraga <e.fraga@ucl.ac.uk> writes: ESF> On Friday, 4 Mar 2022 at 07:15, Andrew Cohen wrote: >> Now that nnselect does everything a regular backend does, there >> shouldn't be much use for warping. ESF> [...] >> But I am curious what the use case is? nnvirtual already does >> (some) propagation back to the originating groups. ESF> The one reason I use warping is to then be able to ask for the ESF> thread of messages for the given message. I.e. I often do "A ESF> W" followed by "A T". Doing this within nnvirtual (or ESF> nnselect) groups does not do anything. I looked back at some of your prior postings to confirm that you are using notmuch. Eric A. found and fixed a serious bug in notmuch thread searching a couple of weeks ago. This could likely be the cause of this bug. -- Andrew Cohen ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: nnvirtual groups and article warping 2022-03-03 19:38 ` Eric Abrahamsen 2022-03-03 23:15 ` Andrew Cohen @ 2022-03-04 8:01 ` Eric S Fraga 2022-03-04 15:45 ` Eric Abrahamsen 1 sibling, 1 reply; 16+ messages in thread From: Eric S Fraga @ 2022-03-04 8:01 UTC (permalink / raw) To: ding Hi Eric, On Thursday, 3 Mar 2022 at 11:38, Eric Abrahamsen wrote: > So this function would instead have to do pretty much what > nnselect-warp-to-article does, namely: > > (deffoo nnvirtual-warp-to-article () > (let* ((cur (if (> (gnus-summary-article-number) 0) > (gnus-summary-article-number) > (error "Can't warp to a pseudo-article"))) > (group-art (nnvirtual-map-article cur))) > (gnus-summary-read-group-1 (car group-art) t t nil > nil (list (cdr group-art))))) > > Does that work? Works very well. And makes perfect sense. Thank you! -- Eric S Fraga with org 9.5.2 in Emacs 29.0.50 on Debian 11.2 ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: nnvirtual groups and article warping 2022-03-04 8:01 ` Eric S Fraga @ 2022-03-04 15:45 ` Eric Abrahamsen 2022-03-04 15:56 ` Eric S Fraga 0 siblings, 1 reply; 16+ messages in thread From: Eric Abrahamsen @ 2022-03-04 15:45 UTC (permalink / raw) To: ding Eric S Fraga <e.fraga@ucl.ac.uk> writes: > Hi Eric, > > On Thursday, 3 Mar 2022 at 11:38, Eric Abrahamsen wrote: >> So this function would instead have to do pretty much what >> nnselect-warp-to-article does, namely: >> >> (deffoo nnvirtual-warp-to-article () >> (let* ((cur (if (> (gnus-summary-article-number) 0) >> (gnus-summary-article-number) >> (error "Can't warp to a pseudo-article"))) >> (group-art (nnvirtual-map-article cur))) >> (gnus-summary-read-group-1 (car group-art) t t nil >> nil (list (cdr group-art))))) >> >> Does that work? > > Works very well. And makes perfect sense. Thank you! Cool! I'll think about adding some more error checking and cleanups, then push it in a few days. ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: nnvirtual groups and article warping 2022-03-04 15:45 ` Eric Abrahamsen @ 2022-03-04 15:56 ` Eric S Fraga 2022-03-04 17:16 ` Eric Abrahamsen 0 siblings, 1 reply; 16+ messages in thread From: Eric S Fraga @ 2022-03-04 15:56 UTC (permalink / raw) To: ding Hi Eric, On Friday, 4 Mar 2022 at 07:45, Eric Abrahamsen wrote: > Cool! I'll think about adding some more error checking and cleanups, > then push it in a few days. Excellent! Will it be possible to have A W invoke this function when in an nnvirtual group? I've currently bound it to something else in any case (<) but it would make sense to have A W act the same in the various groups. Thanks again, eric -- Eric S Fraga with org 9.5.2 in Emacs 29.0.50 on Debian 11.2 ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: nnvirtual groups and article warping 2022-03-04 15:56 ` Eric S Fraga @ 2022-03-04 17:16 ` Eric Abrahamsen 0 siblings, 0 replies; 16+ messages in thread From: Eric Abrahamsen @ 2022-03-04 17:16 UTC (permalink / raw) To: ding Eric S Fraga <e.fraga@ucl.ac.uk> writes: > Hi Eric, > > On Friday, 4 Mar 2022 at 07:45, Eric Abrahamsen wrote: >> Cool! I'll think about adding some more error checking and cleanups, >> then push it in a few days. > > Excellent! > > Will it be possible to have A W invoke this function when in an > nnvirtual group? I've currently bound it to something else in any case > (<) but it would make sense to have A W act the same in the various > groups. "A W" is bound to `gnus-warp-to-article' in all Summary groups already, it just usually doesn't do anything! It looks like warping was only ever implemented for nnir search groups, which have now become nnselect search groups. ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2022-03-08 8:59 UTC | newest] Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2022-03-03 16:54 nnvirtual groups and article warping Eric S Fraga 2022-03-03 19:38 ` Eric Abrahamsen 2022-03-03 23:15 ` Andrew Cohen 2022-03-04 17:28 ` Eric Abrahamsen 2022-03-05 3:02 ` Andrew Cohen 2022-03-05 6:49 ` Andrew Cohen 2022-03-06 12:49 ` Eric S Fraga 2022-03-06 13:04 ` Andrew Cohen 2022-03-07 15:35 ` Eric S Fraga 2022-03-07 23:07 ` Andrew Cohen 2022-03-08 8:59 ` Eric S Fraga 2022-03-06 13:11 ` Andrew Cohen 2022-03-04 8:01 ` Eric S Fraga 2022-03-04 15:45 ` Eric Abrahamsen 2022-03-04 15:56 ` Eric S Fraga 2022-03-04 17:16 ` Eric Abrahamsen
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).