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: Thu, 19 Dec 2024 02:42:14 +0200 Message-ID: <87y10c1p21.fsf@thaodan.de> References: <86zfktesxb.fsf@gmx.net> <87bjx96ln5.fsf@thaodan.de> <86pllozkq4.fsf@gmx.net> <86ldwcziff.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="7900"; 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 Thu Dec 19 01:43:32 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 1tO4dY-0001uu-4b for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 19 Dec 2024 01:43:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tO4d8-0005QB-Ql; Wed, 18 Dec 2024 19:43:07 -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 1tO4d4-0005Po-Qe for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2024 19:43:04 -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 1tO4d4-0001gg-Ac for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2024 19:43:02 -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=kmw52FXM0kgiywsCnMkFlwGhal2gZE3M9KQHiYBF7/M=; b=KXWWCCH6sSqsthEsUbInWO2U0odIQrrXmrfBSZcrVTEuZGBRdk4URC9PafzQjg/A9rsk4l0A9ifGUxgytCZ21FyOo4HgIMzkpY+cu2tZTNZRxqD8qfBxnLdqFmDnqSRVqYfg+TPheOBza6Q2BPv+JEeyDsC0BUFtbw5YFPHZZU9zpX3seGeOSIBmo1VKQXcPvM9IBTBTvL2AwGmZyOe8NDIqsTwkP8zxsJfm+gAVUMXWAqGjbgNC7fTt8hdla5FD3uoTpkXbJ26JwKdSJWmGzyXmta82alm8pngayZI6EAjVVlu7JNV2xO3RjrWr7x8m8IZLCml7ikuP26c5Ul1Frw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tO4d4-0003Dl-3t for bug-gnu-emacs@gnu.org; Wed, 18 Dec 2024 19:43: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: Thu, 19 Dec 2024 00:43: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.173456897512364 (code B ref 74905); Thu, 19 Dec 2024 00:43:02 +0000 Original-Received: (at 74905) by debbugs.gnu.org; 19 Dec 2024 00:42:55 +0000 Original-Received: from localhost ([127.0.0.1]:36577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tO4cw-0003DM-Gc for submit@debbugs.gnu.org; Wed, 18 Dec 2024 19:42:54 -0500 Original-Received: from thaodan.de ([185.216.177.71]:36798) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tO4cu-0003D0-5Q for 74905@debbugs.gnu.org; Wed, 18 Dec 2024 19:42:53 -0500 Original-Received: from NordStern (dsl-trebng12-50dc7b-49.dhcp.inet.fi [80.220.123.49]) by thaodan.de (Postfix) with ESMTPSA id CB3EED00059; Thu, 19 Dec 2024 02:42:15 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thaodan.de; s=mail; t=1734568935; bh=xMkxl57EGr3zHcE3TS+fN0rSia6k2rPDTYL/nnVij8U=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=GZmR7fwA79DHuVdzs3dKWSCQ6CNRKB0KKsE8x2VkMdWzCdndRDwiGeV9o1qKXcz1n rjVraPeQ9kOZhknnMzwbk9gMChtA/7754zz62bMRwvMnm0eYN04nZv7r3gqf2tqar2 uf7ckhWq3xXcG+vdbJem95dR98peuU8fgBn+BTVE6qjIV+Ot6cKUQPOCLRRPe95Jh0 kgBPdJFKG6dgLPOxCmEnWG66oYWx0QEaXjyIE84RLy0gOd7BoSiMYqTB/bMrkqT5US ZVSNeUMtauS9BEKPoxQoY4E7Sq1R/GpaJ3q7FQXbPV7LbiUplhebfyRIOuUN6g92+s sNNlLlEGXgsPFPbvahnxwc6lEUdWbD6Lxtw/AJxEHkScUs73bd8e3BxEoj0KQ4SX/n ukcx2q7Wtldjr+cYTSR1tF4XXMRDclPJqCJyc2H3oHdCXdim1v+H3yHgoGXKaXXsbR G/wDwr4w2SKlvJAliANNbOEJBOTsEMoIlQlAFDPtgjBLL14sT4vMhzD5SvSgKT3Lzf uLJVRCOTXR2f0CoGJIatcN5f/fP7kY9Z0/+RasnFsfY1LU7lVoA5CU4Qs1U2W+nPkd XNxD9lsWFwDxgC+ht4bTDylE/ggdxGnJdEGffpK9zP0ERoroBV+eELW90OeE9YJbNh /u13nINZOhKfMfCmQiTwks38= In-Reply-To: <86ldwcziff.fsf@gmx.net> (James Thomas's message of "Thu, 19 Dec 2024 04:51:24 +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:297354 Archived-At: 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. I took all the explenation for each functions purpose from the manual section linked below: (info "(gnus) Required Back End Functions") 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. 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.