[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#42823: [PATCH] gnus-unplugged: nnimap (gmail) folder names having sp
From: |
Ozhap |
Subject: |
bug#42823: [PATCH] gnus-unplugged: nnimap (gmail) folder names having spaces not appearing |
Date: |
Sat, 19 Sep 2020 10:27:04 +0530 |
Eric Abrahamsen <eric@ericabrahamsen.net> writes:
> I've only been able to get as far as figuring out that the group is
> *not* present in nnml-group-alist, after nnagent has been made the
> current server. Presumably that's because the reading of the active file
> is still done with `read', which will only read one word, not the full
> name, thus the parsing fails and this line is discarded.
>
> It might be time to get rid of the last of the `read' tricks...
I considered that approach, but felt it would always be flawed by space
also being a delimiter in the active file. This patch puts quotes around
the group names when *writing* the active file of agent & cache (and
escapes any \ or " in them). I've been using it and I think it's clean.
diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 3429d6560b..f822ce57ba 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -1179,10 +1179,13 @@ gnus-write-active-file
(maphash
(lambda (group active)
(when active
- (insert (format "%s %d %d y\n"
- (if full-names
- group
- (gnus-group-real-name group))
+ (insert (format "\"%s\" %d %d y\n"
+ (replace-regexp-in-string
+ "[\\\"]" "\\\\\\&"
+ (if full-names
+ group
+ (gnus-group-real-name group))
+ t nil)
(or (cdr active)
(car active))
(car active)))))
But I'm not a position to actually test it with nntp, or IMAP folder names with
\ or ".
--
Ozhap
- bug#42823: [PATCH] gnus-unplugged: nnimap (gmail) folder names having spaces not appearing,
Ozhap <=