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#69517: [PATCH] Make gnus cache work with group names having '/' Date: Fri, 29 Mar 2024 05:39:50 +0530 Message-ID: <87y1a199v5.fsf@gmx.net> References: <87wmqkcc9u.fsf@outlook.com> <86wmqbyews.fsf@gnu.org> <8734szul14.fsf@gmx.net> <874jde7j2c.fsf@ericabrahamsen.net> <87v85u5448.fsf@ericabrahamsen.net> <8734sttrxr.fsf@gmx.net> <87zfuzcscp.fsf@dsemy.com> <86h6gqhevr.fsf@gnu.org> Reply-To: James Thomas Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29343"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: eric@ericabrahamsen.net, Daniel Semyonov , 69517@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 29 01:11:29 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 1rpzqC-0007Qf-49 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 29 Mar 2024 01:11:28 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpzpm-0001v2-92; Thu, 28 Mar 2024 20:11:02 -0400 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 1rpzpl-0001uu-DN for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2024 20:11:01 -0400 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 1rpzpl-0008O9-4l for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2024 20:11:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rpzpl-00032v-Mx for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2024 20:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: James Thomas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Mar 2024 00:11:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69517 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 69517-submit@debbugs.gnu.org id=B69517.171167101911500 (code B ref 69517); Fri, 29 Mar 2024 00:11:01 +0000 Original-Received: (at 69517) by debbugs.gnu.org; 29 Mar 2024 00:10:19 +0000 Original-Received: from localhost ([127.0.0.1]:41302 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpzp4-0002zP-H8 for submit@debbugs.gnu.org; Thu, 28 Mar 2024 20:10:18 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:59319) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpzp0-0002yS-UZ for 69517@debbugs.gnu.org; Thu, 28 Mar 2024 20:10:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1711670996; x=1712275796; i=jimjoe@gmx.net; bh=iB1X52Ox8oYclANbwoPmXRHaSnX0DGG2AXH+i+DlQ+o=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References: Date; b=f7WjMaG8lj5TM9jt6TBCC2FyaFXAAiDlpQ/WBii9OFYclDMvcksgPWNYI73qMXKH eg0paCKMFS/1lk6u1UdBct2k95GFxPCx/L4/dwTPAFrXd2lPrZuzqmUYWji+ls1aF +UxmU5HEKD9D0bSxLX+qWA9OZDP6+vsstS/h+Nq3IAY90xXCDyIWxwMXXyFsMkEjM 9uxElaoLP9pT5b1FvtRWs/8um5PcqM4gfUj/B/8EeyB0Y5fSeXmeuFnU7PNcuA+87 vT5g7TqabWUEFucDzAX0RyiLE/+SD3W1udHna5qNQeym/5PPNq3QW2LW+eQEBxB6u kKEhbPuHUb8/YcojqA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from user-Inspiron-15-5518 ([59.92.166.60]) by mail.gmx.net (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1M4s0t-1rocEu2En1-001yii; Fri, 29 Mar 2024 01:09:56 +0100 In-Reply-To: <86h6gqhevr.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 28 Mar 2024 11:42:00 +0200") X-Provags-ID: V03:K1:A90tyZuQT5vKoQx/xjguBhrakDQ6F4Bl3mhbg+iKrNi5+4wPBcr kT2jBOsGCbX9u94Kd63skv/Bzmw93Cxvvkc+nu9N6p2I2fpDHOs1HS6mWLHne6aBl4/PUQQ SURR0FOsSL7Gg39NCFk53+TlEycrmosZ2XnIoZSrv9XuffFbCV6RKf9X9hCRxLEN+XcHsQN JAJYLPySnf7lY6HHeKCEA== UI-OutboundReport: notjunk:1;M01:P0:8aUH6kTGjMg=;pJjLAFFDmNhVjFlUJKzoCcoISrG XCVezWW+lk4OFRP91pEEMLtpshZKPLMozZBhw+TF2+n9mbW1NWC40+7B8LAkP8Nk0Z9rNUVnu qeUd+mZvsXWK5us0bb0eqOdjfJXQ1pVykOZHvHajvtkxl/EqhvcRt5aeC9tCCD+gnneyyXG3x 5a+FFULLxKTJ02d+wOl2NC/SNYqdg7/FX7evWui2LPRLi0GIR3bOTpYzGKOSpQLrsroRfKiZ2 FchWFNjkigPrXvoI8YWt0AaUfAKBJlxYan1V9HCKORjN+e7F1TD/sUY65pC0zh0ttdBoxY2bi lvdSUiJPRY7elpljVZPkbTIoReh15W4N/g5oiLHgXsvlelvjCjFvqnaxLaTTqEMLrlR31Bsh2 hxEziB+tpASagbjF0Sac3LoxR1+atfvCQC0fZuKN5pJjG/1MNMXQzLd1lqJyqI1B153ZHmecM zvmKsFuQm/Ci31KlmMwtkMTThVEWEHkmyIAkBmE3PtbdOCM2Abk1ibEe9ye3oX8YM2r3oDMPi eKhpfZV+czzjCfK6v3ji6niVZSvvLdxqAGuqv0VxfzdzFaS8KdSOYnaofsrgNA0ia3hwHm1j9 hb3qVrPf8qDEGPzuIl+R1rj/g2zpwlgbNIQZhnIzahyK8GkyPeYBXpiMcIVzY9FrSlktZtkoL FiFLkvtvaKbMxegaekbfi0sGuIIQSGMLkmxMb738XeqvxHjXnWBJxszjnB5qSiLF60dbcMP7/ 6sNAzogq00sir3TOPoZm6bycbTy0foBx7QkzmadZQUWIB8LB4MtIQlIB+bC/ApMV22h4DohD 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:282263 Archived-At: Eli Zaretskii wrote: > Ping! Is there anything else left to be done here, or should we close > this? > >> From: Daniel Semyonov >> Cc: 69517@debbugs.gnu.org, Eric Abrahamsen , = Eli >> Zaretskii >> Date: Fri, 15 Mar 2024 19:33:42 +0200 >> >> >>>>> James Thomas writes: >> >> > Eric Abrahamsen wrote: >> >> The real problem (well, one of the real problems) is that we sho= uld just >> >> have two central routines for reading and writing active files, = so that >> >> there are only two places to keep in sync. Instead we have those= two >> >> places, and then a smattering of other functions in other places= that do >> >> something similar, and also have to be kept in sync, and I haven= 't done >> >> that. At the very least I'll need to apply your patch from 65467= . >> >> >> >> The other real problem is that gnus-cache is confused about whet= her it >> >> wants to be a select method, or a modified version of article sa= ving. >> >> The presence of `gnus-use-long-file-name' indicates the latter, = but the >> >> manual's instructions about the nnml select method indicates the= former. >> >> >> >> I think it should be a select method, which means that the group >> >> directory should be created in "News/cache" the same way it is c= reated >> >> at the top level: with the "/" replaced by "_", and everything e= lse >> >> using the proper "left/right" group name. Perhaps "long file nam= es" can >> >> still play a role, but if so that should be via >> >> `nnmail-use-long-file-names', and gnus-cache in general should b= ehave >> >> like a nnmail backend. >> >> > Well, I have sort of, an approach based on my earlier patch: [pat= ch] >> >> > James Thomas wrote: >> >> >> + (if (not nnmail-use-long-file-names) >> >> + (nnheader-replace-chars-in-string group ?. ?/) >> >> + group)) >> >> > Since directory names cannot have '/' they used to be replaced by= '_' in >> > group names before conversion. But this makes it impossible, when >> > generating (non-existent) active files to know whether a '_' in t= he >> > directory name was _ or / originally. >> >> > The above patch tries a possible solution inspired from [1] but w= ould >> > break existing users of the cache or agent (xref-find-references >> > "nnmail-group-pathname") who have groups with % or / in their nam= es. >> >> > Seems to work in my limited testing. WDYT? >> >> I tested it and it seems to work, but I'm pretty sure it will also brea= k >> existing groups with % or / in their names in several backends. >> For example, the `nnmh' and `nndiary' backends use this function to >> locate groups on disk, which will fail for those groups (unless users >> rename the files manually). >> >> FWIW I think this approach is good, but since Gnus doesn't even emit a >> warning currently when creating a group with % in its name, I don't >> think breaking these groups is a good idea. >> >> Daniel >> I've been using this since then, on master, with no problems. Let me add to my earlier reasons for being confident about this not breaking existing setups: James Thomas wrote: > I think only one of these combinations is likely to be a problem in > practice: groups such as [Gmail]/Drafts. I've never seen a % in a > group name. The cache wouldn't work for one with / anyway (this bug) > and as far as the agent is concerned, none of the Gmail groups with > spaces in them work anyway (bug#65467: note that the patch on this is > also needed for the agent to work on these groups with /). I haven't > used nnmh or nndiary but I don't think they normally use group names > with '/'. The only ones with '/' (and no spaces) I know of are the Gmail groups, namely: [Gmail]/Bin [Gmail]/Drafts [Gmail]/Important [Gmail]/Spam [Gmail]/Starred ...which are unlikely to be agentized because of their nature (though ideally the patch at bug#65467 ought to be applied as well, after this). Moreover, getting Gmail to work with Gnus requires a paid account and a complicated setup with OAuth2 (AFAIK, because I use one) which only few people are likely to have managed. Lastly, the fix for such an unlikely existing setup is a simple rename of the directory: say, from [Gmail]_Drafts to [Gmail]%2FDrafts. Regards, James