unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: James Thomas via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 69517@debbugs.gnu.org
Cc: Eric Abrahamsen <eric@ericabrahamsen.net>, Eli Zaretskii <eliz@gnu.org>
Subject: bug#69517: [PATCH] Make gnus cache work with group names having '/'
Date: Mon, 11 Mar 2024 03:02:01 +0530	[thread overview]
Message-ID: <87ttldu626.fsf@gmx.net> (raw)
In-Reply-To: <874jde7j2c.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sat, 09 Mar 2024 21:27:23 -0800")

(This is an interim untested opinion before I can backup my existing
messages and verify it...)

Eric Abrahamsen wrote:

> 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?

`gnus-cache-generate-active` seems to be run if the active file doesn't
exist already (i.e. at the very start when creating a server): I was
adding new groups to an existing server. If my guess is right, that
first line with the dot being generated is a way of reversing the
earlier 'dot -> slash' when turning a group into a directory name. That
should be fixed as well if group names with slash have to be supported.

> while attempting to enter the version with the slash gives me "Invalid
> group (no such directory)".

Could you try entering it with this patch applied?

>
> 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.

I think if the original group name contains dots, that should be part of
the hierarchy. But not slashes.

> 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.

Hmm..

> 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.

I think this patch is on those lines, isn't it?

Regards,
James





      parent reply	other threads:[~2024-03-10 21:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-03  1:52 bug#69517: [PATCH] Make gnus cache work with group names having '/' James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-09  8:42 ` Eli Zaretskii
2024-03-09 21:56   ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-10  5:27     ` Eric Abrahamsen
2024-03-10 18:33       ` Eric Abrahamsen
2024-03-14  3:26         ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-15 17:33           ` Daniel Semyonov via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-16  0:22             ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-28  9:42             ` Eli Zaretskii
2024-03-29  0:09               ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-03-30 22:21                 ` Eric Abrahamsen
2024-03-10 21:32       ` James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87ttldu626.fsf@gmx.net \
    --to=bug-gnu-emacs@gnu.org \
    --cc=69517@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=eric@ericabrahamsen.net \
    --cc=jimjoe@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).