Gnus development mailing list
 help / color / mirror / Atom feed
* Gnus can't handle maildir groups with a space in the group name
@ 2007-11-27 19:01 Tassilo Horn
  2007-11-27 19:22 ` Paul Jarc
  0 siblings, 1 reply; 6+ messages in thread
From: Tassilo Horn @ 2007-11-27 19:01 UTC (permalink / raw)
  To: ding

Hi all,

I've switched from nnimap to OfflineIMAP, and it works quite nice.  But
there's one problem.  Gnus doesn't see the (maildir) groups that contain
a space in the group name, like

  INBOX.Junk Mail
  INBOX.Sent Items

My config is as follows:

(add-to-list 'gnus-secondary-select-methods
             '(nnmaildir "Fastmail"
                         (directory "~/Mail/Fastmail")))

~/Mail/Fastmail is where all nnmaildir groups reside.  I think this is
the right way to use it, right?

Is there something I can do that gnus can see those two groups?

(I know I can fiddle with OfflineIMAP and provide a customized group
name to maildir folder translation somehow, but I don't see a reason why
Gnus should fail with maildir groups with whitespaces.)

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Gnus can't handle maildir groups with a space in the group name
  2007-11-27 19:01 Gnus can't handle maildir groups with a space in the group name Tassilo Horn
@ 2007-11-27 19:22 ` Paul Jarc
  2007-11-27 19:43   ` Tassilo Horn
  0 siblings, 1 reply; 6+ messages in thread
From: Paul Jarc @ 2007-11-27 19:22 UTC (permalink / raw)
  To: ding

Tassilo Horn <tassilo@member.fsf.org> wrote:
> (I know I can fiddle with OfflineIMAP and provide a customized group
> name to maildir folder translation somehow, but I don't see a reason why
> Gnus should fail with maildir groups with whitespaces.)

The interface between Gnus and its backends (such as nnmaildir)
involves some data being passed as space-delimited text, instead of as
structured values.  So spaces won't work in group names, regardless of
which backnd you use.


paul



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Gnus can't handle maildir groups with a space in the group name
  2007-11-27 19:22 ` Paul Jarc
@ 2007-11-27 19:43   ` Tassilo Horn
  2007-11-28 15:42     ` Simon Josefsson
  0 siblings, 1 reply; 6+ messages in thread
From: Tassilo Horn @ 2007-11-27 19:43 UTC (permalink / raw)
  To: ding

prj@po.cwru.edu (Paul Jarc) writes:

Hi Paul,

> Tassilo Horn <tassilo@member.fsf.org> wrote:
>> (I know I can fiddle with OfflineIMAP and provide a customized group
>> name to maildir folder translation somehow, but I don't see a reason why
>> Gnus should fail with maildir groups with whitespaces.)
>
> The interface between Gnus and its backends (such as nnmaildir)
> involves some data being passed as space-delimited text, instead of as
> structured values.  So spaces won't work in group names, regardless of
> which backnd you use.

Really?  At least nnimap had no problems with those groups.  And out of
sudden the "nnmaildir+Fastmail:INBOX.Sent Mail" group is there and seems
to work without problems.  Only "INBOX.Junk Mail" is missing.  If I say
`U' in *Group* I can tab-complete the group name, but after the RET Gnus
says "gnus-group-unsubscribe-group: No such newsgroup:
nnmaildir+Fastmail:INBOX.Junk Mail".

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Gnus can't handle maildir groups with a space in the group name
  2007-11-27 19:43   ` Tassilo Horn
@ 2007-11-28 15:42     ` Simon Josefsson
  2007-11-28 16:14       ` Tassilo Horn
  2007-12-02  1:29       ` Paul Jarc
  0 siblings, 2 replies; 6+ messages in thread
From: Simon Josefsson @ 2007-11-28 15:42 UTC (permalink / raw)
  To: ding

Tassilo Horn <tassilo@member.fsf.org> writes:

> prj@po.cwru.edu (Paul Jarc) writes:
>
> Hi Paul,
>
>> Tassilo Horn <tassilo@member.fsf.org> wrote:
>>> (I know I can fiddle with OfflineIMAP and provide a customized group
>>> name to maildir folder translation somehow, but I don't see a reason why
>>> Gnus should fail with maildir groups with whitespaces.)
>>
>> The interface between Gnus and its backends (such as nnmaildir)
>> involves some data being passed as space-delimited text, instead of as
>> structured values.  So spaces won't work in group names, regardless of
>> which backnd you use.
>
> Really?  At least nnimap had no problems with those groups.  And out of
> sudden the "nnmaildir+Fastmail:INBOX.Sent Mail" group is there and seems
> to work without problems.  Only "INBOX.Junk Mail" is missing.  If I say
> `U' in *Group* I can tab-complete the group name, but after the RET Gnus
> says "gnus-group-unsubscribe-group: No such newsgroup:
> nnmaildir+Fastmail:INBOX.Junk Mail".

