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#65467: 29.1.50; Gnus agent groups with spaces in their names cannot be activated while unplugged Date: Wed, 23 Aug 2023 10:17:08 -0700 Message-ID: <87cyzdhe5n.fsf@ericabrahamsen.net> References: <87zg2i6xu1.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="24380"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 65467@debbugs.gnu.org To: James Thomas Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 23 19:18:41 2023 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 1qYrV9-000677-N1 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 23 Aug 2023 19:18:39 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYrUX-0000ck-K9; Wed, 23 Aug 2023 13:18:01 -0400 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 1qYrUV-0000cB-L5 for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2023 13:17:59 -0400 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 1qYrUV-00034d-D9 for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2023 13:17:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qYrUY-0001zB-Dk; Wed, 23 Aug 2023 13:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eric Abrahamsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Wed, 23 Aug 2023 17:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65467 X-GNU-PR-Package: emacs,gnus Original-Received: via spool by 65467-submit@debbugs.gnu.org id=B65467.16928110437572 (code B ref 65467); Wed, 23 Aug 2023 17:18:02 +0000 Original-Received: (at 65467) by debbugs.gnu.org; 23 Aug 2023 17:17:23 +0000 Original-Received: from localhost ([127.0.0.1]:35066 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYrTu-0001y3-Eo for submit@debbugs.gnu.org; Wed, 23 Aug 2023 13:17:22 -0400 Original-Received: from mail.ericabrahamsen.net ([52.70.2.18]:46736) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYrTr-0001xj-98 for 65467@debbugs.gnu.org; Wed, 23 Aug 2023 13:17:21 -0400 Original-Received: from localhost (c-71-197-232-41.hsd1.wa.comcast.net [71.197.232.41]) (Authenticated sender: eric@ericabrahamsen.net) by mail.ericabrahamsen.net (Postfix) with ESMTPSA id 1BA9BFA07E; Wed, 23 Aug 2023 17:17:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ericabrahamsen.net; s=mail; t=1692811030; bh=JNY2pSt/nnFYdjCmO6+KB+5j3hRhsvHFQMGn8LMCyv8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=TADc4cZA+qngNrMLjeC1vv2ByF2AC/3h+BY/oWTedQ3ApC59vV7Y/1JB1fFbZdtfb q4QP8Jsz6P1xeUW8qZx0zUllFRtomlRknAbOGQ3gONoV2qDdqxS2ZPtaOIlzxFV0wZ TH97M5ztPYqljDzIglA+LhkWW2PxRLyeIfNQNfZo= In-Reply-To: <87zg2i6xu1.fsf@gmx.net> (James Thomas's message of "Wed, 23 Aug 2023 12:37:34 +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:268262 Archived-At: James Thomas writes: > To reproduce, attempt to access, while unplugged, any group of an > agentized (IMAP) server with a space in its name (such as Gmail's 'Sent > Mail' or 'All Mail'). > > Here's a patch that fixes it: > > diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el > index db205c5b657..5f2401c7c07 100644 > --- a/lisp/gnus/gnus-agent.el > +++ b/lisp/gnus/gnus-agent.el > @@ -1340,13 +1340,13 @@ gnus-agent-save-group-info > > (goto-char (point-min)) > (when (re-search-forward > - (concat "^" (regexp-quote group) " ") nil t) > + (concat "^\"?" (regexp-quote group) "\"? ") nil t) > (save-excursion > (setq oactive-max (read (current-buffer)) ;; max > oactive-min (read (current-buffer)))) ;; min > (gnus-delete-line))) > (when active > - (insert (format "%s %d %d y\n" group > + (insert (format "%S %d %d y\n" group > (max (or oactive-max (cdr active)) (cdr active)) > (min (or oactive-min (car active)) (car active)))) > (goto-char (point-max)) > @@ -1370,7 +1370,7 @@ gnus-agent-get-group-info > > (goto-char (point-min)) > (when (re-search-forward > - (concat "^" (regexp-quote group) " ") nil t) > + (concat "^\"?" (regexp-quote group) "\"? ") nil t) > (save-excursion > (setq oactive-max (read (current-buffer)) ;; max > oactive-min (read (current-buffer))) ;; min > diff --git a/lisp/gnus/nnmail.el b/lisp/gnus/nnmail.el > index e8f157392d4..3a91139cb3f 100644 > --- a/lisp/gnus/nnmail.el > +++ b/lisp/gnus/nnmail.el > @@ -695,7 +697,7 @@ nnmail-generate-active > (erase-buffer) > (let (group) > (while (setq group (pop alist)) > - (insert (format "%s %d %d y\n" (car group) (cdadr group) > + (insert (format "%S %d %d y\n" (car group) (cdadr group) > (caadr group)))) > (goto-char (point-max)) > (while (search-backward "\\." nil t) > > Note: If you're already facing this problem with a group, after applying > the patch, you'll also have to do M-g over it in the Group buffer while > plugged, to update the agent's active file. New servers wouldn't need > this. > > This is similar in spirit to bug#42823. I'm thinking about ways in which this change might be able to break users' existing set ups. It looks to me like it will be a "silent upgrade" as the group names will be replaced with their quoted versions. But that means that users will not be able to downgrade their Gnus (versions of Gnus without this change won't be able to read active files written with this change in place), which I think is a contract we try to stick to. Do we? I can't remember. In general it's annoying that different parts of Gnus use different routines for reading/writing active files...