From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Daniel Semyonov 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, 15 Mar 2024 19:33:42 +0200 Message-ID: <87zfuzcscp.fsf@dsemy.com> 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> Reply-To: Daniel Semyonov Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="24464"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eric Abrahamsen , Eli Zaretskii , 69517@debbugs.gnu.org To: James Thomas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 15 18:34:47 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 1rlBSB-00062d-Jy for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Mar 2024 18:34:47 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rlBRu-0001tP-9y; Fri, 15 Mar 2024 13:34:30 -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 1rlBRq-0001t8-Mw for bug-gnu-emacs@gnu.org; Fri, 15 Mar 2024 13:34:26 -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 1rlBRq-0007yh-E7 for bug-gnu-emacs@gnu.org; Fri, 15 Mar 2024 13:34:26 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rlBSQ-0002Y5-Gw for bug-gnu-emacs@gnu.org; Fri, 15 Mar 2024 13:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Daniel Semyonov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Mar 2024 17:35: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.17105240849771 (code B ref 69517); Fri, 15 Mar 2024 17:35:02 +0000 Original-Received: (at 69517) by debbugs.gnu.org; 15 Mar 2024 17:34:44 +0000 Original-Received: from localhost ([127.0.0.1]:53700 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlBS8-0002XX-EP for submit@debbugs.gnu.org; Fri, 15 Mar 2024 13:34:44 -0400 Original-Received: from dsemy.com ([46.23.89.208]:46590) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rlBS4-0002XI-OZ for 69517@debbugs.gnu.org; Fri, 15 Mar 2024 13:34:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; s=dkim; bh=lhMUawaL2yEzs GRAAwwwZO95qpx8q8VEWdDi5AwDJYk=; h=date:references:in-reply-to: subject:cc:to:from; d=dsemy.com; b=lTbkGpqxz9pCV4VLw68RFN0pDhXkEnTxqjD tRn91qBjTpAiXv38gVmd3nn3izvrDbQftnNIo+Dw3D2u159TWh7y1HSy1A9mbGLeupfjmG RruzVv35sAX993i+ZySOpDCHUbXRnM+gLFo3zvuRT9vFrdjb7FcOY+JOBI3q4NfYGyXvLM WM0HIAv6v2PX7Olg2+fAjVZrexeIn6mlAxx1N/U+zoss0CdrA+U8o/dd51zes69CQCDz14 AhbhEBj3m17dU7mFAcc6RCftdE8xuWwM+gX+pJfKCdW47WPh1ASIBnRQpEphGlf8pOSoX6 v0iqxXvh4/g3gRu/UoAyYdUqCLw== Original-Received: from coldharbour.local ( [147.235.219.6]) by dsemy.com (OpenSMTPD) with ESMTPSA id 487845a6 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 15 Mar 2024 18:33:57 +0100 (CET) Original-Received: from localhost (coldharbour.local [local]) by coldharbour.local (OpenSMTPD) with ESMTPA id 179a3d64; Fri, 15 Mar 2024 17:33:42 +0000 (UTC) In-Reply-To: <8734sttrxr.fsf@gmx.net> (James Thomas's message of "Thu, 14 Mar 2024 08:56:08 +0530") 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:281693 Archived-At: >>>>> 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