From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.bugs Subject: bug#69517: [PATCH] Make gnus cache work with group names having '/' Date: Sat, 09 Mar 2024 21:27:23 -0800 Message-ID: <874jde7j2c.fsf@ericabrahamsen.net> References: <87wmqkcc9u.fsf@outlook.com> <86wmqbyews.fsf@gnu.org> <8734szul14.fsf@gmx.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5666"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 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 Sun Mar 10 06:28:55 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 1rjBjz-0001Dl-64 for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 10 Mar 2024 06:28:55 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rjBjb-0003VJ-2k; Sun, 10 Mar 2024 00:28:31 -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 1rjBjY-0003Uu-Vs for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 00:28:29 -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 1rjBjY-00057M-K4 for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 00:28:28 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rjBk5-0000jR-JR for bug-gnu-emacs@gnu.org; Sun, 10 Mar 2024 00:29:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 10 Mar 2024 05:29: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.17100484892748 (code B ref 69517); Sun, 10 Mar 2024 05:29:01 +0000 Original-Received: (at 69517) by debbugs.gnu.org; 10 Mar 2024 05:28:09 +0000 Original-Received: from localhost ([127.0.0.1]:35240 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjBjE-0000iF-RU for submit@debbugs.gnu.org; Sun, 10 Mar 2024 00:28:09 -0500 Original-Received: from mail.ericabrahamsen.net ([52.70.2.18]:52528) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rjBjA-0000hi-Uj for 69517@debbugs.gnu.org; Sun, 10 Mar 2024 00:28:06 -0500 Original-Received: from localhost (71-212-21-65.tukw.qwest.net [71.212.21.65]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 6CE4AFA183; Sun, 10 Mar 2024 05:27:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1710048444; bh=v570m11nM7Kx4Qjsf9EzRWnYFN0rkK1EN99ZT2eeRFo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=AZDgjT3q+hLbzo7MXzANgrOz/puPvBOoMmPAK2h1mUhLPHcvu5GK54cwHTy471S09 tCLIF9ku9I7YpH3bYHoy7O9wZV3o9d8eyLJ3zSfY7G3nyhsCYvjvDWl0luqRxOJBeO 68gIeH3G0F+G/EW8pYchrCVhYDfGK8ZvQ0dqeQoo= In-Reply-To: <8734szul14.fsf@gmx.net> (James Thomas's message of "Sun, 10 Mar 2024 03:26:23 +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:281368 Archived-At: James Thomas writes: > Eli Zaretskii wrote: > >>> Date: Sun, 03 Mar 2024 07:22:29 +0530 >>> From: James Thomas via "Bug reports for GNU Emacs, >>> the Swiss army knife of text editors" >>> >>> Tags: patch >>> >>> Reproduction steps: >>> >>> - Setup Gnus with any group name having a slash ('/') such as >>> "[Gmail]/Drafts" or an Atom feed (they usually have slashes) using the >>> patch in bug#66188. >>> >>> - Press '*' on a message in the group. >>> >>> - Do (info "(gnus) Creating a Virtual Server") >>> >>> - Open the above from the Server buffer; RET on the new group fails. >>> >>> A patch is attached. I couldn't find the problematic commit or its >>> original branch (where it was a consolidated merge from) but >>> 'gnus-use-long-file-names' is apparently not meant for backends: it >>> can't even be customized with that 'not-cache' option. I think this is >>> the right way to solve it: the other lines removed in this patch are >>> even older, but they were never being called due to the above reason. >> >> Eric, could you please review the patch and install if it's okay? >> >> Thanks. > > There's a small caveat after applying this: > > Before this patch, cache entries would've effectively ignored > 'nnmail-use-long-file-names' (nil by default) and used long names. After > this patch new entries would honor it, resulting in an extra directory > tree for the same group. But only the original one would be opened (due > to [[./lisp/gnus/nnmail.el::;; If this direc]]). To fix it, one would > have to copy all the files in from the original directory into the new > one (and retain the active file entry). Or of course, change the above > variable (but that could have other implications depending upon one's > configuration). Thanks for reporting this! Obviously something is wrong here, but I get different results from your reproduction recipe (I'm running master): when I create the cache nnml server and hit RET on it, I get: K 1: nnml:left.right K 1: nnml:left/right I am able to subscribe to both groups. When I return to the *Group* buffer, I can enter the version of the group with the ".", and read the cached article, while attempting to enter the version with the slash gives me "Invalid group (no such directory)". On disk, the "News/cache/active" file starts out with the version with the ".", and after I create the extra cache server it contains both, it looks like: "nnml:left.right" 1 1 y "nnml:left/right" 1 1 y Meanwhile, the directory structure "News/cache/nnml:left/right/1" is created. The "." in the active file comes from `gnus-cache-generate-active`, and that mechanism seems to be working fine, at least in my case -- do you not see that version of the group? To be honest I have no idea what's happening in `gnus-cache-file-name'. I'd be hesitant to remove all that code without understanding it better And I don't think we can argue that that code is "dead" just because it is behind an option value that isn't one of the customization options. Anyway, it would be good to first know why you're not seeing the "." version of the offending filename, and then I guess try to work out what's going on with the file names. It kind of looks like a collision between two different mechanisms -- one that translates "/" to "_" to prevent unwanted filesystem hierarchies, and one that translates between "/" and "." in order to convert newsgroup-name dot hierarchies into filesystem hierarchies. In this case, it seems like "long names" and newsgroup hierarchies shouldn't be applicable at all. Eric