GNU bug report logs - #42823
27.1; gnus-unplugged: nnimap (gmail) folder names having spaces not appearing

Previous Next

Package: emacs;

Reported by: ozhap <at> vollbio.de

Date: Wed, 12 Aug 2020 07:55:01 UTC

Severity: normal

Found in version 27.1

Done: Eric Abrahamsen <eric <at> ericabrahamsen.net>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 42823 in the body.
You can then email your comments to 42823 AT debbugs.gnu.org in the normal way.

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:
bug#42823; Package emacs. (Wed, 12 Aug 2020 07:55:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to ozhap <at> vollbio.de:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 12 Aug 2020 07:55:01 GMT) Full text and rfc822 format available.

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

From: ozhap <at> vollbio.de
To: bug-gnu-emacs <at> gnu.org
Subject: 27.1; gnus-unplugged: nnimap (gmail) folder names having spaces not
 appearing
Date: Wed, 12 Aug 2020 09:02:41 +0200
1. Gmail IMAP should be accessible. Keep credentials in .authinfo.gpg.
   No Gnus files or directories (News, .newsrc*, Mail) present.
2. emacs -Q
3. Run:

(setq gnus-select-method
      '(nnimap "gmail"
	       (nnimap-address "imap.gmail.com")
	       (nnimap-server-port 993)
	       (nnimap-stream ssl)))

4. M-x gnus
5. ^ (Server list)
6. Go to 'gmail' and: J a (agentize)
7. q (back to Group buffer)
8. g (refresh)
9. q (quit Gnus)
10. Go offline.
11. M-x gnus-unplugged

'Sent mail' is missing. (The space character seems to be the problem
as it also happens to 'All mail', if set up). Works properly in 26.3.


In GNU Emacs 27.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.20)
 of 2020-08-11 built on Compu
Repository revision: 86d8d76aa36037184db0b2897c434cdaab1a9ae8
Repository branch: HEAD
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Ubuntu 20.04.1 LTS

Recent messages:
Saving /home/abc/.newsrc.eld...
Saving file /home/abc/.newsrc.eld...
Wrote /home/abc/.newsrc.eld
Saving /home/abc/.newsrc.eld...done
<XF86RFKill> is undefined
Reading /home/abc/.newsrc.eld...
Checking new news...
Reading active file from gmail via nnimap...done
Reading active file via nndraft...done
Checking new news...done

Configured using:
 'configure --prefix=/home/abc/emacs'

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

Important settings:
  value of $LANG: en_IN
  locale-coding-system: iso-latin-1-unix

Major mode: Group

Minor modes in effect:
  cursor-sensor-mode: t
  gnus-undo-mode: t
  tooltip-mode: t
  global-eldoc-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
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  line-number-mode: t
  transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug sendmail nnagent nnml cursor-sensor
nndraft nnmh nnfolder utf-7 epa-file gnutls network-stream nsm
gnus-agent gnus-srvr gnus-score score-mode nnvirtual gnus-msg gnus-art
mm-uu mml2015 mm-view mml-smime smime dig nntp gnus-cache gnus-sum url
url-proxy url-privacy url-expand url-methods url-history mailcap shr
url-cookie url-domsuf url-util url-parse auth-source cl-seq eieio
eieio-core cl-macs eieio-loaddefs json map url-vars svg xml dom
browse-url gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail
mail-source utf7 netrc nnoo parse-time iso8601 gnus-spec gnus-int
gnus-range message rmc puny format-spec rfc822 mml easymenu mml-sec
password-cache epa derived epg epg-config mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader gnus-win gnus
nnheader gnus-util rmail rmail-loaddefs rfc2047 rfc2045 ietf-drums
text-property-search time-date subr-x seq byte-opt gv bytecomp
byte-compile cconv mail-utils mm-util mail-prsvr wid-edit cl-loaddefs
cl-lib dired dired-loaddefs tooltip eldoc electric uniquify ediff-hook
vc-hooks lisp-float-type 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 elisp-mode lisp-mode prog-mode register page
tab-bar menu-bar rfn-eshadow isearch timer select scroll-bar mouse
jit-lock font-lock syntax facemenu font-core term/tty-colors frame
minibuffer cl-generic 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 charscript charprop case-table epa-hook jka-cmpr-hook help
simple abbrev obarray cl-preloaded nadvice loaddefs button faces
cus-face macroexp files text-properties overlay sha1 md5 base64 format
env code-pages mule custom widget hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty
make-network-process emacs)

