unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#69517: [PATCH] Make gnus cache work with group names having '/'
@ 2024-03-03  1:52 James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-03-09  8:42 ` Eli Zaretskii
  0 siblings, 1 reply; 12+ messages in thread
From: James Thomas via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-03-03  1:52 UTC (permalink / raw)
  To: 69517

[-- Attachment #1: Type: text/plain, Size: 1110 bytes --]

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.

In GNU Emacs 30.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.33, cairo version 1.16.0) of 2024-02-20 built on
 user-Inspiron-15-5518
Repository revision: 466800591c2bd674b0b967205147d7519da7e1a4
Repository branch: nnatom-master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101004
System Description: Ubuntu 22.04.3 LTS


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Make-gnus-cache-work-with-group-names-having.patch --]
[-- Type: text/patch, Size: 1521 bytes --]

From e0b4a71bf241d6faaa46bea58a4688f1e9c932b8 Mon Sep 17 00:00:00 2001
From: James Thomas <jimjoe@gmx.net>
Date: Sun, 3 Mar 2024 06:58:49 +0530
Subject: [PATCH] Make gnus cache work with group names having '/'

Replace the incorrect `gnus-use-long-file-name` with
`nnmail-use-long-file-names`.

* lisp/gnus/gnus-cache.el (gnus-cache-file-name):
---
 lisp/gnus/gnus-cache.el | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/lisp/gnus/gnus-cache.el b/lisp/gnus/gnus-cache.el
index 961219eee8f..d174ee9a9f4 100644
--- a/lisp/gnus/gnus-cache.el
+++ b/lisp/gnus/gnus-cache.el
@@ -448,16 +448,12 @@ gnus-cache-file-name
    (file-name-as-directory
     (expand-file-name
      (nnheader-translate-file-chars
-      (if (gnus-use-long-file-name 'not-cache)
-	  group
-	(let ((group (nnheader-replace-duplicate-chars-in-string
-		      (nnheader-replace-chars-in-string group ?/ ?_)
-		      ?. ?_)))
-	  ;; Translate the first colon into a slash.
-	  (when (string-match ":" group)
-		  (setq group (concat (substring group 0 (match-beginning 0))
-				      "/" (substring group (match-end 0)))))
-	  (nnheader-replace-chars-in-string group ?. ?/)))
+      (let ((group (nnheader-replace-duplicate-chars-in-string
+		    (nnheader-replace-chars-in-string group ?/ ?_)
+		    ?. ?_)))
+	(if (not nnmail-use-long-file-names)
+            (nnheader-replace-chars-in-string group ?. ?/)
+	  group))
       t)
      gnus-cache-directory))))

--
2.34.1


[-- Attachment #3: Type: text/plain, Size: 4 bytes --]


--

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2024-03-30 22:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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

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