From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Bj=C3=B6rn?= Bidar via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74905: [PATCH] Implement search for nnvirtual Gnus groups Date: Fri, 20 Dec 2024 10:17:38 +0200 Message-ID: <46450.2967822895$1734682775@news.gmane.org> References: <86zfktesxb.fsf@gmx.net> <87bjx96ln5.fsf@thaodan.de> <86pllozkq4.fsf@gmx.net> <86ldwcziff.fsf@gmx.net> <87y10c1p21.fsf@thaodan.de> <86v7ve9658.fsf@gmx.net> Reply-To: =?UTF-8?Q?Bj=C3=B6rn?= Bidar Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39764"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 74905@debbugs.gnu.org To: James Thomas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 20 09:19:27 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1tOYEI-000ACM-T5 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Dec 2024 09:19:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOYDx-0001AD-D1; Fri, 20 Dec 2024 03:19:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tOYDv-0001A2-IG for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 03:19:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tOYDv-0001dG-A0 for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 03:19:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=lqnarvVq3KDnCnvcK+ZVZQnP1P3GIo01LN9DWcDVsJI=; b=eSv36iiXC1Mu72iSFkimTg4bkBj2wOlX413I5F5SOCSAU/a7XuhH5RL8w4cwcr5Z5uTLrdAL5ilUAkxzn6oy3M8YUQ4mbKXzRQKVuxqoKK2kIJBJ+eoBaliJLbFX/8HezkqX2BaXV4xexiXBFd8OJ/W2BXfI0y2XP7SkcUhCzCqOa250xtSXr/FhdkR33XEcdkwhgtxqrI9Vmv+dH3umujLxnFvx/8e7/zXQSpuLdcjkrpnNOApI/Zn+182TVucV2Yq3j211+xWzkOqH1GsELkrB/4zhq6OHaivpH9X81mcxhQkS7EKgZNUGGo6wzWN5CvN973KcOf197ZF5LzF+RA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tOYDu-0002dq-Iy for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 03:19:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Bj=C3=B6rn?= Bidar Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Dec 2024 08:19:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74905 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74905-submit@debbugs.gnu.org id=B74905.173468269910086 (code B ref 74905); Fri, 20 Dec 2024 08:19:02 +0000 Original-Received: (at 74905) by debbugs.gnu.org; 20 Dec 2024 08:18:19 +0000 Original-Received: from localhost ([127.0.0.1]:41553 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOYDC-0002cZ-W9 for submit@debbugs.gnu.org; Fri, 20 Dec 2024 03:18:19 -0500 Original-Received: from thaodan.de ([185.216.177.71]:34638) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOYDA-0002cH-2n for 74905@debbugs.gnu.org; Fri, 20 Dec 2024 03:18:17 -0500 Original-Received: from odin (dsl-trebng12-50dc7b-49.dhcp.inet.fi [80.220.123.49]) by thaodan.de (Postfix) with ESMTPSA id 20C0AD00072; Fri, 20 Dec 2024 10:17:39 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thaodan.de; s=mail; t=1734682659; bh=SWmV6mo4/p9/0HaObmYbffJ/9tOvTadNDd2TQ8k5Bcs=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=o0SNKmNquBWF3R6JBhrtt/aaMWWjwnAX2hlVf61RrmAfwq8h+cE7N1J00PCpbFpMs nPCMVW8WTTYNmxXwjeBnpztu7jxEcZVEqqc3v2O5ervoYaPanvbHqJH1joy9KghBH9 Qx1xpGsUsmg8lpTyZ+4IK7ZdSAlLh6e2uvyUnp7v6F6siRKADUmeBUDN9eEg4fZpDu ClNwPNVdQJsiXJt7oCcmALUegYJk0rLwmIXdvxEz2/Of5nKM2CuKSPQkQKHbaGo8sQ RaLCxhzZ3J/4vCxuCHdBGEh9SoySz4XrVApW5RCAO+UjQrroigtkawHy5uR6EQkBLR 77k/DNt9Ad5OZNiY7gNiyvIr2J5m5Q4f20j5coY8Jws2uu/RdRUQVPXCy645xnRcrc /dMTvDJitIG/sAf5o9LcG6DYNVu73HYeasQG4zK4N47HIYMEkJNW9FLYWMJ7Z7mxVH Baih4S/Q9hBKdKaVtMwv+wCmkr4ab8ygTGqvOjZHmmQWhQWXq2tUNltVUeprCdoRIL OS57803hw2KBbABHbjKLFcp2u2eBod3JrewjD/1VDV8ekB1VEje6IaUqfxo9o6JQrg gxeXf5jHNgE5NO+QHozqvFPUnQHqsVHc1+BNwixZK+S7AGpV0cVxdFaB/+i+l+ivn5 cpzLbj+GTflXP0DmUAknFZQg= In-Reply-To: <86v7ve9658.fsf@gmx.net> (James Thomas's message of "Fri, 20 Dec 2024 12:45:47 +0530") Autocrypt: addr=bjorn.bidar@thaodan.de; prefer-encrypt=nopreference; keydata= mDMEZNfpPhYJKwYBBAHaRw8BAQdACBEmr+0xwIIHZfIDlZmm7sa+lHHSb0g9FZrN6qE6ru60JUJq w7ZybiBCaWRhciA8Ympvcm4uYmlkYXJAdGhhb2Rhbi5kZT6IlgQTFgoAPgIbAwULCQgHAgIiAgYV CgkICwIEFgIDAQIeBwIXgBYhBFHxdut1RzAepymoq1wbdKFlHF9oBQJk1/YmAhkBAAoJEFwbdKFl HF9oB9cBAJoIIGQKXm4cpap+Flxc/EGnYl0123lcEyzuduqvlDT0AQC3OlFKm/OiqJ8IMTrzJRZ8 phFssTkSrrFXnM2jm5PYDoiTBBMWCgA7FiEEUfF263VHMB6nKairXBt0oWUcX2gFAmTX6T4CGwMF CwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQXBt0oWUcX2hbCQEAtru7kvM8hi8zo6z9ux2h K+B5xViKuo7Z8K3IXuK5ugwA+wUfKzomzdBPhfxDsqLcEziGRxoyx0Q3ld9aermBUccHtBxCasO2 cm4gQmlkYXIgPG1lQHRoYW9kYW4uZGU+iJMEExYKADsCGwMFCwkIBwICIgIGFQoJCAsCBBYCAwEC HgcCF4AWIQRR8XbrdUcwHqcpqKtcG3ShZRxfaAUCZNf2FQAKCRBcG3ShZRxfaCzSAP4hZ7cSp0YN XYpcjHdsySh2MuBhhoPeLGXs+2kSiqBiOwD/TP8AgPEg/R+SI9GI9on7fBJJ0mp2IT8kZ2rhDOjg gA6IkwQTFgoAOxYhBFHxdut1RzAepymoq1wbdKFlH X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:297438 Archived-At: James Thomas writes: > Bj=C3=B6rn Bidar wrote: > >> James Thomas writes: >> >>> James Thomas wrote: >>> >>>> Bj=C3=B6rn Bidar wrote: >>>> >>>>> James Thomas writes: >>>>> >>>>>> Bj=C3=B6rn Bidar wrote: >>>>>> >>>>>>> This patch implements search for nnvirtual. I'm using >>>>>>> publi-inbox's >>>>>>> with nnvirtual to group each group into one. >>>>>>> However searching wasn't possible in these nnvirtual groups. >>>>>>> I implemented gnus-search-run-search based on the existing >>>>>>> nnselect gnus-search-run-search function. >>>>>> >>>>>> Thanks! I haven't looked into it, but here are some quick comments: >>>>>> >>>>>>> I'm looking for feedback on the patch. I don't exactly know how >>>>>>> the search function is called when multiple groups of the same >>>>>>> type >>>>>>> are >>>>>>> involved. For nnvirtual each group is its on server, does that >>>>>>> mean >>>>>>> the >>>>>>> function will be always called only for each group? In that case >>>>>>> everything should be good. >>>>>> >>>>>> That seems to be the case: see >>>>>> gnus-group-read-ephemeral-search-group >>>>>> and gnus-group-make-search-group. >>>>> >>>>> OK good than my understanding from my tests matched with the rest of >>>>> the >>>>> code. >>>>> Thanks for these examples I haven't looked at the create group >>>>> functions >>>>> as the searched methods don't have to create groups even when they >>>>> start >>>>> a new search by another backend just like e.g. if the user would >>>>> call >>>>> a >>>>> search on another imap group. >>>>> >>>>>>> +(deffoo nnvirtual-request-list (&optional server) >>>>>>> + (when (nnvirtual-possibly-change-server server) >>>>>>> + (with-current-buffer nntp-server-buffer >>>>>>> + (erase-buffer) >>>>>>> + (dolist (group nnvirtual-component-groups) >>>>>>> + (insert (format "%S 0 1 y\n" group)))) >>>>>>> + t)) >>>>>> >>>>>> Did you check if gnus-start.el#L1801 withstands this? It seems to >>>>>> me >>>>>> to >>>>>> assume that nnvirtual doesn't have -request-list. >>>>> >>>>> It does. If the user has falsely add nnvirtual to one of the select >>>>> methods than it will call it try to call the function which doesn't >>>>> fail >>>>> or do anything. The only thing that happens from that is it will >>>>> show >>>>> the false results as groups contained in the nnvirtual method >>>>> without >>>>> a >>>>> parameter. >>>> >>>> No, I mean, the point of that code seems to be that nnvirtual is >>>> activated _last_, i.e. after any component groups of other backends. >>> >>> No, sorry, I was a little confused about this. But it seems to me that >>> -request-group removes each group from the component list (unlike your >>> -request-list). Is that relevant? IDK. The latter seems to do info >>> updation as well, based on -always-rescan. >>> >> >> Request list supposed to list the available groups on the server it is >> also for example used in gnus-search-imap class gnus-search-run-search >> function. Since for the case of nnvirtual all groups on the server >> are all groups contained in the group it is the right function. > > True, but since it returns the group data like -request-group and often > acts as a _substitute_, shouldn't it mimic its operation? If not, is > there a good reason? It does mimic it's operation or doesn't it? >> I took all the explenation for each functions purpose from the manual >> section linked below: >> (info "(gnus) Required Back End Functions") > > Please do look at how they're called, as well; for a fuller picture. > >> To me the code just reads like that that for nnvirtual >> the groups are activated this way only because >> it doesn't have request list. >> >>> >>> No, I mean, the point of that code seems to be that nnvirtual is >>> activated _last_, i.e. after any component groups of other backends. And >>> it's not just select methods: even Foreign Groups are included, no? >>> >>>> Should verify that nnvirtual has arguments? So far it is possible >>>> to add nnvirtual to select methods with "" but this is invalid. >>> >>> I'm not sure what you mean, but it does have arguments: the components >>> regexp, for one. >>> >> >> It does have arguments exactly but you can add nnvirtual without >> arguments or technically an empty argument to select methods. >> >>>> If nnvirtual isn't added to select methods nothing happens besides >>>> the regular activation. >>> >>> Couldn't someone have added one? Say, with the above argument? >> >> I guess so but that isn't the intended way of using nnvirtual, >> also it wouldn't take care of the request of the setup such >> as creating the associated group. > > Well now you've made me look at it... :-) > > Try this: > > - In *Groups*: j nnvirtual:Test RET > - S l 3 RET > - e "nnvirtual:Test" C-c C-c > - q > - Add to -secondary-select-methods: > > (nnvirtual "Test" > (nnvirtual-component-regexp > ;; Put in some group you have. > "^$\\|\\(^nnml\\+archive:sent$\\)")) > > M-x gnus > >> Regular activation meant in this context that the request-list function >> is called but without a argument the nnvirtual-server doesn't contain >> any groups. > > OK. But I don't think I've come across that term. > > Also, your -request-list makes the component groups subscribable from > the Server buffer. That seems wrong too: the backend ought to have only > one (umbrella) group, no? It only has one group containing other groups yes. The backend is not supposed to end up in the Server but is only there if it falsely was added to the select-methods. Anyway I need a backtrace from the case where the search did not work with nnml groups.