From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: James Thomas Newsgroups: gmane.emacs.bugs Subject: bug#65467: 29.1.50; Gnus agent groups with spaces in their names cannot be activated while unplugged Date: Thu, 24 Aug 2023 04:01:33 +0530 Message-ID: <871qftmlve.fsf@gmx.net> References: <87zg2i6xu1.fsf@gmx.net> <87cyzdhe5n.fsf@ericabrahamsen.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="40319"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 65467@debbugs.gnu.org To: Eric Abrahamsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Aug 24 00:32:13 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 1qYwOb-000AFU-BF for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Aug 2023 00:32:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYwOP-0001yT-W3; Wed, 23 Aug 2023 18:32:02 -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 1qYwOM-0001yK-En for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2023 18:31: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 1qYwOM-0003W4-6k for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2023 18:31:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qYwOP-0003t3-KE; Wed, 23 Aug 2023 18:32:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: James Thomas Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Wed, 23 Aug 2023 22:32:01 +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.169282991914934 (code B ref 65467); Wed, 23 Aug 2023 22:32:01 +0000 Original-Received: (at 65467) by debbugs.gnu.org; 23 Aug 2023 22:31:59 +0000 Original-Received: from localhost ([127.0.0.1]:35304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYwON-0003sm-HU for submit@debbugs.gnu.org; Wed, 23 Aug 2023 18:31:59 -0400 Original-Received: from mout.gmx.net ([212.227.15.15]:34483) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYwOK-0003sW-N2 for 65467@debbugs.gnu.org; Wed, 23 Aug 2023 18:31:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1692829898; x=1693434698; i=jimjoe@gmx.net; bh=d1WgEZ6bn5udyCR8vODvmgy2+7SOhdADc/q5c4JmWQQ=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=tHgybIycjYji0w+UcTU6x8g4R7wCBqtBmVwzjT0FLyXPLARS/ciPMpNuGrCR7VTH7ZrAyXq IoA3MSfHATxboHQ3ieHrOeVjD8O9nbJLTvBD66z8JobewmwbN4myqu51zziCGd699E45aXjMw rwPBARrFM63ZOtk0VLhswNenpN/e5BFIeBnMz2SfOcneLxgoOWvYSOsrjJSr22uyVxc7BxQq5 WkE81ERrHmWLNmTiih27y8qrrkMbRJJ0G3pxGsszeosB6A6Cke54KJsh2g2Y+KHVq/ayLj24s 7n6LOC4TYO29erLSNWl0E8UTqLu77gUMCa3CMNxjukS+WAYgfVcQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from user-Inspiron-15-5518 ([59.182.147.251]) by mail.gmx.net (mrgmx005 [212.227.17.184]) with ESMTPSA (Nemesis) id 1MGhyS-1qU2qh1UW2-00DlVb; Thu, 24 Aug 2023 00:31:37 +0200 In-Reply-To: <87cyzdhe5n.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Wed, 23 Aug 2023 10:17:08 -0700") X-Provags-ID: V03:K1:9/WROi2RGtN59XUY7YKjsAZIfz1oYLd27MbK6W9CgIiBx97RXQK qvDR21TcsB/IGVsiJhfhTUPpZVnNS5IbQLabhCPCktv5sWWitE9ybZ0uwxkHN0vgfYB6bdC mkfgsdsu2fa0FPDbCpKn0PlZfdKsPf5BOiP2XcsSTzcsyMtYxPK80D2NfqlBx8pih8itAh/ oUj4D+oleujQGwl86V2Tg== UI-OutboundReport: notjunk:1;M01:P0:Zl/fne+HfLc=;KqpimiQ2AKrtECkNaeI1IWTKWZW PBGn9uEKEm12+YdihVighxW1xaSG/sYfYpIA1NYAPQd5ezBjWTX7OWRORXgzO+zYb2ab5IHlF 1wOVFmgMIFQHv0kz6ahVyPhOW2Dv7OY4lNRZ84On5KasQsR6Ms7uXMSO9G9zQvkjDLCUuKZs9 93d88lsLPNcl9xeSIzmoP6aWLhMegK4rI/EGtm1GJ68V0iIxlLhpZYXvEjxc49XyJx7jGbn/X wiSDwbsPVwu4mNIAyvzIgBWQVli3jMjkKzshxeKWR22VZaT8m5FUlRYeruWQwUowSo4GNdC3n g440kJTfJVL3yvC8o9PIV+wn0zkt1iJB63tyGi7V0GuxHi4JVUFp+d533h3IOx1ut7cYQOscw UW+2Lex3f06ADH1/584a6eK/YhxW1rC0CBYl63un+9BI1YM6bEErgYRPmqnmooU2NqAMsOZhw uMv4HLTlw4M8q+0kaZMmj8aZnFsz7mxofL+a7OdARWCeZR8uComaNmNaux8tUFGzhwMxHoClm SVva3kyAz7/vR1doWG2onWTLUsU9pw9JQ4dV37tHfzjubvc5VHg0pPhvJOrv9HLlom8g4kDGr GP4FHuUS6ir6SQuu08z8tM3WAN818WVxvBZ163+6OaJK/g0cY5pQhGnE81DkMQSwtaqnDFe6B fBHM4LArwASQ6BMmClp4FpWFqtxaV09vc+YGQJOrwJVha/vbkjSHrdeL/DbfowxQGV2EqHyE1 p3CSZoAJ4Z5qZ3HT5TGbNLYiISnXDAh+KtVNmddOFv6RVs33w/Y/ayQ9gKuIYz3am/ykgVRR 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:268275 Archived-At: Eric Abrahamsen wrote: > 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. Hmmm... > In general it's annoying that different parts of Gnus use different > routines for reading/writing active files... At least for this point: I've checked that all results of a grep for '%s %d' or '(regexp-quote .*group.*)' in the gnus code are covered. These should be the ones not using 'read'. --