GNU bug report logs - #65467
29.1.50; Gnus agent groups with spaces in their names cannot be activated while unplugged

Previous Next

Packages: gnus, emacs;

Reported by: James Thomas <jimjoe <at> gmx.net>

Date: Wed, 23 Aug 2023 07:09:01 UTC

Severity: normal

Found in version 29.1.50

To reply to this bug, email your comments to 65467 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#65467; Package emacs,gnus. (Wed, 23 Aug 2023 07:09:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to James Thomas <jimjoe <at> gmx.net>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org. (Wed, 23 Aug 2023 07:09:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: James Thomas <jimjoe <at> gmx.net>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.1.50; Gnus agent groups with spaces in their names cannot be
 activated while unplugged
Date: Wed, 23 Aug 2023 12:37:34 +0530
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.

--

In GNU Emacs 29.1.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.33, cairo version 1.16.0) of 2023-08-02 built on
 user-Inspiron-15-5518
Repository revision: 608a8757d9fa54bc2fd57180b0347931db9c46b0
Repository branch: emacs-29
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Ubuntu 22.04.2 LTS

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER X11 XDBE XIM XINPUT2 XPM GTK3 ZLIB

Important settings:
  value of $LANG: en_IN
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: iso-latin-1-unix

Major mode: Fundamental

Minor modes in effect:
  shell-dirtrack-mode: t
  display-time-mode: t
  desktop-environment-mode: t
  server-mode: t
  recentf-mode: t
  override-global-mode: t
  icomplete-mode: t
  fido-mode: t
  display-battery-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
/home/user/.emacs.d/elpa/transient-20230315.1520/transient hides /home/user/code/emacs/lisp/transient
/home/user/.emacs.d/elpa/use-package-20230203.2004/use-package-jump hides /home/user/code/emacs/lisp/use-package/use-package-jump
/home/user/.emacs.d/elpa/use-package-20230203.2004/use-package-ensure hides /home/user/code/emacs/lisp/use-package/use-package-ensure
/home/user/.emacs.d/elpa/use-package-20230203.2004/use-package-lint hides /home/user/code/emacs/lisp/use-package/use-package-lint
/home/user/.emacs.d/elpa/use-package-20230203.2004/use-package-core hides /home/user/code/emacs/lisp/use-package/use-package-core
/home/user/.emacs.d/elpa/use-package-20230203.2004/use-package hides /home/user/code/emacs/lisp/use-package/use-package
/home/user/.emacs.d/elpa/use-package-20230203.2004/use-package-delight hides /home/user/code/emacs/lisp/use-package/use-package-delight
/home/user/.emacs.d/elpa/bind-key-20230203.2004/bind-key hides /home/user/code/emacs/lisp/use-package/bind-key
/home/user/.emacs.d/elpa/use-package-20230203.2004/use-package-bind-key hides /home/user/code/emacs/lisp/use-package/use-package-bind-key
/home/user/.emacs.d/elpa/use-package-20230203.2004/use-package-diminish hides /home/user/code/emacs/lisp/use-package/use-package-diminish

Features:
(pp shadow bbdb-message emacsbug mule-util shr-color color epa-file
dired-aux nnagent sort gnus-cite smiley mm-archive mail-extr textsec
uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check
gnus-async gnus-bcklg face-remap qp gnus-ml hl-line disp-table misearch
multi-isearch nnml utf-7 url-http url-gw url-cache url-auth
network-stream nsm cursor-sensor nndraft nnmh nnnil gnus-agent gnus-srvr
gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view
mml-smime smime gnutls dig nntp gnus-cache gnus-sum gnus-group gnus-undo
bbdb-gnus bbdb-mua bbdb-com bbdb bbdb-site timezone auth-source-xoauth2
auth-source-pass smtpmail gnus-start gnus-dbus gnus-cloud nnimap nnmail
mail-source utf7 nnoo parse-time iso8601 gnus-spec gnus-int gnus-range
message sendmail yank-media rfc822 mml mml-sec epa epg rfc6068
epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mailabbrev gmm-utils mailheader gnus-win crm shell
pcomplete comint ansi-osc ansi-color image-mode exif time
eww-history-ext derived eww-history-ext-dyn eww url-queue thingatpt shr
pixel-fill kinsoku url-file svg dom puny mm-url gnus nnheader gnus-util
text-property-search time-date mail-utils range mm-util mail-prsvr
denote xdg dired dired-loaddefs xref project ring edmacro
desktop-environment ediff ediff-merg ediff-mult ediff-wind ediff-diff
ediff-help ediff-init ediff-util exwm-systemtray xcb-systemtray
xcb-xembed exwm exwm-input xcb-keysyms xcb-xkb exwm-manage exwm-floating
xcb-cursor xcb-render exwm-layout exwm-workspace exwm-core xcb-ewmh
xcb-icccm xcb xcb-xproto xcb-types xcb-debug kmacro server cl-extra
help-mode advice recentf tree-widget wid-edit use-package
use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core format-spec
icomplete battery dbus xml cus-load cask-autoloads conda-autoloads
gnus-mock-autoloads jeison-autoloads pcase org-mime-autoloads
org-present-autoloads org-remark-autoloads pdf-tools-autoloads
python-view-data-autoloads csv-mode-autoloads pythonic-autoloads
realgud-ipdb-autoloads realgud-autoloads realgud-recursive-autoloads
loc-changes-autoloads load-relative-autoloads reddigg-autoloads
ht-autoloads promise-autoloads request-autoloads s-autoloads
test-simple-autoloads info package browse-url url url-proxy url-privacy
url-expand url-methods url-history url-cookie generate-lisp-file
url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq
eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv
bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip
cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type
elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list replace newcomment
text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow
isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic
indonesian philippine cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs
theme-loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify lcms2
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit xinput2 x multi-tty make-network-process
emacs)

Memory information:
((conses 16 418247 35510)
 (symbols 48 29038 3)
 (strings 32 114691 6643)
 (string-bytes 1 3351244)
 (vectors 16 81423)
 (vector-slots 8 1189181 62648)
 (floats 8 404 309)
 (intervals 56 1930 1024)
 (buffers 984 28))




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#65467; Package emacs,gnus. (Wed, 23 Aug 2023 17:18:02 GMT) Full text and rfc822 format available.

Message #8 received at 65467 <at> debbugs.gnu.org (full text, mbox):

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: James Thomas <jimjoe <at> gmx.net>
Cc: 65467 <at> debbugs.gnu.org
Subject: Re: 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
James Thomas <jimjoe <at> gmx.net> 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...




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#65467; Package emacs,gnus. (Wed, 23 Aug 2023 22:32:01 GMT) Full text and rfc822 format available.

Message #11 received at 65467 <at> debbugs.gnu.org (full text, mbox):

From: James Thomas <jimjoe <at> gmx.net>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 65467 <at> debbugs.gnu.org
Subject: Re: 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
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'.

--




Information forwarded to bug-gnu-emacs <at> gnu.org, bugs <at> gnus.org:
bug#65467; Package emacs,gnus. (Thu, 24 Aug 2023 00:11:01 GMT) Full text and rfc822 format available.

Message #14 received at 65467 <at> debbugs.gnu.org (full text, mbox):

From: James Thomas <jimjoe <at> gmx.net>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 65467 <at> debbugs.gnu.org
Subject: Re: 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
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).

--




This bug report was last modified 1 year and 92 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.