From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#69517: [PATCH] Make gnus cache work with group names having '/' Date: Thu, 28 Mar 2024 11:42:00 +0200 Message-ID: <86h6gqhevr.fsf@gnu.org> 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> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25698"; mail-complaints-to="usenet@ciao.gmane.io" Cc: eric@ericabrahamsen.net, 69517@debbugs.gnu.org, jimjoe@gmx.net To: Daniel Semyonov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Mar 28 10:43:07 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 1rpmHr-0006Vj-DD for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Mar 2024 10:43:07 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rpmHn-0006fy-E7; Thu, 28 Mar 2024 05:43:03 -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 1rpmHl-0006fX-SA for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2024 05:43: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 1rpmHl-0008Ow-Jf for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2024 05:43:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rpmHm-0004PW-6D for bug-gnu-emacs@gnu.org; Thu, 28 Mar 2024 05:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Mar 2024 09:43:02 +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.171161895216827 (code B ref 69517); Thu, 28 Mar 2024 09:43:02 +0000 Original-Received: (at 69517) by debbugs.gnu.org; 28 Mar 2024 09:42:32 +0000 Original-Received: from localhost ([127.0.0.1]:39091 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpmHH-0004NL-UO for submit@debbugs.gnu.org; Thu, 28 Mar 2024 05:42:32 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47308) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rpmHG-0004N7-6t for 69517@debbugs.gnu.org; Thu, 28 Mar 2024 05:42:30 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rpmH9-0008Ky-Rd; Thu, 28 Mar 2024 05:42:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=S2N5k/+GxFhtIfC+0LWAX66trdFttZM/p36k54JKTio=; b=WjTWS8vbrtqC LvVGLvT77KpvvxjZM2N8edCOVewXMMKLYDnw0+j7cfxIxMzZPYgEqFhcbxJ0Xeqg76CM2iXQnfVBG 6muUoaV0sxSsQPGIChoOEH2FrMR86QX91c+snjRxbUYCrXOXU/oOiYAP7qDN0v7+BW2n5x9HAUl3K RkwlFAS8TjpEEk3Qn2aLfIKUkFX0stv0N/1GyKs5Cx+hScO3GASWn8ZNc7LwEVQbhZNOajVjVGoJn i+Yn65/hMz9llC9Bnw6l88LHlNNTe4EU+lvjVvN/EpXoAJh/8hWGrwxb7gdoo2TrmvL1vTXco02Xl 0zp4Chgj7cSnYfEHCKp/iQ==; In-Reply-To: <87zfuzcscp.fsf@dsemy.com> (message from Daniel Semyonov on Fri, 15 Mar 2024 19:33:42 +0200) 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:282201 Archived-At: 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 should 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 whether it > >> wants to be a select method, or a modified version of article saving. > >> 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 created > >> at the top level: with the "/" replaced by "_", and everything else > >> using the proper "left/right" group name. Perhaps "long file names" can > >> still play a role, but if so that should be via > >> `nnmail-use-long-file-names', and gnus-cache in general should behave > >> like a nnmail backend. > > > Well, I have sort of, an approach based on my earlier patch: [patch] > > > 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 the > > directory name was _ or / originally. > > > The above patch tries a possible solution inspired from [1] but would > > break existing users of the cache or agent (xref-find-references > > "nnmail-group-pathname") who have groups with % or / in their names. > > > Seems to work in my limited testing. WDYT? > > I tested it and it seems to work, but I'm pretty sure it will also break > 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 >