Memory information:
((conses 16 142608 15208)
 (symbols 48 14296 1)
 (strings 32 41121 2403)
 (string-bytes 1 1407412)
 (vectors 16 21744)
 (vector-slots 8 291245 17836)
 (floats 8 196 23)
 (intervals 56 701 373)
 (buffers 1000 19))





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42823; Package emacs. (Wed, 12 Aug 2020 16:59:01 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: ozhap <at> vollbio.de
Cc: 42823 <at> debbugs.gnu.org
Subject: Re: bug#42823: 27.1; gnus-unplugged: nnimap (gmail) folder names
 having spaces not appearing
Date: Wed, 12 Aug 2020 09:57:56 -0700
ozhap <at> vollbio.de writes:

> 1. Gmail IMAP should be accessible. Keep credentials in .authinfo.gpg.
>    No Gnus files or directories (News, .newsrc*, Mail) present.
> 2. emacs -Q
> 3. Run:
>
> (setq gnus-select-method
>       '(nnimap "gmail"
> 	       (nnimap-address "imap.gmail.com")
> 	       (nnimap-server-port 993)
> 	       (nnimap-stream ssl)))
>
> 4. M-x gnus
> 5. ^ (Server list)
> 6. Go to 'gmail' and: J a (agentize)
> 7. q (back to Group buffer)
> 8. g (refresh)
> 9. q (quit Gnus)
> 10. Go offline.
> 11. M-x gnus-unplugged
>
> 'Sent mail' is missing.

Hmm, I can partially confirm: in my tests, I do see the group still
present in the *Group* buffer, but it can't be activated. The group is
present in the agent's data: the group has its own directory (complete
with space in the directory name), and it is also present in the agent's
active file (also with space).

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...




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42823; Package emacs. (Sat, 19 Sep 2020 06:39:01 GMT) Full text and rfc822 format available.

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

From: Ozhap <ozhap <at> vollbio.de>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 42823 <at> debbugs.gnu.org
Subject: Re: bug#42823: [PATCH] gnus-unplugged: nnimap (gmail) folder names
 having spaces not appearing
Date: Sat, 19 Sep 2020 10:27:04 +0530
Eric Abrahamsen <eric <at> 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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42823; Package emacs. (Sat, 19 Sep 2020 07:09:02 GMT) Full text and rfc822 format available.

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

From: Andreas Schwab <schwab <at> linux-m68k.org>
To: Ozhap <ozhap <at> vollbio.de>
Cc: Eric Abrahamsen <eric <at> ericabrahamsen.net>, 42823 <at> debbugs.gnu.org
Subject: Re: bug#42823: [PATCH] gnus-unplugged: nnimap (gmail) folder names
 having spaces not appearing
Date: Sat, 19 Sep 2020 09:08:02 +0200
On Sep 19 2020, Ozhap wrote:

