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 05:40:29 +0530 Message-ID: <87h6op47wq.fsf@gmx.net> References: <87zg2i6xu1.fsf@gmx.net> <87cyzdhe5n.fsf@ericabrahamsen.net> <871qftmlve.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="32050"; 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 02:11:23 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 1qYxwX-0008D1-O3 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 24 Aug 2023 02:11:21 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYxwB-0006np-Sj; Wed, 23 Aug 2023 20:10:59 -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 1qYxwA-0006nc-Eo for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2023 20:10:58 -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 1qYxwA-0007iZ-6c for bug-gnu-emacs@gnu.org; Wed, 23 Aug 2023 20:10:58 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qYxwD-0003jO-M6; Wed, 23 Aug 2023 20:11: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: Thu, 24 Aug 2023 00:11: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.169283585814329 (code B ref 65467); Thu, 24 Aug 2023 00:11:01 +0000 Original-Received: (at 65467) by debbugs.gnu.org; 24 Aug 2023 00:10:58 +0000 Original-Received: from localhost ([127.0.0.1]:35634 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYxwA-0003j3-5l for submit@debbugs.gnu.org; Wed, 23 Aug 2023 20:10:58 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:60817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYxw4-0003im-IB for 65467@debbugs.gnu.org; Wed, 23 Aug 2023 20:10:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1692835833; x=1693440633; i=jimjoe@gmx.net; bh=7tx920+rRf6s0xEiPL91jEEDCZUYJOX7fD3WKDitJ7A=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date; b=SF9C4faRTKYwyeWNPs1gtcRq2GrNgYeTe0Oq7boY55nnd/u5GzJxBsCzYMaxCr05ZhS6XzH /JjAJjumhCH7+OYbGmIznyuPczp5Ea2sYjwaetx82OQJFPe23GGwfh1wB7QzK2X4YDkc81FDc 2c/ERdZQL9pa8lU/ljByN8syQaUjxZRBibfjrrdrxN9bY/QC+S/E6f0K0yIEFj+1snJhgGlsi wGw55XoAZGICBRvxp0yUrbkyOBOJeYMKnAAy6jpzwF3q/IlWaqct0Zp05qRP/Gu5/Te/FqaBy sYGCZrsbp9ZpEk1quO6A+eYWPLg5s/l29kjPAXnXdeFYH9gsTE9w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from user-Inspiron-15-5518 ([59.182.147.251]) by mail.gmx.net (mrgmx004 [212.227.17.184]) with ESMTPSA (Nemesis) id 1N33Il-1pahAC0W5t-013M18; Thu, 24 Aug 2023 02:10:33 +0200 In-Reply-To: <871qftmlve.fsf@gmx.net> (James Thomas's message of "Thu, 24 Aug 2023 04:01:33 +0530") X-Provags-ID: V03:K1:g4IiAYei+QwqXl9rVrPnK8th8e6j0V1wFo4U7uZ6BFxkguqajgg scy459nKpT+5AVJzWMVGkiZOnaLCUE1I5oqmGX+aWrbcR88IabJpRCe6Omq1v8bUd6Uif7h r9fqRolHoDHYPGsxDXHnAJWKfyDI9uv/fMGhOILsiTaBAOe2iXXHzAdLU/95FZf0X0q463C ZU2iAp6Wz5QTDGfpsuTQQ== UI-OutboundReport: notjunk:1;M01:P0:7UEnOjWsWUg=;IhUv7rjIdzGlhBUklxs5fXRFPn5 1SwPARjtWcbZ1qnw1uIL1zUCXT7mZ9J35sXsYlGVLSU9tfBoU3rBYwhH1q9c2qUWI6EWHhiYr 4/80yeMAcGUqxskt7c/0hwmruu3RrQSNSHT1U3IgrnByGpgQqsFvghR/2GXyr4ty2WbpLuocK N6RA/6/aFZfkWSqB6KnfgsmPyYPSDAYLbgh5BJgc47/F9DyjMZ+RyUD6/N1vUQrNdHYYt23o9 Yu7g5aCxdNWuKKhxrc30qL1EhS+5VcOvjCHcZTXQxEUWYMj10U6Lnq3uxPXXlSM5RAxxfrEZA EHYKkoF0cwGuWF6WT2jrUrN6c3hSAugM3Q3G6f9fHPKGdVV7YMy83EwA45wTC4B0DKjAwDu23 g9lNni8StOUOqfvfoGmyUl/aR1FsrPISd6ynIY2RWwm25kSnLutz7l8sIYAfzQH7U6RQjQ4r/ vY0w1Oyig3VSs9YrmDpCrzGt6p4HHK4ny2jFcGYvG/a8V2wzsdjfJUNNPg/P9TLRfbHs/IqGm zYh+aFDm5B7k3KP8HjbfuU/EQ+WOOImtiQjCfFEDeGBL2UNuKr0JcKvCbzQSqaKrLCv7VE4cM OhHiFog/32N+mr1TNQHjdsDw0V0kSDwRQZWQFH4Sy24UP70QVDm1OqoOKjYmNSQM6hwM0Cnkx s9CHy5efbxMwhjNZRFBbaLlni/h7f9I7csbYQbp7WouTYpWCZO7cLXh6PN8NLZNt4wpgA75GN zTSeR8DKtl8gXJGoQRy2nKlW/nysF3WMuESdjabY98tnXD0b66Yh2Os3Oa1zKy/kOujCP7fK 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:268285 Archived-At: James Thomas wrote: > 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... > Perhaps we can commit only the 'reading' parts (1st change in the first 2 hunks) and hold off on the 'writing' parts for a later, minor release (which wouldn't have drastic changes) so that people know (for one release) that any breakage is not due to that. >> 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'. That should read '(regexp-quote[ \n\t]+.*group.*)' (in effect, through Dired's M-s a C-M-s). --