Yeah, IIRC, spaces work fine in Gnus if they are escaped as foo\ bar
when they are exchanged between Gnus and nn*.

/Simon



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Gnus can't handle maildir groups with a space in the group name
  2007-11-28 15:42     ` Simon Josefsson
@ 2007-11-28 16:14       ` Tassilo Horn
  2007-12-02  1:29       ` Paul Jarc
  1 sibling, 0 replies; 6+ messages in thread
From: Tassilo Horn @ 2007-11-28 16:14 UTC (permalink / raw)
  To: ding

Simon Josefsson <simon@josefsson.org> writes:

Hi Simon,

>> Really?  At least nnimap had no problems with those groups.  And out
>> of sudden the "nnmaildir+Fastmail:INBOX.Sent Mail" group is there and
>> seems to work without problems.  Only "INBOX.Junk Mail" is missing.
>> If I say `U' in *Group* I can tab-complete the group name, but after
>> the RET Gnus says "gnus-group-unsubscribe-group: No such newsgroup:
>> nnmaildir+Fastmail:INBOX.Junk Mail".
>
> Yeah, IIRC, spaces work fine in Gnus if they are escaped as foo\ bar
> when they are exchanged between Gnus and nn*.

In the meantime I've added

  nametrans = lambda foldername: re.sub(' ', '_', foldername)

to my ~/.offlineimaprc, so "INBOX.Junk Mail" becomes "INBOX.Junk_Mail"
etc. which works nicely.

Bye,
Tassilo



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: Gnus can't handle maildir groups with a space in the group name
  2007-11-28 15:42     ` Simon Josefsson
  2007-11-28 16:14       ` Tassilo Horn
@ 2007-12-02  1:29       ` Paul Jarc
  1 sibling, 0 replies; 6+ messages in thread
From: Paul Jarc @ 2007-12-02  1:29 UTC (permalink / raw)
  To: ding

[-- Attachment #1: Type: text/plain, Size: 222 bytes --]

Simon Josefsson <simon@josefsson.org> wrote:
> Yeah, IIRC, spaces work fine in Gnus if they are escaped as foo\ bar
> when they are exchanged between Gnus and nn*.

Here's a patch.  Tassilo, does this work for you?


paul

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nnmaildir-space.diff --]
[-- Type: text/x-patch, Size: 1713 bytes --]

Index: lisp/nnmaildir.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/nnmaildir.el,v
retrieving revision 7.14
diff -u -r7.14 nnmaildir.el
--- lisp/nnmaildir.el	25 Oct 2007 08:17:54 -0000	7.14
+++ lisp/nnmaildir.el	2 Dec 2007 01:17:22 -0000
@@ -883,7 +883,9 @@
 			pgname (nnmaildir--pgname nnmaildir--cur-server pgname)
 			group (symbol-value group)
 			ro (nnmaildir--param pgname 'read-only))
-		  (insert (nnmaildir--grp-name group) " ")
+		  (insert (gnus-replace-in-string
+			   (nnmaildir--grp-name group) " " "\\ " t)
+			  " ")
                   (princ (nnmaildir--group-maxnum nnmaildir--cur-server group)
 			 nntp-server-buffer)
 		  (insert " ")
@@ -910,7 +912,9 @@
 	  (insert " ")
 	  (princ (nnmaildir--group-maxnum nnmaildir--cur-server group)
 		 nntp-server-buffer)
-	  (insert " " gname "\n")))))
+	  (insert " "
+		  (gnus-replace-in-string gname " " "\\ " t)
+		  "\n")))))
   'group)
 
 (defun nnmaildir-request-update-info (gname info &optional server)
@@ -998,7 +1002,7 @@
 	(insert " ")
 	(princ (nnmaildir--group-maxnum nnmaildir--cur-server group)
 	       nntp-server-buffer)
-	(insert " " gname "\n")
+	(insert " " (gnus-replace-in-string gname " " "\\ " t) "\n")
 	t))))
 
 (defun nnmaildir-request-create-group (gname &optional server args)
@@ -1160,7 +1164,7 @@
 	      (insert "\t" (nnmaildir--nov-get-beg nov) "\t"
 		      (nnmaildir--art-msgid article) "\t"
 		      (nnmaildir--nov-get-mid nov) "\tXref: nnmaildir "
-		      gname ":")
+		      (gnus-replace-in-string gname " " "\\ " t) ":")
 	      (princ num nntp-server-buffer)
 	      (insert "\t" (nnmaildir--nov-get-end nov) "\n"))))
     (catch 'return

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-12-02  1:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-27 19:01 Gnus can't handle maildir groups with a space in the group name Tassilo Horn
2007-11-27 19:22 ` Paul Jarc
2007-11-27 19:43   ` Tassilo Horn
2007-11-28 15:42     ` Simon Josefsson
2007-11-28 16:14       ` Tassilo Horn
2007-12-02  1:29       ` Paul Jarc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).