> +	   (insert (format "\"%s\" %d %d y\n"
> +			   (replace-regexp-in-string
> +			    "[\\\"]" "\\\\\\&"

You can use %S as the format instead.

Andreas.

-- 
Andreas Schwab, schwab <at> linux-m68k.org
GPG Key fingerprint = 7578 EB47 D4E5 4D69 2510  2552 DF73 E780 A9DA AEC1
"And now for something completely different."




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42823; Package emacs. (Sat, 19 Sep 2020 07:47:02 GMT) Full text and rfc822 format available.

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

From: Ozhap <ozhap <at> vollbio.de>
To: Andreas Schwab <schwab <at> linux-m68k.org>
Cc: Eric Abrahamsen <eric <at> ericabrahamsen.net>, 42823 <at> debbugs.gnu.org
Subject: Re: bug#42823: [PATCH] gnus-unplugged: nnimap (gmail) folder names
 having spaces not appearing
Date: Sat, 19 Sep 2020 13:15:58 +0530
Andreas Schwab <schwab <at> linux-m68k.org> writes:

> On Sep 19 2020, Ozhap wrote:
>
>> +	   (insert (format "\"%s\" %d %d y\n"
>> +			   (replace-regexp-in-string
>> +			    "[\\\"]" "\\\\\\&"
>
> You can use %S as the format instead.

Perfect! Thanks. So I'm using this now:

diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
index 3429d6560b..c2f0e355bc 100644
--- a/lisp/gnus/gnus-util.el
+++ b/lisp/gnus/gnus-util.el
@@ -1179,7 +1179,7 @@ gnus-write-active-file
       (maphash
        (lambda (group active)
 	 (when active
-	   (insert (format "%s %d %d y\n"
+	   (insert (format "%S %d %d y\n"
 			   (if full-names
 			       group
 			     (gnus-group-real-name group))

Forgot to add earlier: The problem didn't occur in 26.3 because the
intern command retired in c1b63af4458e92bad33da0def2b15c206656e2fa
escaped space characters (as well as other symbols).

--
Ozhap




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42823; Package emacs. (Sat, 19 Sep 2020 15:37:01 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Ozhap <ozhap <at> vollbio.de>
Cc: 42823 <at> debbugs.gnu.org, Andreas Schwab <schwab <at> linux-m68k.org>
Subject: Re: bug#42823: [PATCH] gnus-unplugged: nnimap (gmail) folder names
 having spaces not appearing
Date: Sat, 19 Sep 2020 08:36:24 -0700
On 09/19/20 13:15 PM, Ozhap wrote:
> Andreas Schwab <schwab <at> linux-m68k.org> writes:
>
>> On Sep 19 2020, Ozhap wrote:
>>
>>> +	   (insert (format "\"%s\" %d %d y\n"
>>> +			   (replace-regexp-in-string
>>> +			    "[\\\"]" "\\\\\\&"
>>
>> You can use %S as the format instead.
>
> Perfect! Thanks. So I'm using this now:
>
> diff --git a/lisp/gnus/gnus-util.el b/lisp/gnus/gnus-util.el
> index 3429d6560b..c2f0e355bc 100644
> --- a/lisp/gnus/gnus-util.el
> +++ b/lisp/gnus/gnus-util.el
> @@ -1179,7 +1179,7 @@ gnus-write-active-file
>        (maphash
>         (lambda (group active)
>  	 (when active
> -	   (insert (format "%s %d %d y\n"
> +	   (insert (format "%S %d %d y\n"
>  			   (if full-names
>  			       group
>  			     (gnus-group-real-name group))

Looks reasonable to me -- definitely the cleanest solution. Do you have
push access? If not I can apply this in a bit.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42823; Package emacs. (Sun, 20 Sep 2020 01:33:02 GMT) Full text and rfc822 format available.

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

From: Ozhap <ozhap <at> vollbio.de>
To: Eric Abrahamsen <eric <at> ericabrahamsen.net>
Cc: 42823 <at> debbugs.gnu.org, Andreas Schwab <schwab <at> linux-m68k.org>
Subject: Re: bug#42823: [PATCH] gnus-unplugged: nnimap (gmail) folder names
 having spaces not appearing
Date: Sun, 20 Sep 2020 07:02:34 +0530
Eric Abrahamsen  writes:

> Looks reasonable to me -- definitely the cleanest solution. Do you have
> push access? If not I can apply this in a bit.

No. Please do so. TIA.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42823; Package emacs. (Wed, 23 Sep 2020 23:09:02 GMT) Full text and rfc822 format available.

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

From: Eric Abrahamsen <eric <at> ericabrahamsen.net>
To: Ozhap <ozhap <at> vollbio.de>
Cc: 42823 <at> debbugs.gnu.org, 42823-done <at> debbugs.gnu.org,
 Andreas Schwab <schwab <at> linux-m68k.org>
Subject: Re: bug#42823: [PATCH] gnus-unplugged: nnimap (gmail) folder names
 having spaces not appearing
Date: Wed, 23 Sep 2020 16:08:07 -0700
On 09/20/20 07:02 AM, Ozhap wrote:
> Eric Abrahamsen  writes:
>
>> Looks reasonable to me -- definitely the cleanest solution. Do you have
>> push access? If not I can apply this in a bit.
>
> No. Please do so. TIA.

There goes, I'm closing this now.




Reply sent to Eric Abrahamsen <eric <at> ericabrahamsen.net>:
You have taken responsibility. (Wed, 23 Sep 2020 23:09:02 GMT) Full text and rfc822 format available.

Notification sent to ozhap <at> vollbio.de:
bug acknowledged by developer. (Wed, 23 Sep 2020 23:09:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 22 Oct 2020 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 186 days ago.

Previous Next


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