From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: James Thomas 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 12:45:47 +0530 Message-ID: <86v7ve9658.fsf@gmx.net> References: <86zfktesxb.fsf@gmx.net> <87bjx96ln5.fsf@thaodan.de> <86pllozkq4.fsf@gmx.net> <86ldwcziff.fsf@gmx.net> <87y10c1p21.fsf@thaodan.de> Reply-To: James Thomas 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="13210"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 74905@debbugs.gnu.org To: =?UTF-8?Q?Bj=C3=B6rn?= Bidar Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 20 08:17: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 1tOXGI-0003GV-6c for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 20 Dec 2024 08:17:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tOXG4-0007Li-CO; Fri, 20 Dec 2024 02:17:12 -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 1tOXG1-0007KZ-Lq for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 02:17:10 -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 1tOXFu-0006CQ-FG for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 02:17:08 -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=fvYp9uFDfB3UxJcx8roWTixGJ1qTd2lfGN3XMGzcF5U=; b=YGJevimnSbuYfQPQZMjN9JLFcyOxgeWX7H99Eqdx6CF35RsVZW9X2WclzjNfPq00DNgTA0XJwGoOcG+vM0LFrknV3AagmTvRJ8Atm9Rt8snTBKZAt7QuGI9QC5VZpW0MUX+3BasO310gNiia9P0Ugk9jJqY2aQ0VMXNTut+2uP7Ch/X3nINDFTG/G161/L9cn7yLwkSsIzP5sEnYytGKvsOdoI15zzUv46mnq5a4YT8xrx2/dReC8lqzzP2ga+Pw/uhF6I67ZR+dHom3SeS0DD69W3FRQf8e71EhHWN34JzADJEtV0H8phENsMJbEn0q8MSn1aWjrn7/kIApKevsFw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tOXFu-00088E-9M for bug-gnu-emacs@gnu.org; Fri, 20 Dec 2024 02:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: James Thomas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 20 Dec 2024 07:17: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.173467896931168 (code B ref 74905); Fri, 20 Dec 2024 07:17:02 +0000 Original-Received: (at 74905) by debbugs.gnu.org; 20 Dec 2024 07:16:09 +0000 Original-Received: from localhost ([127.0.0.1]:41425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOXF3-00086d-8Y for submit@debbugs.gnu.org; Fri, 20 Dec 2024 02:16:09 -0500 Original-Received: from mout.gmx.net ([212.227.17.22]:43887) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tOXEx-000864-LA for 74905@debbugs.gnu.org; Fri, 20 Dec 2024 02:16:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1734678956; x=1735283756; i=jimjoe@gmx.net; bh=fvYp9uFDfB3UxJcx8roWTixGJ1qTd2lfGN3XMGzcF5U=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=T9vgUqQcl7i9vkb5ga9NoPsOLwj7M0m3cwrqcpS/xTukxGbVntgWxHY7h6vJXAKg I1UnmC1TAWSmcg48k87KeTUMAahkBaggoP3khWd/dTx/XC/NxMp3Xtg10qW/E5yDt qJz8Kb7NiyB8kM51NdRn4tjYks9TcuOE/e4R0erVrPNzCfw5F7Dg6n7e/6Dyst5Ui hPhBfj8jB2zholkJm9ghO3XvU6jY3ZJ7wvi6HeXqfXq0wNr3wPBwa+I/qsDskVEZD sBTX1EvxEF4YvH+nQ+1XkrI6aXE4i768TirfTsscPSxGU36UQpnDIyvrbZ0/Q4ZEo Z6R2lyNTS3WohYGU4w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from user-Inspiron-3493 ([42.108.30.49]) by mail.gmx.net (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MhD2Y-1u2nwP482M-00hNoh; Fri, 20 Dec 2024 08:15:56 +0100 In-Reply-To: <87y10c1p21.fsf@thaodan.de> ("=?UTF-8?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Kvitolps bWk1EUdcPpm4I5uzjPN2w8g6Yxm2hfmzE3iF3Cr19Er2WGDNrkiCXrrUk1SFJ4Her/Ru5KYl 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:297429 Archived-At: 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? > 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$\\)")) =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20 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? --