From: Ozhap <ozhap@vollbio.de>
To: Eric Abrahamsen <eric@ericabrahamsen.net>
Cc: 42823@debbugs.gnu.org
Subject: bug#42823: [PATCH] gnus-unplugged: nnimap (gmail) folder names having spaces not appearing
Date: Sat, 19 Sep 2020 10:27:04 +0530 [thread overview]
Message-ID: <87sgbejrdr.fsf@Kittu.i-did-not-set--mail-host-address--so-tickle-me> (raw)
In-Reply-To: <87wo23u7hn.fsf@ericabrahamsen.net>
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
next prev parent reply other threads:[~2020-09-19 4:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-12 7:02 bug#42823: 27.1; gnus-unplugged: nnimap (gmail) folder names having spaces not appearing ozhap
2020-08-12 16:57 ` Eric Abrahamsen
2020-09-19 4:57 ` Ozhap [this message]
2020-09-19 7:08 ` bug#42823: [PATCH] " Andreas Schwab
2020-09-19 7:45 ` Ozhap
2020-09-19 15:36 ` Eric Abrahamsen
2020-09-20 1:32 ` Ozhap
2020-09-23 23:08 ` Eric Abrahamsen
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=87sgbejrdr.fsf@Kittu.i-did-not-set--mail-host-address--so-tickle-me \
--to=ozhap@vollbio.de \
--cc=42823@debbugs.gnu.org \
--cc=eric@ericabrahamsen.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).