Gnus development mailing list
 help / color / mirror / Atom feed
* [PATCH 0/2] two minor fixes for new/empty nnimap group handling
@ 2015-07-01 11:37 Bjørn Mork
  2015-07-01 11:37 ` [PATCH 1/2] nnimap.el (nnimap-request-group): don't make nil into a list Bjørn Mork
                   ` (5 more replies)
  0 siblings, 6 replies; 25+ messages in thread
From: Bjørn Mork @ 2015-07-01 11:37 UTC (permalink / raw)
  To: ding; +Cc: Bjørn Mork

The recent nnimap speedups introduced a couple of regressions wrt
new and empty nnimap groups. This prevents Gnus from creating new
IMAP groups.

These two patches fix the problems for me, but are created in the
way I usually do lisp: by mindless trial and error until emacs
stops complaining. I.e., there might be much better ways to fix
this...

Anyway: Works For Me (tm)


Bjørn Mork (2):
  nnimap.el (nnimap-request-group): don't make nil into a list
  nnimap.el (nnimap-request-group): group could be empty

 lisp/nnimap.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

-- 
2.1.4




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

* [PATCH 1/2] nnimap.el (nnimap-request-group): don't make nil into a list
  2015-07-01 11:37 [PATCH 0/2] two minor fixes for new/empty nnimap group handling Bjørn Mork
@ 2015-07-01 11:37 ` Bjørn Mork
  2015-07-01 11:37 ` [PATCH 2/2] nnimap.el (nnimap-request-group): group could be empty Bjørn Mork
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 25+ messages in thread
From: Bjørn Mork @ 2015-07-01 11:37 UTC (permalink / raw)
  To: ding; +Cc: Bjørn Mork

(list info) creates a list even if info is nil.  The list is later
evaluated in a boolean context, expecting to detect empty input as
false.  This fails since the list is always true, resulting in
 (wrong-type-argument stringp nil)

Signed-off-by: Bjørn Mork <bjorn@mork.no>
---
 lisp/nnimap.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index c476be6..ac32c64 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -810,7 +810,7 @@ textual parts.")
 		  (not (setq active
 			     (nth 2 (assoc group nnimap-current-infos)))))
 	  (let ((sequences (nnimap-retrieve-group-data-early
-			    server (list info))))
+			    server (when info (list info)))))
 	    (nnimap-finish-retrieve-group-infos server (list info) sequences
 						t)
 	    (setq active (nth 2 (assoc group nnimap-current-infos)))))
-- 
2.1.4




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

* [PATCH 2/2] nnimap.el (nnimap-request-group): group could be empty
  2015-07-01 11:37 [PATCH 0/2] two minor fixes for new/empty nnimap group handling Bjørn Mork
  2015-07-01 11:37 ` [PATCH 1/2] nnimap.el (nnimap-request-group): don't make nil into a list Bjørn Mork
@ 2015-07-01 11:37 ` Bjørn Mork
  2015-07-01 11:50 ` [PATCH 0/2] two minor fixes for new/empty nnimap group handling Alan Schmitt
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 25+ messages in thread
From: Bjørn Mork @ 2015-07-01 11:37 UTC (permalink / raw)
  To: ding; +Cc: Bjørn Mork

Newly created groups will be empty, with an active list
being nil.  Create a dummy cons list to avoid formatting
bailing out with
 (wrong-type-argument number-or-marker-p nil)

Signed-off-by: Bjørn Mork <bjorn@mork.no>
---
 lisp/nnimap.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index ac32c64..aecb6e5 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -815,6 +815,7 @@ textual parts.")
 						t)
 	    (setq active (nth 2 (assoc group nnimap-current-infos)))))
 	(erase-buffer)
+	(or active (setq active (cons 0 0)))
 	(insert (format "211 %d %d %d %S\n"
 			(- (cdr active) (car active))
 			(car active)
-- 
2.1.4




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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-01 11:37 [PATCH 0/2] two minor fixes for new/empty nnimap group handling Bjørn Mork
  2015-07-01 11:37 ` [PATCH 1/2] nnimap.el (nnimap-request-group): don't make nil into a list Bjørn Mork
  2015-07-01 11:37 ` [PATCH 2/2] nnimap.el (nnimap-request-group): group could be empty Bjørn Mork
@ 2015-07-01 11:50 ` Alan Schmitt
  2015-07-01 12:23   ` Bjørn Mork
  2015-07-02  2:18 ` Nikolaus Rath
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 25+ messages in thread
From: Alan Schmitt @ 2015-07-01 11:50 UTC (permalink / raw)
  To: ding

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

On 2015-07-01 13:37, Bjørn Mork <bjorn@mork.no> writes:

> The recent nnimap speedups introduced a couple of regressions wrt
> new and empty nnimap groups. This prevents Gnus from creating new
> IMAP groups.

Is this related to this:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20197 ?

If so, thank you very much! I had to go back to the gnus bundled with
emacs because of these bugs.

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Athmospheric CO₂ average (2015-05-30, Mauna Loa Observatory): 403.41 ppm

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-01 11:50 ` [PATCH 0/2] two minor fixes for new/empty nnimap group handling Alan Schmitt
@ 2015-07-01 12:23   ` Bjørn Mork
  2015-07-01 13:49     ` Alan Schmitt
  0 siblings, 1 reply; 25+ messages in thread
From: Bjørn Mork @ 2015-07-01 12:23 UTC (permalink / raw)
  To: ding

Alan Schmitt <alan.schmitt@polytechnique.org> writes:
> On 2015-07-01 13:37, Bjørn Mork <bjorn@mork.no> writes:
>
>> The recent nnimap speedups introduced a couple of regressions wrt
>> new and empty nnimap groups. This prevents Gnus from creating new
>> IMAP groups.
>
> Is this related to this:
> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20197 ?

Yes, that looks like the same issue.  I should have googled before
digging into this...  Your report would have helped if I just had gone
looking for it.

> If so, thank you very much! I had to go back to the gnus bundled with
> emacs because of these bugs.

Did the patches resolve your problem?


Bjørn




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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-01 12:23   ` Bjørn Mork
@ 2015-07-01 13:49     ` Alan Schmitt
  0 siblings, 0 replies; 25+ messages in thread
From: Alan Schmitt @ 2015-07-01 13:49 UTC (permalink / raw)
  To: ding

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

On 2015-07-01 14:23, Bjørn Mork <bjorn@mork.no> writes:

> Did the patches resolve your problem?

They look like they would solve it, but I'm at a very busy work time
right now and I cannot test them. Things should calm down later in the
month, and I'll give it a try.

Best,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Athmospheric CO₂ average (2015-05-30, Mauna Loa Observatory): 403.41 ppm

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-01 11:37 [PATCH 0/2] two minor fixes for new/empty nnimap group handling Bjørn Mork
                   ` (2 preceding siblings ...)
  2015-07-01 11:50 ` [PATCH 0/2] two minor fixes for new/empty nnimap group handling Alan Schmitt
@ 2015-07-02  2:18 ` Nikolaus Rath
  2015-07-06  2:45 ` Eric Abrahamsen
  2015-07-06 15:32 ` Dan Christensen
  5 siblings, 0 replies; 25+ messages in thread
From: Nikolaus Rath @ 2015-07-02  2:18 UTC (permalink / raw)
  To: ding

On Jul 01 2015, Bjørn Mork <bjorn@mork.no> wrote:
> The recent nnimap speedups introduced a couple of regressions wrt
> new and empty nnimap groups. This prevents Gnus from creating new
> IMAP groups.
>
> These two patches fix the problems for me, but are created in the
> way I usually do lisp: by mindless trial and error until emacs
> stops complaining. I.e., there might be much better ways to fix
> this...

I think it would be a good idea to also send these patches to the bug
tracker, so they don't get lost (I posted a few other IMAP related
patches about a month ago but never got any response from the
developers).

Best,
-Nikolaus

-- 
GPG encrypted emails preferred. Key id: 0xD113FCAC3C4E599F
Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F

             »Time flies like an arrow, fruit flies like a Banana.«



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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-01 11:37 [PATCH 0/2] two minor fixes for new/empty nnimap group handling Bjørn Mork
                   ` (3 preceding siblings ...)
  2015-07-02  2:18 ` Nikolaus Rath
@ 2015-07-06  2:45 ` Eric Abrahamsen
  2015-07-06  8:40   ` Bjørn Mork
  2015-07-06 15:32 ` Dan Christensen
  5 siblings, 1 reply; 25+ messages in thread
From: Eric Abrahamsen @ 2015-07-06  2:45 UTC (permalink / raw)
  To: Bjørn Mork; +Cc: ding

Bjørn Mork <bjorn@mork.no> writes:

> The recent nnimap speedups introduced a couple of regressions wrt
> new and empty nnimap groups. This prevents Gnus from creating new
> IMAP groups.
>
> These two patches fix the problems for me, but are created in the
> way I usually do lisp: by mindless trial and error until emacs
> stops complaining. I.e., there might be much better ways to fix
> this...
>
> Anyway: Works For Me (tm)
>
>
> Bjørn Mork (2):
>   nnimap.el (nnimap-request-group): don't make nil into a list
>   nnimap.el (nnimap-request-group): group could be empty
>
>  lisp/nnimap.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Hi Bjørn,

I'm guessing you only see this when you move a message from one group
into a non-existent group, and you're prompted to create the new group,
and it gives you an error. Is that right?

The group actually is created, it just gives an error when it's
re-selected. That's because the move/copy process doesn't automatically
subscribe to the group and register it with Gnus: if you go into the
*Server* buffer and open the group list for the server in question,
you'll see the new group there, unsubscribed.

My feeling is that groups which are created as part of the article
move/copy process should be automatically subscribed to, and registered
with Gnus (ie entered into gnus-newsrc-hashtb). That would solve this
problem, and also seems like the Right Thing to Do.

Does anyone have any opinions on this? I'll work up a patch, if not.

Eric



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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-06  2:45 ` Eric Abrahamsen
@ 2015-07-06  8:40   ` Bjørn Mork
  2015-07-06 15:11     ` Eric Abrahamsen
  0 siblings, 1 reply; 25+ messages in thread
From: Bjørn Mork @ 2015-07-06  8:40 UTC (permalink / raw)
  To: Eric Abrahamsen; +Cc: ding



On July 6, 2015 4:45:46 AM CEST, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
>Bjørn Mork <bjorn@mork.no> writes:
>
>> The recent nnimap speedups introduced a couple of regressions wrt
>> new and empty nnimap groups. This prevents Gnus from creating new
>> IMAP groups.
>>
>> These two patches fix the problems for me, but are created in the
>> way I usually do lisp: by mindless trial and error until emacs
>> stops complaining. I.e., there might be much better ways to fix
>> this...
>>
>> Anyway: Works For Me (tm)
>>
>>
>> Bjørn Mork (2):
>>   nnimap.el (nnimap-request-group): don't make nil into a list
>>   nnimap.el (nnimap-request-group): group could be empty
>>
>>  lisp/nnimap.el | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>
>Hi Bjørn,
>
>I'm guessing you only see this when you move a message from one group
>into a non-existent group, and you're prompted to create the new group,
>and it gives you an error. Is that right?
>
>The group actually is created, it just gives an error when it's
>re-selected. That's because the move/copy process doesn't automatically
>subscribe to the group and register it with Gnus: if you go into the
>*Server* buffer and open the group list for the server in question,
>you'll see the new group there, unsubscribed.

Yes, that's the typical situation where I see this. I didn't realise that the group isn't immediately subscribed to.

Btw, does this mean that copying to any unsubscribed group will fail, or am I misunderstanding? If not, then that doesn't seem right. I do have a couple of use cases where it makes sense to move or copy into groups which I'm not interested in subscribing to.

>My feeling is that groups which are created as part of the article
>move/copy process should be automatically subscribed to, and registered
>with Gnus (ie entered into gnus-newsrc-hashtb). That would solve this
>problem, and also seems like the Right Thing to Do.
>
>Does anyone have any opinions on this? I'll work up a patch, if not.

Sounds perfect to me. Thanks


Bjørn




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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-06  8:40   ` Bjørn Mork
@ 2015-07-06 15:11     ` Eric Abrahamsen
  0 siblings, 0 replies; 25+ messages in thread
From: Eric Abrahamsen @ 2015-07-06 15:11 UTC (permalink / raw)
  To: ding

Bjørn Mork <bjorn@mork.no> writes:

> On July 6, 2015 4:45:46 AM CEST, Eric Abrahamsen <eric@ericabrahamsen.net> wrote:
>>Bjørn Mork <bjorn@mork.no> writes:
>>
>>> The recent nnimap speedups introduced a couple of regressions wrt
>>> new and empty nnimap groups. This prevents Gnus from creating new
>>> IMAP groups.
>>>
>>> These two patches fix the problems for me, but are created in the
>>> way I usually do lisp: by mindless trial and error until emacs
>>> stops complaining. I.e., there might be much better ways to fix
>>> this...
>>>
>>> Anyway: Works For Me (tm)
>>>
>>>
>>> Bjørn Mork (2):
>>>   nnimap.el (nnimap-request-group): don't make nil into a list
>>>   nnimap.el (nnimap-request-group): group could be empty
>>>
>>>  lisp/nnimap.el | 3 ++-
>>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>>Hi Bjørn,
>>
>>I'm guessing you only see this when you move a message from one group
>>into a non-existent group, and you're prompted to create the new group,
>>and it gives you an error. Is that right?
>>
>>The group actually is created, it just gives an error when it's
>>re-selected. That's because the move/copy process doesn't automatically
>>subscribe to the group and register it with Gnus: if you go into the
>>*Server* buffer and open the group list for the server in question,
>>you'll see the new group there, unsubscribed.
>
> Yes, that's the typical situation where I see this. I didn't realise that the group isn't immediately subscribed to.
>
> Btw, does this mean that copying to any unsubscribed group will fail,
> or am I misunderstanding? If not, then that doesn't seem right. I do
> have a couple of use cases where it makes sense to move or copy into
> groups which I'm not interested in subscribing to.

I wasn't quite clear about the difference between subscribed and
"registered". You can copy into unsubscribed groups without any trouble.
"Registered" is a term I made up just to say that Gnus knows about the
group and is keeping track of attributes for it -- this ought to be the
case no matter what. My proposed solution would both register the group,
and subscribe it. An alternative would be to register the group and
*not* subscribe it, but given that it's got to be one or the other, I'd
lean towards subscribing.

What do you think?

>>My feeling is that groups which are created as part of the article
>>move/copy process should be automatically subscribed to, and registered
>>with Gnus (ie entered into gnus-newsrc-hashtb). That would solve this
>>problem, and also seems like the Right Thing to Do.
>>
>>Does anyone have any opinions on this? I'll work up a patch, if not.
>
> Sounds perfect to me. Thanks
>
>
> Bjørn




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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-01 11:37 [PATCH 0/2] two minor fixes for new/empty nnimap group handling Bjørn Mork
                   ` (4 preceding siblings ...)
  2015-07-06  2:45 ` Eric Abrahamsen
@ 2015-07-06 15:32 ` Dan Christensen
  2015-07-07  2:48   ` Eric Abrahamsen
  5 siblings, 1 reply; 25+ messages in thread
From: Dan Christensen @ 2015-07-06 15:32 UTC (permalink / raw)
  To: ding

Bjørn Mork <bjorn@mork.no> writes:

> The recent nnimap speedups introduced a couple of regressions wrt
> new and empty nnimap groups. This prevents Gnus from creating new
> IMAP groups.
>
> These two patches fix the problems for me, but are created in the
> way I usually do lisp: by mindless trial and error until emacs
> stops complaining. I.e., there might be much better ways to fix
> this...

I tried these two one-line patches, and they allowed me to use nnmairix
again, although it wasn't smooth.

The way nnmairix works is that it gets mairix to put the search results
in a group on another backend (nnimap in my case).  This group is *not*
subscribed or accessed directly by the user.  Instead, the nnmairix
backend has a virtual group which shows the messages in the unsubscribed
nnimap group.

To get this to work, I needed to subscribe to the (usually hidden)
nnimap group containing the search results and enter it once.  Then the
search results were visible in the nnmairix virtual group.

So something is still slightly broken, but at least this patch provides
an improvement.

Dan




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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-06 15:32 ` Dan Christensen
@ 2015-07-07  2:48   ` Eric Abrahamsen
  2015-07-07 23:12     ` Dan Christensen
  0 siblings, 1 reply; 25+ messages in thread
From: Eric Abrahamsen @ 2015-07-07  2:48 UTC (permalink / raw)
  To: ding

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

Dan Christensen <jdc@uwo.ca> writes:

> Bjørn Mork <bjorn@mork.no> writes:
>
>> The recent nnimap speedups introduced a couple of regressions wrt
>> new and empty nnimap groups. This prevents Gnus from creating new
>> IMAP groups.
>>
>> These two patches fix the problems for me, but are created in the
>> way I usually do lisp: by mindless trial and error until emacs
>> stops complaining. I.e., there might be much better ways to fix
>> this...
>
> I tried these two one-line patches, and they allowed me to use nnmairix
> again, although it wasn't smooth.
>
> The way nnmairix works is that it gets mairix to put the search results
> in a group on another backend (nnimap in my case).  This group is *not*
> subscribed or accessed directly by the user.  Instead, the nnmairix
> backend has a virtual group which shows the messages in the unsubscribed
> nnimap group.
>
> To get this to work, I needed to subscribe to the (usually hidden)
> nnimap group containing the search results and enter it once.  Then the
> search results were visible in the nnmairix virtual group.
>
> So something is still slightly broken, but at least this patch provides
> an improvement.

This patch might offer the right solution: the group creation process
sets the subscription level for the new group. This triggers all the
necessary processes (I think) to get the group noticed by Gnus, so it
doesn't trigger errors or require you to manually enter it. The other
backends do something similar.

The patch also checks the group to see if it should be automatically
subscribed or not, so if for example you don't want these groups
subscribed (a la Dan's situation) you can mess with
`gnus-auto-subscribed-groups' as per the nnmairix manual to prevent that
from happening.

Please give this patch a whirl and see how it works.

Eric



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Tell-Gnus-about-newly-created-imap-groups.patch --]
[-- Type: text/x-diff, Size: 1367 bytes --]

From 2d2388ef099ab4105d6e0106a33495e995d73d6a Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <eric@ericabrahamsen.net>
Date: Tue, 7 Jul 2015 10:39:37 +0800
Subject: [PATCH] Tell Gnus about newly-created imap groups

* lisp/nnimap.el (nnimap-request-create-group): Upon successful
  creation, register the new group with Gnus.
---
 lisp/nnimap.el | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index 208fd07..0411d9a 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -861,7 +861,18 @@ textual parts.")
   (setq group (nnimap-decode-gnus-group group))
   (when (nnimap-change-group nil server)
     (with-current-buffer (nnimap-buffer)
-      (car (nnimap-command "CREATE %S" (utf7-encode group t))))))
+      (when (car (nnimap-command "CREATE %S" (utf7-encode group t)))
+	(let* ((method (gnus-server-to-method
+			(format "nnimap:%s" server)))
+	       (qualname (gnus-group-prefixed-name
+			  group method))
+	       (sub-level
+		(if (eq (gnus-matches-options-n qualname) 'subscribe)
+		    gnus-level-default-subscribed
+		  gnus-level-default-unsubscribed)))
+	  (unless (gnus-group-entry qualname)
+	    (gnus-group-change-level qualname sub-level))
+	  t)))))
 
 (deffoo nnimap-request-delete-group (group &optional force server)
   (setq group (nnimap-decode-gnus-group group))
-- 
2.4.5


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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-07  2:48   ` Eric Abrahamsen
@ 2015-07-07 23:12     ` Dan Christensen
  2015-07-08  4:20       ` Eric Abrahamsen
  2015-07-08 12:41       ` Eric Abrahamsen
  0 siblings, 2 replies; 25+ messages in thread
From: Dan Christensen @ 2015-07-07 23:12 UTC (permalink / raw)
  To: ding

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Dan Christensen <jdc@uwo.ca> writes:
>
>> I tried these two one-line patches, and they allowed me to use nnmairix
>> again, although it wasn't smooth.

[...]

> This patch might offer the right solution: the group creation process
> sets the subscription level for the new group. This triggers all the
> necessary processes (I think) to get the group noticed by Gnus, so it
> doesn't trigger errors or require you to manually enter it.

[...]

I tried your patch after unapplying Bjøjn Mork's patch, and I got the 
same backtrace as usual, due to a nil value getting passed in.  See
below.

Then I tried applying both your patch and Mork's patch, and didn't see
any difference in behaviour compared to Mork's patch alone.  I even
deleted the imap group that nnmairix uses for its storage, in the hopes
that this would cause your new code to run, and still saw no change.
I had to manually subscribe to the group and refresh it before the
nnmairix group could be entered.

Thanks for the help so far!

Dan

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("^[^:]+:" nil)
  (if (string-match "^[^:]+:" gname) (substring gname (match-end 0)) gname)
  (let ((gname (nth 0 info))) (if (string-match "^[^:]+:" gname) (substring gname (match-end 0)) gname))
  (nnimap-decode-gnus-group (let ((gname (nth 0 info))) (if (string-match "^[^:]+:" gname) (substring gname (match-end 0)) gname)))
  (setq params (nth 5 info) group (nnimap-decode-gnus-group (let ((gname (nth 0 info))) (if (string-match "^[^:]+:" gname) (substring gname (match-end 0)) gname))) active (cdr (assq (quote active) params)) unexist (assq (quote unexist) (nth 3 info)) uidvalidity (cdr (assq (quote uidvalidity) params)) modseq (cdr (assq (quote modseq) params)))
  (while --dolist-tail-- (setq info (car --dolist-tail--)) (setq params (nth 5 info) group (nnimap-decode-gnus-group (let ((gname (nth 0 info))) (if (string-match "^[^:]+:" gname) (substring gname (match-end 0)) gname))) active (cdr (assq (quote active) params)) unexist (assq (quote unexist) (nth 3 info)) uidvalidity (cdr (assq (quote uidvalidity) params)) modseq (cdr (assq (quote modseq) params))) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-examined) (quote nnimap))) (let* ((v nnimap-object)) (aset v 10 group))) (if (and qresyncp uidvalidity active modseq unexist) (setq sequences (cons (list (nnimap-send-command "EXAMINE %S (%s (%s %s))" (utf7-encode group t) (nnimap-quirk "QRESYNC") uidvalidity modseq) (quote qresync) nil group (quote qresync)) sequences)) (let ((command (if uidvalidity "EXAMINE" "SELECT")) start) (if (and active uidvalidity unexist) (setq start (max 1 (- (cdr active) 100))) (progn (or (and (vectorp nnimap-object) (>= ... 13) (memq ... cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-initial-resync) (quote nnimap))) (let* ((v nnimap-object)) (aset v 12 (+ ... 1)))) (setq start 1)) (setq sequences (cons (list (nnimap-send-command "%s %S" command (utf7-encode group t)) (nnimap-send-command "UID FETCH %d:* FLAGS" start) start group command) sequences)))) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (let ((--dolist-tail-- infos) info) (while --dolist-tail-- (setq info (car --dolist-tail--)) (setq params (nth 5 info) group (nnimap-decode-gnus-group (let ((gname (nth 0 info))) (if (string-match "^[^:]+:" gname) (substring gname (match-end 0)) gname))) active (cdr (assq (quote active) params)) unexist (assq (quote unexist) (nth 3 info)) uidvalidity (cdr (assq (quote uidvalidity) params)) modseq (cdr (assq (quote modseq) params))) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-examined) (quote nnimap))) (let* ((v nnimap-object)) (aset v 10 group))) (if (and qresyncp uidvalidity active modseq unexist) (setq sequences (cons (list (nnimap-send-command "EXAMINE %S (%s (%s %s))" (utf7-encode group t) (nnimap-quirk "QRESYNC") uidvalidity modseq) (quote qresync) nil group (quote qresync)) sequences)) (let ((command (if uidvalidity "EXAMINE" "SELECT")) start) (if (and active uidvalidity unexist) (setq start (max 1 (- ... 100))) (progn (or (and ... ... ...) (error "%s accessing a non-%s" ... ...)) (let* (...) (aset v 12 ...))) (setq start 1)) (setq sequences (cons (list (nnimap-send-command "%s %S" command ...) (nnimap-send-command "UID FETCH %d:* FLAGS" start) start group command) sequences)))) (setq --dolist-tail-- (cdr --dolist-tail--))))
  (progn (let ((--dolist-tail-- infos) info) (while --dolist-tail-- (setq info (car --dolist-tail--)) (setq params (nth 5 info) group (nnimap-decode-gnus-group (let ((gname ...)) (if (string-match "^[^:]+:" gname) (substring gname ...) gname))) active (cdr (assq (quote active) params)) unexist (assq (quote unexist) (nth 3 info)) uidvalidity (cdr (assq (quote uidvalidity) params)) modseq (cdr (assq (quote modseq) params))) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-examined) (quote nnimap))) (let* ((v nnimap-object)) (aset v 10 group))) (if (and qresyncp uidvalidity active modseq unexist) (setq sequences (cons (list (nnimap-send-command "EXAMINE %S (%s (%s %s))" ... ... uidvalidity modseq) (quote qresync) nil group (quote qresync)) sequences)) (let ((command (if uidvalidity "EXAMINE" "SELECT")) start) (if (and active uidvalidity unexist) (setq start (max 1 ...)) (progn (or ... ...) (let* ... ...)) (setq start 1)) (setq sequences (cons (list ... ... start group command) sequences)))) (setq --dolist-tail-- (cdr --dolist-tail--)))))
  (let ((qresyncp (nnimap-capability "QRESYNC")) params groups sequences active uidvalidity modseq group unexist) (progn (let ((--dolist-tail-- infos) info) (while --dolist-tail-- (setq info (car --dolist-tail--)) (setq params (nth 5 info) group (nnimap-decode-gnus-group (let (...) (if ... ... gname))) active (cdr (assq (quote active) params)) unexist (assq (quote unexist) (nth 3 info)) uidvalidity (cdr (assq (quote uidvalidity) params)) modseq (cdr (assq (quote modseq) params))) (progn (or (and (vectorp nnimap-object) (>= ... 13) (memq ... cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-examined) (quote nnimap))) (let* ((v nnimap-object)) (aset v 10 group))) (if (and qresyncp uidvalidity active modseq unexist) (setq sequences (cons (list ... ... nil group ...) sequences)) (let ((command ...) start) (if (and active uidvalidity unexist) (setq start ...) (progn ... ...) (setq start 1)) (setq sequences (cons ... sequences)))) (setq --dolist-tail-- (cdr --dolist-tail--))))) sequences)
  (save-current-buffer (set-buffer (nnimap-buffer)) (erase-buffer) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-group) (quote nnimap))) (let* ((v nnimap-object)) (aset v 1 nil))) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-initial-resync) (quote nnimap))) (let* ((v nnimap-object)) (aset v 12 0))) (let ((qresyncp (nnimap-capability "QRESYNC")) params groups sequences active uidvalidity modseq group unexist) (progn (let ((--dolist-tail-- infos) info) (while --dolist-tail-- (setq info (car --dolist-tail--)) (setq params (nth 5 info) group (nnimap-decode-gnus-group (let ... ...)) active (cdr (assq ... params)) unexist (assq (quote unexist) (nth 3 info)) uidvalidity (cdr (assq ... params)) modseq (cdr (assq ... params))) (progn (or (and ... ... ...) (error "%s accessing a non-%s" ... ...)) (let* (...) (aset v 10 group))) (if (and qresyncp uidvalidity active modseq unexist) (setq sequences (cons ... sequences)) (let (... start) (if ... ... ... ...) (setq sequences ...))) (setq --dolist-tail-- (cdr --dolist-tail--))))) sequences))
  (progn (save-current-buffer (set-buffer (nnimap-buffer)) (erase-buffer) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-group) (quote nnimap))) (let* ((v nnimap-object)) (aset v 1 nil))) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-initial-resync) (quote nnimap))) (let* ((v nnimap-object)) (aset v 12 0))) (let ((qresyncp (nnimap-capability "QRESYNC")) params groups sequences active uidvalidity modseq group unexist) (progn (let ((--dolist-tail-- infos) info) (while --dolist-tail-- (setq info (car --dolist-tail--)) (setq params (nth 5 info) group (nnimap-decode-gnus-group ...) active (cdr ...) unexist (assq ... ...) uidvalidity (cdr ...) modseq (cdr ...)) (progn (or ... ...) (let* ... ...)) (if (and qresyncp uidvalidity active modseq unexist) (setq sequences ...) (let ... ... ...)) (setq --dolist-tail-- (cdr --dolist-tail--))))) sequences)))
  (if (and (nnimap-change-group nil server) infos) (progn (save-current-buffer (set-buffer (nnimap-buffer)) (erase-buffer) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-group) (quote nnimap))) (let* ((v nnimap-object)) (aset v 1 nil))) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-initial-resync) (quote nnimap))) (let* ((v nnimap-object)) (aset v 12 0))) (let ((qresyncp (nnimap-capability "QRESYNC")) params groups sequences active uidvalidity modseq group unexist) (progn (let ((--dolist-tail-- infos) info) (while --dolist-tail-- (setq info ...) (setq params ... group ... active ... unexist ... uidvalidity ... modseq ...) (progn ... ...) (if ... ... ...) (setq --dolist-tail-- ...)))) sequences))))
  nnimap-retrieve-group-data-early("rocky" (nil))
  (let ((sequences (nnimap-retrieve-group-data-early server (list info)))) (nnimap-finish-retrieve-group-infos server (list info) sequences t) (setq active (nth 2 (assoc group nnimap-current-infos))))
  (progn (let ((sequences (nnimap-retrieve-group-data-early server (list info)))) (nnimap-finish-retrieve-group-infos server (list info) sequences t) (setq active (nth 2 (assoc group nnimap-current-infos)))))
  (if (or (not dont-check) (not (setq active (nth 2 (assoc group nnimap-current-infos))))) (progn (let ((sequences (nnimap-retrieve-group-data-early server (list info)))) (nnimap-finish-retrieve-group-infos server (list info) sequences t) (setq active (nth 2 (assoc group nnimap-current-infos))))))
  (progn (if (or (not dont-check) (not (setq active (nth 2 (assoc group nnimap-current-infos))))) (progn (let ((sequences (nnimap-retrieve-group-data-early server (list info)))) (nnimap-finish-retrieve-group-infos server (list info) sequences t) (setq active (nth 2 (assoc group nnimap-current-infos)))))) (erase-buffer) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t)
  (if result (progn (if (or (not dont-check) (not (setq active (nth 2 (assoc group nnimap-current-infos))))) (progn (let ((sequences (nnimap-retrieve-group-data-early server ...))) (nnimap-finish-retrieve-group-infos server (list info) sequences t) (setq active (nth 2 (assoc group nnimap-current-infos)))))) (erase-buffer) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t))
  (save-current-buffer (set-buffer nntp-server-buffer) (if result (progn (if (or (not dont-check) (not (setq active (nth 2 ...)))) (progn (let ((sequences ...)) (nnimap-finish-retrieve-group-infos server (list info) sequences t) (setq active (nth 2 ...))))) (erase-buffer) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t)))
  (let ((result (nnimap-change-group (if (and (not dont-check) (assoc group nnimap-current-infos)) nil group) server)) articles active marks high low) (save-current-buffer (set-buffer nntp-server-buffer) (if result (progn (if (or (not dont-check) (not (setq active ...))) (progn (let (...) (nnimap-finish-retrieve-group-infos server ... sequences t) (setq active ...)))) (erase-buffer) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t))))
  nnimap-request-group("zz_mairix-nnmairixsearch-1" "rocky")
  apply(nnimap-request-group ("zz_mairix-nnmairixsearch-1" "rocky"))
  nnmairix-call-backend("request-group" "zz_mairix-nnmairixsearch-1" "rocky")
  nnmairix-request-group-with-article-number-correction("zz_mairix-nnmairixsearch-1" "nnmairix+mairixserver:nnmairixsearch")
  nnmairix-request-group("nnmairixsearch" "mairixserver" t ("nnmairix+mairixserver:nnmairixsearch" 2 nil nil (nnmairix "mairixserver" (nnmairix-backend nnimap) (nnmairix-backend-server "rocky") (nnmairix-mairix-command "mairix") (nnmairix-hidden-folders t) (nnmairix-default-group "nnmairixsearch")) ((query "test" "d:1w-") (numcorr nil 47776 47804) (display) (folder . "zz_mairix-nnmairixsearch-1") (threads))))
  gnus-request-group("nnmairix+mairixserver:nnmairixsearch" t nil ("nnmairix+mairixserver:nnmairixsearch" 2 nil nil (nnmairix "mairixserver" (nnmairix-backend nnimap) (nnmairix-backend-server "rocky") (nnmairix-mairix-command "mairix") (nnmairix-hidden-folders t) (nnmairix-default-group "nnmairixsearch")) ((query "test" "d:1w-") (numcorr nil 47776 47804) (display) (folder . "zz_mairix-nnmairixsearch-1") (threads))))
  gnus-select-newsgroup("nnmairix+mairixserver:nnmairixsearch" t nil)
  gnus-summary-read-group-1("nnmairix+mairixserver:nnmairixsearch" t nil nil nil nil)
  gnus-summary-read-group("nnmairix+mairixserver:nnmairixsearch" t nil nil nil nil nil)
  gnus-group-read-group(nil nil nil)
  gnus-topic-read-group(nil)
  call-interactively(gnus-topic-read-group nil nil)




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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-07 23:12     ` Dan Christensen
@ 2015-07-08  4:20       ` Eric Abrahamsen
  2015-07-08 21:45         ` Dan Christensen
  2015-07-08 12:41       ` Eric Abrahamsen
  1 sibling, 1 reply; 25+ messages in thread
From: Eric Abrahamsen @ 2015-07-08  4:20 UTC (permalink / raw)
  To: ding

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

Dan Christensen <jdc@uwo.ca> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Dan Christensen <jdc@uwo.ca> writes:
>>
>>> I tried these two one-line patches, and they allowed me to use nnmairix
>>> again, although it wasn't smooth.
>
> [...]
>
>> This patch might offer the right solution: the group creation process
>> sets the subscription level for the new group. This triggers all the
>> necessary processes (I think) to get the group noticed by Gnus, so it
>> doesn't trigger errors or require you to manually enter it.
>
> [...]
>
> I tried your patch after unapplying Bjøjn Mork's patch, and I got the 
> same backtrace as usual, due to a nil value getting passed in.  See
> below.
>
> Then I tried applying both your patch and Mork's patch, and didn't see
> any difference in behaviour compared to Mork's patch alone.  I even
> deleted the imap group that nnmairix uses for its storage, in the hopes
> that this would cause your new code to run, and still saw no change.
> I had to manually subscribe to the group and refresh it before the
> nnmairix group could be entered.
>
> Thanks for the help so far!

Ha, well that was a bust, wasn't it? Turns out there were multiple
issues here -- the patch I sent fixed group creation via moving
messages, but nnmairix calls `nnimap-request-group' with INFO set to
nil, so Bjørn's solution was still necessary. I've made some more
adjustments to the group creation process, which I hope won't mess
anything else up. Would you mind trying these two patches?

Thanks,
Eric


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Tell-Gnus-about-newly-created-imap-groups.patch --]
[-- Type: text/x-diff, Size: 1905 bytes --]

From 175107159bd61cf961eb39983f61d33925febb9c Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <eric@ericabrahamsen.net>
Date: Tue, 7 Jul 2015 10:39:37 +0800
Subject: [PATCH 1/2] Tell Gnus about newly-created imap groups

* lisp/nnimap.el (nnimap-request-create-group): Upon successful
  creation, register the new group with Gnus.
  (nnimap-request-group-scan): Update/store group info even if marks
  are nil, this is necessary for newly-created groups.
---
 lisp/nnimap.el | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index 40610e1..a1c2c1a 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -839,8 +839,7 @@ textual parts.")
 		 (nnimap-parse-flags
 		  (list (list group-sequence flag-sequence
 			      1 group "SELECT")))))
-	  (when (and info
-		     marks)
+	  (when info
 	    (nnimap-update-infos marks (list info))
 	    (nnimap-store-info info (gnus-active (gnus-info-group info))))
 	  (goto-char (point-max))
@@ -861,7 +860,19 @@ textual parts.")
   (setq group (nnimap-decode-gnus-group group))
   (when (nnimap-change-group nil server)
     (with-current-buffer (nnimap-buffer)
-      (car (nnimap-command "CREATE %S" (utf7-encode group t))))))
+      (when (car (nnimap-command "CREATE %S" (utf7-encode group t)))
+	(let* ((method (gnus-server-to-method
+			(format "nnimap:%s" server)))
+	       (qualname (gnus-group-prefixed-name
+			  group method))
+	       (sub-level
+		(if (eq (gnus-matches-options-n qualname) 'subscribe)
+		    gnus-level-default-subscribed
+		  gnus-level-default-unsubscribed)))
+	  (unless (gnus-group-entry qualname)
+	    (gnus-group-change-level qualname sub-level))
+	  (nnimap-request-group-scan qualname server (gnus-get-info qualname))
+	  t)))))
 
 (deffoo nnimap-request-delete-group (group &optional force server)
   (setq group (nnimap-decode-gnus-group group))
-- 
2.4.5


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-Handle-nil-info-argument-to-nnimap-request-group.patch --]
[-- Type: text/x-diff, Size: 1171 bytes --]

From 127951fd7c8f95e62131cddb0f6badf5588b0452 Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <eric@ericabrahamsen.net>
Date: Wed, 8 Jul 2015 12:14:49 +0800
Subject: [PATCH 2/2] Handle nil info argument to nnimap-request-group

* lisp/nnimap.el (nnimap-request-group): Some functions call this with
  the INFO argument set to nil.
---
 lisp/nnimap.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index a1c2c1a..3c6df4d 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -803,6 +803,7 @@ textual parts.")
 		     nil
 		   group)
 		 server))
+	(info (when info (list info)))
 	active)
     (with-current-buffer nntp-server-buffer
       (when result
@@ -810,8 +811,8 @@ textual parts.")
 		  (not (setq active
 			     (nth 2 (assoc group nnimap-current-infos)))))
 	  (let ((sequences (nnimap-retrieve-group-data-early
-			    server (list info))))
-	    (nnimap-finish-retrieve-group-infos server (list info) sequences
+			    server info)))
+	    (nnimap-finish-retrieve-group-infos server info sequences
 						t)
 	    (setq active (nth 2 (assoc group nnimap-current-infos)))))
 	(erase-buffer)
-- 
2.4.5


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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-07 23:12     ` Dan Christensen
  2015-07-08  4:20       ` Eric Abrahamsen
@ 2015-07-08 12:41       ` Eric Abrahamsen
  1 sibling, 0 replies; 25+ messages in thread
From: Eric Abrahamsen @ 2015-07-08 12:41 UTC (permalink / raw)
  To: ding

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

Dan Christensen <jdc@uwo.ca> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Dan Christensen <jdc@uwo.ca> writes:
>>
>>> I tried these two one-line patches, and they allowed me to use nnmairix
>>> again, although it wasn't smooth.
>
> [...]
>
>> This patch might offer the right solution: the group creation process
>> sets the subscription level for the new group. This triggers all the
>> necessary processes (I think) to get the group noticed by Gnus, so it
>> doesn't trigger errors or require you to manually enter it.
>
> [...]
>
> I tried your patch after unapplying Bjøjn Mork's patch, and I got the 
> same backtrace as usual, due to a nil value getting passed in.  See
> below.
>
> Then I tried applying both your patch and Mork's patch, and didn't see
> any difference in behaviour compared to Mork's patch alone.  I even
> deleted the imap group that nnmairix uses for its storage, in the hopes
> that this would cause your new code to run, and still saw no change.
> I had to manually subscribe to the group and refresh it before the
> nnmairix group could be entered.

Hmm, I thought I replied to this earlier in the day, but it doesn't look
like the message is there. I'm resending this just in case. It turned
out that there are several issues at play, and the fact that nnmairix
calls `nnimap-group-scan' with INFO set to nil means that Bjørn's
approach is necessary no matter what. Anyway, here are a couple of new
patches, I hope people will try them out!

Eric


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Tell-Gnus-about-newly-created-imap-groups.patch --]
[-- Type: text/x-diff, Size: 1905 bytes --]

From 175107159bd61cf961eb39983f61d33925febb9c Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <eric@ericabrahamsen.net>
Date: Tue, 7 Jul 2015 10:39:37 +0800
Subject: [PATCH 1/2] Tell Gnus about newly-created imap groups

* lisp/nnimap.el (nnimap-request-create-group): Upon successful
  creation, register the new group with Gnus.
  (nnimap-request-group-scan): Update/store group info even if marks
  are nil, this is necessary for newly-created groups.
---
 lisp/nnimap.el | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index 40610e1..a1c2c1a 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -839,8 +839,7 @@ textual parts.")
 		 (nnimap-parse-flags
 		  (list (list group-sequence flag-sequence
 			      1 group "SELECT")))))
-	  (when (and info
-		     marks)
+	  (when info
 	    (nnimap-update-infos marks (list info))
 	    (nnimap-store-info info (gnus-active (gnus-info-group info))))
 	  (goto-char (point-max))
@@ -861,7 +860,19 @@ textual parts.")
   (setq group (nnimap-decode-gnus-group group))
   (when (nnimap-change-group nil server)
     (with-current-buffer (nnimap-buffer)
-      (car (nnimap-command "CREATE %S" (utf7-encode group t))))))
+      (when (car (nnimap-command "CREATE %S" (utf7-encode group t)))
+	(let* ((method (gnus-server-to-method
+			(format "nnimap:%s" server)))
+	       (qualname (gnus-group-prefixed-name
+			  group method))
+	       (sub-level
+		(if (eq (gnus-matches-options-n qualname) 'subscribe)
+		    gnus-level-default-subscribed
+		  gnus-level-default-unsubscribed)))
+	  (unless (gnus-group-entry qualname)
+	    (gnus-group-change-level qualname sub-level))
+	  (nnimap-request-group-scan qualname server (gnus-get-info qualname))
+	  t)))))
 
 (deffoo nnimap-request-delete-group (group &optional force server)
   (setq group (nnimap-decode-gnus-group group))
-- 
2.4.5


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0002-Handle-nil-info-argument-to-nnimap-request-group.patch --]
[-- Type: text/x-diff, Size: 1171 bytes --]

From 127951fd7c8f95e62131cddb0f6badf5588b0452 Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <eric@ericabrahamsen.net>
Date: Wed, 8 Jul 2015 12:14:49 +0800
Subject: [PATCH 2/2] Handle nil info argument to nnimap-request-group

* lisp/nnimap.el (nnimap-request-group): Some functions call this with
  the INFO argument set to nil.
---
 lisp/nnimap.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index a1c2c1a..3c6df4d 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -803,6 +803,7 @@ textual parts.")
 		     nil
 		   group)
 		 server))
+	(info (when info (list info)))
 	active)
     (with-current-buffer nntp-server-buffer
       (when result
@@ -810,8 +811,8 @@ textual parts.")
 		  (not (setq active
 			     (nth 2 (assoc group nnimap-current-infos)))))
 	  (let ((sequences (nnimap-retrieve-group-data-early
-			    server (list info))))
-	    (nnimap-finish-retrieve-group-infos server (list info) sequences
+			    server info)))
+	    (nnimap-finish-retrieve-group-infos server info sequences
 						t)
 	    (setq active (nth 2 (assoc group nnimap-current-infos)))))
 	(erase-buffer)
-- 
2.4.5


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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-08  4:20       ` Eric Abrahamsen
@ 2015-07-08 21:45         ` Dan Christensen
  2015-07-09  1:53           ` Eric Abrahamsen
  0 siblings, 1 reply; 25+ messages in thread
From: Dan Christensen @ 2015-07-08 21:45 UTC (permalink / raw)
  To: ding

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Ha, well that was a bust, wasn't it? Turns out there were multiple
> issues here -- the patch I sent fixed group creation via moving
> messages, but nnmairix calls `nnimap-request-group' with INFO set to
> nil, so Bjørn's solution was still necessary. I've made some more
> adjustments to the group creation process, which I hope won't mess
> anything else up. Would you mind trying these two patches?

I tried the two patches, without Bjørn's patches applied, and the first
hunk of your second patch didn't apply cleanly.  I applied it manually.
But now I get a different backtrace when trying to enter the group (see
below).  This is probably related to this change of Bjørn's:

            (nnimap-finish-retrieve-group-infos server (list info) sequences
                                                t)
            (setq active (nth 2 (assoc group nnimap-current-infos)))))
        (erase-buffer)
+       (or active (setq active (cons 0 0)))
        (insert (format "211 %d %d %d %S\n"
                        (- (cdr active) (car active))
                        (car active)

But I tried using Bjørn's patches instead of your second patch, and
still had some trouble.  Maybe it's something to do with the patch not
applying cleanly?  Or I might be using the wrong version of nnimap.el.
Are you using the latest git version?

Unfortunately, I don't have time to look into it further right now.

Thanks again for proposing fixes!

Dan

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  -(nil nil)
  (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)
  (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group))
  (progn (if (or (not dont-check) (not (setq active (nth 2 (assoc group nnimap-current-infos))))) (progn (let ((sequences (nnimap-retrieve-group-data-early server info))) (nnimap-finish-retrieve-group-infos server info sequences t) (setq active (nth 2 (assoc group nnimap-current-infos)))))) (erase-buffer) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t)
  (if result (progn (if (or (not dont-check) (not (setq active (nth 2 (assoc group nnimap-current-infos))))) (progn (let ((sequences (nnimap-retrieve-group-data-early server info))) (nnimap-finish-retrieve-group-infos server info sequences t) (setq active (nth 2 (assoc group nnimap-current-infos)))))) (erase-buffer) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t))
  (save-current-buffer (set-buffer nntp-server-buffer) (if result (progn (if (or (not dont-check) (not (setq active (nth 2 ...)))) (progn (let ((sequences ...)) (nnimap-finish-retrieve-group-infos server info sequences t) (setq active (nth 2 ...))))) (erase-buffer) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t)))
  (let ((result (nnimap-change-group (if (and (not dont-check) (assoc group nnimap-current-infos)) nil group) server)) (info (if info (progn (list info)))) articles active marks high low) (save-current-buffer (set-buffer nntp-server-buffer) (if result (progn (if (or (not dont-check) (not (setq active ...))) (progn (let (...) (nnimap-finish-retrieve-group-infos server info sequences t) (setq active ...)))) (erase-buffer) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t))))
  nnimap-request-group("zz_mairix-nnmairixsearch-1" "rocky")
  apply(nnimap-request-group ("zz_mairix-nnmairixsearch-1" "rocky"))
  nnmairix-call-backend("request-group" "zz_mairix-nnmairixsearch-1" "rocky")
  nnmairix-request-group-with-article-number-correction("zz_mairix-nnmairixsearch-1" "nnmairix+mairixserver:nnmairixsearch")
  nnmairix-request-group("nnmairixsearch" "mairixserver" t ("nnmairix+mairixserver:nnmairixsearch" 2 nil nil (nnmairix "mairixserver" (nnmairix-backend nnimap) (nnmairix-backend-server "rocky") (nnmairix-mairix-command "mairix") (nnmairix-hidden-folders t) (nnmairix-default-group "nnmairixsearch")) ((numcorr t 47827 47850) (query "lindi" "d:1w-") (display) (folder . "zz_mairix-nnmairixsearch-1") (threads))))
  gnus-request-group("nnmairix+mairixserver:nnmairixsearch" t nil ("nnmairix+mairixserver:nnmairixsearch" 2 nil nil (nnmairix "mairixserver" (nnmairix-backend nnimap) (nnmairix-backend-server "rocky") (nnmairix-mairix-command "mairix") (nnmairix-hidden-folders t) (nnmairix-default-group "nnmairixsearch")) ((numcorr t 47827 47850) (query "lindi" "d:1w-") (display) (folder . "zz_mairix-nnmairixsearch-1") (threads))))
  gnus-select-newsgroup("nnmairix+mairixserver:nnmairixsearch" nil nil)
  gnus-summary-read-group-1("nnmairix+mairixserver:nnmairixsearch" nil nil nil nil nil)
  gnus-summary-read-group("nnmairix+mairixserver:nnmairixsearch" nil nil nil nil nil nil)
  gnus-group-read-group(nil nil nil)
  gnus-topic-read-group(nil)
  call-interactively(gnus-topic-read-group nil nil)




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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-08 21:45         ` Dan Christensen
@ 2015-07-09  1:53           ` Eric Abrahamsen
  2015-07-09  2:52             ` Dan Christensen
  0 siblings, 1 reply; 25+ messages in thread
From: Eric Abrahamsen @ 2015-07-09  1:53 UTC (permalink / raw)
  To: ding

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

Dan Christensen <jdc@uwo.ca> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Ha, well that was a bust, wasn't it? Turns out there were multiple
>> issues here -- the patch I sent fixed group creation via moving
>> messages, but nnmairix calls `nnimap-request-group' with INFO set to
>> nil, so Bjørn's solution was still necessary. I've made some more
>> adjustments to the group creation process, which I hope won't mess
>> anything else up. Would you mind trying these two patches?
>
> I tried the two patches, without Bjørn's patches applied, and the first
> hunk of your second patch didn't apply cleanly.  I applied it manually.
> But now I get a different backtrace when trying to enter the group (see
> below).  This is probably related to this change of Bjørn's:
>
>             (nnimap-finish-retrieve-group-infos server (list info) sequences
>                                                 t)
>             (setq active (nth 2 (assoc group nnimap-current-infos)))))
>         (erase-buffer)
> +       (or active (setq active (cons 0 0)))
>         (insert (format "211 %d %d %d %S\n"
>                         (- (cdr active) (car active))
>                         (car active)
>
> But I tried using Bjørn's patches instead of your second patch, and
> still had some trouble.  Maybe it's something to do with the patch not
> applying cleanly?  Or I might be using the wrong version of nnimap.el.
> Are you using the latest git version?
>
> Unfortunately, I don't have time to look into it further right now.
>
> Thanks again for proposing fixes!

I pushed a small change to `nnimap-request-group' yesterday that would
have prevented the first patch from applying cleanly -- sorry, I should
have mentioned you'd need to pull again first.

I thought my changes to the group creation process would have ensured
that all new groups had an "active" entry, but I guess not.

I'd like to take one more whack at this, and then I'm going to give up
and just put Bjørn's guard in. Would you mind removing Bjørn's patches,
pulling once more, and trying these two?

Thanks!
Eric


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0002-Handle-nil-info-argument-to-nnimap-request-group.patch --]
[-- Type: text/x-diff, Size: 1171 bytes --]

From 9ac88493d7dab1aa2169230e329fda2c1550353e Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <eric@ericabrahamsen.net>
Date: Wed, 8 Jul 2015 12:14:49 +0800
Subject: [PATCH 2/2] Handle nil info argument to nnimap-request-group

* lisp/nnimap.el (nnimap-request-group): Some functions call this with
  the INFO argument set to nil.
---
 lisp/nnimap.el | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index e7a7aa4..ca97b51 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -803,6 +803,7 @@ textual parts.")
 		     nil
 		   group)
 		 server))
+	(info (when info (list info)))
 	active)
     (with-current-buffer nntp-server-buffer
       (when result
@@ -810,8 +811,8 @@ textual parts.")
 		  (not (setq active
 			     (nth 2 (assoc group nnimap-current-infos)))))
 	  (let ((sequences (nnimap-retrieve-group-data-early
-			    server (list info))))
-	    (nnimap-finish-retrieve-group-infos server (list info) sequences
+			    server info)))
+	    (nnimap-finish-retrieve-group-infos server info sequences
 						t)
 	    (setq active (nth 2 (assoc group nnimap-current-infos)))))
 	(erase-buffer)
-- 
2.4.5


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #3: 0001-Tell-Gnus-about-newly-created-imap-groups.patch --]
[-- Type: text/x-diff, Size: 1548 bytes --]

From c0b97aeee190f87ff2a19193f951852b17705faf Mon Sep 17 00:00:00 2001
From: Eric Abrahamsen <eric@ericabrahamsen.net>
Date: Tue, 7 Jul 2015 10:39:37 +0800
Subject: [PATCH 1/2] Tell Gnus about newly-created imap groups

* lisp/nnimap.el (nnimap-request-create-group): Upon successful
  creation, register the new group with Gnus.
---
 lisp/nnimap.el | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index 40610e1..e7a7aa4 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -861,7 +861,23 @@ textual parts.")
   (setq group (nnimap-decode-gnus-group group))
   (when (nnimap-change-group nil server)
     (with-current-buffer (nnimap-buffer)
-      (car (nnimap-command "CREATE %S" (utf7-encode group t))))))
+      (when (car (nnimap-command "CREATE %S" (utf7-encode group t)))
+	(let* ((method (gnus-server-to-method
+			(format "nnimap:%s" server)))
+	       (qualname (gnus-group-prefixed-name
+			  group method))
+	       (sub-level
+		(if (eq (gnus-matches-options-n qualname) 'subscribe)
+		    gnus-level-default-subscribed
+		  gnus-level-default-unsubscribed))
+	       info)
+	  (unless (gnus-group-entry qualname)
+	    (gnus-group-change-level qualname sub-level))
+	  (setq info (list (gnus-get-info qualname)))
+	  (nnimap-finish-retrieve-group-infos
+	   server info
+	   (nnimap-retrieve-group-data-early server info))
+	  t)))))
 
 (deffoo nnimap-request-delete-group (group &optional force server)
   (setq group (nnimap-decode-gnus-group group))
-- 
2.4.5


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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-09  1:53           ` Eric Abrahamsen
@ 2015-07-09  2:52             ` Dan Christensen
  2015-07-09 13:47               ` Dan Christensen
  2015-07-12  4:11               ` Eric Abrahamsen
  0 siblings, 2 replies; 25+ messages in thread
From: Dan Christensen @ 2015-07-09  2:52 UTC (permalink / raw)
  To: ding

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> I pushed a small change to `nnimap-request-group' yesterday that would
> have prevented the first patch from applying cleanly -- sorry, I should
> have mentioned you'd need to pull again first.

No problem!

> I thought my changes to the group creation process would have ensured
> that all new groups had an "active" entry, but I guess not.
>
> I'd like to take one more whack at this, and then I'm going to give up
> and just put Bjørn's guard in. Would you mind removing Bjørn's patches,
> pulling once more, and trying these two?

I just tried your latest patches against the latest git version.  As
before, the problem with info being nil is handled, but active is still
nil and I get the backtrace below.  If I add Bjørn's line

+	(or active (setq active (cons 0 0)))

then the error goes away, but Gnus thinks that the group is empty
(not surprisingly), so this isn't really a solution.

I only update Gnus periodically.  I had no trouble with nnmairix 
with the 2014/10/10 version, but when I next updated on 2015/5/4
the problem started.  Would it be helpful to bisect?  Based on
"git log nnimap.el", there aren't many relevant changes, and the
ones most likely responsible are (from newer to older):

commit 10c00cefb79ea94c49a659b1f063218152e9b379
commit 04550947fe524054fdc5626ff7b342baca0c18d9
commit 1b4d1bd1ca7a32d8f9cb7c1ffe02af08f2c4b2c6
commit 062698a34df9fd679229f7dea14cfaaf408f87de
commit c2b17919646859aef0e1d329e052dadbbf042eca
commit 447c56af7cb2afac14a0f3ed23f85d907c443a5d

447c5 looks especially relevant, but seems to have been buggy since
later ones made fixes.

Could nnmairix be adjusted to make an extra call at some point to
activate the appropriate group?  Maybe it needs to call
nnimap-request-group-scan instead of nnimap-request-group, now that
447c5 changed the behaviour of the latter?

Anything else I can do to help get this working?

Dan

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  -(nil nil)
  (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)
  (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group))
  (progn (when (or (not dont-check) (not (setq active (nth 2 (assoc group nnimap-current-infos))))) (let ((sequences (nnimap-retrieve-group-data-early server info))) (nnimap-finish-retrieve-group-infos server info sequences t) (setq active (nth 2 (assoc group nnimap-current-infos))))) (erase-buffer) (message "%s" active) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t)
  (if result (progn (when (or (not dont-check) (not (setq active (nth 2 (assoc group nnimap-current-infos))))) (let ((sequences (nnimap-retrieve-group-data-early server info))) (nnimap-finish-retrieve-group-infos server info sequences t) (setq active (nth 2 (assoc group nnimap-current-infos))))) (erase-buffer) (message "%s" active) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t))
  (when result (when (or (not dont-check) (not (setq active (nth 2 (assoc group nnimap-current-infos))))) (let ((sequences (nnimap-retrieve-group-data-early server info))) (nnimap-finish-retrieve-group-infos server info sequences t) (setq active (nth 2 (assoc group nnimap-current-infos))))) (erase-buffer) (message "%s" active) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t)
  (save-current-buffer (set-buffer nntp-server-buffer) (when result (when (or (not dont-check) (not (setq active (nth 2 (assoc group nnimap-current-infos))))) (let ((sequences (nnimap-retrieve-group-data-early server info))) (nnimap-finish-retrieve-group-infos server info sequences t) (setq active (nth 2 (assoc group nnimap-current-infos))))) (erase-buffer) (message "%s" active) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t))
  (with-current-buffer nntp-server-buffer (when result (when (or (not dont-check) (not (setq active (nth 2 (assoc group nnimap-current-infos))))) (let ((sequences (nnimap-retrieve-group-data-early server info))) (nnimap-finish-retrieve-group-infos server info sequences t) (setq active (nth 2 (assoc group nnimap-current-infos))))) (erase-buffer) (message "%s" active) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t))
  (let ((result (nnimap-change-group (if (and (not dont-check) (assoc group nnimap-current-infos)) nil group) server)) (info (when info (list info))) active) (with-current-buffer nntp-server-buffer (when result (when (or (not dont-check) (not (setq active (nth 2 ...)))) (let ((sequences (nnimap-retrieve-group-data-early server info))) (nnimap-finish-retrieve-group-infos server info sequences t) (setq active (nth 2 (assoc group nnimap-current-infos))))) (erase-buffer) (message "%s" active) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t)))
  nnimap-request-group("zz_mairix-nnmairixsearch-1" "rocky")
  apply(nnimap-request-group ("zz_mairix-nnmairixsearch-1" "rocky"))
  nnmairix-call-backend("request-group" "zz_mairix-nnmairixsearch-1" "rocky")
  nnmairix-request-group-with-article-number-correction("zz_mairix-nnmairixsearch-1" "nnmairix+mairixserver:nnmairixsearch")
  nnmairix-request-group("nnmairixsearch" "mairixserver" t ("nnmairix+mairixserver:nnmairixsearch" 2 nil nil (nnmairix "mairixserver" (nnmairix-backend nnimap) (nnmairix-backend-server "rocky") (nnmairix-mairix-command "mairix") (nnmairix-hidden-folders t) (nnmairix-default-group "nnmairixsearch")) ((query "test" "d:1w-") (numcorr nil 47850 47888) (display) (folder . "zz_mairix-nnmairixsearch-1") (threads))))
  gnus-request-group("nnmairix+mairixserver:nnmairixsearch" t nil ("nnmairix+mairixserver:nnmairixsearch" 2 nil nil (nnmairix "mairixserver" (nnmairix-backend nnimap) (nnmairix-backend-server "rocky") (nnmairix-mairix-command "mairix") (nnmairix-hidden-folders t) (nnmairix-default-group "nnmairixsearch")) ((query "test" "d:1w-") (numcorr nil 47850 47888) (display) (folder . "zz_mairix-nnmairixsearch-1") (threads))))
  gnus-select-newsgroup("nnmairix+mairixserver:nnmairixsearch" nil nil)
  gnus-summary-read-group-1("nnmairix+mairixserver:nnmairixsearch" nil nil nil nil nil)
  gnus-summary-read-group("nnmairix+mairixserver:nnmairixsearch" nil nil nil nil nil nil)
  gnus-group-read-group(nil nil nil)
  gnus-topic-read-group(nil)
  call-interactively(gnus-topic-read-group nil nil)




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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-09  2:52             ` Dan Christensen
@ 2015-07-09 13:47               ` Dan Christensen
  2015-07-10  2:41                 ` Eric Abrahamsen
  2015-07-12  4:11               ` Eric Abrahamsen
  1 sibling, 1 reply; 25+ messages in thread
From: Dan Christensen @ 2015-07-09 13:47 UTC (permalink / raw)
  To: ding

I forgot that I was running a wrapper around nnmairix-search that hid an
error it commonly produced.  This might explain the strange behaviour
we've been seeing.  In the past, things worked fine if I ignored this
error and just tried again to enter the group, but with the changes
to nnimap.el in the past six months, that is no longer the case.

Dan

Debugger entered--Lisp error: (error "Group nnmairix+mairixserver:nnmairixsearch couldn't be activated ")
  signal(error ("Group nnmairix+mairixserver:nnmairixsearch couldn't be activated "))
  error("Group %s couldn't be activated " "nnmairix+mairixserver:nnmairixsearch")
  gnus-list-of-unread-articles("nnmairix+mairixserver:nnmairixsearch")
  gnus-select-newsgroup("nnmairix+mairixserver:nnmairixsearch" t nil)
  gnus-summary-read-group-1("nnmairix+mairixserver:nnmairixsearch" t t nil nil nil)
  gnus-summary-read-group("nnmairix+mairixserver:nnmairixsearch" t t nil nil nil nil)
  gnus-group-read-group(nil t "nnmairix+mairixserver:nnmairixsearch")
  nnmairix-search("test d:1w-")
  call-interactively(nnmairix-search record nil)
  command-execute(nnmairix-search record)
  execute-extended-command(nil "nnmairix-search")
  call-interactively(execute-extended-command nil nil)




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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-09 13:47               ` Dan Christensen
@ 2015-07-10  2:41                 ` Eric Abrahamsen
  2015-07-10 12:42                   ` Dan Christensen
  0 siblings, 1 reply; 25+ messages in thread
From: Eric Abrahamsen @ 2015-07-10  2:41 UTC (permalink / raw)
  To: ding

Dan Christensen <jdc@uwo.ca> writes:

> I forgot that I was running a wrapper around nnmairix-search that hid an
> error it commonly produced.  This might explain the strange behaviour
> we've been seeing.  In the past, things worked fine if I ignored this
> error and just tried again to enter the group, but with the changes
> to nnimap.el in the past six months, that is no longer the case.
>
> Dan
>
> Debugger entered--Lisp error: (error "Group nnmairix+mairixserver:nnmairixsearch couldn't be activated ")
>   signal(error ("Group nnmairix+mairixserver:nnmairixsearch couldn't be activated "))
>   error("Group %s couldn't be activated " "nnmairix+mairixserver:nnmairixsearch")
>   gnus-list-of-unread-articles("nnmairix+mairixserver:nnmairixsearch")
>   gnus-select-newsgroup("nnmairix+mairixserver:nnmairixsearch" t nil)
>   gnus-summary-read-group-1("nnmairix+mairixserver:nnmairixsearch" t t nil nil nil)
>   gnus-summary-read-group("nnmairix+mairixserver:nnmairixsearch" t t nil nil nil nil)
>   gnus-group-read-group(nil t "nnmairix+mairixserver:nnmairixsearch")
>   nnmairix-search("test d:1w-")
>   call-interactively(nnmairix-search record nil)
>   command-execute(nnmairix-search record)
>   execute-extended-command(nil "nnmairix-search")
>   call-interactively(execute-extended-command nil nil)

Yeah, I think in the end nnmairix will probably have to be adjusted --
it's fallen behind in several regards, and my guess is it's just not
quite doing the right thing anymore.

Just so I'm perfectly clear: the above error is what you get without
running *any* of the patches I or Bjørn have sent, and with your wrapper
removed? Just plain vanilla Gnus?

Eric




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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-10  2:41                 ` Eric Abrahamsen
@ 2015-07-10 12:42                   ` Dan Christensen
  0 siblings, 0 replies; 25+ messages in thread
From: Dan Christensen @ 2015-07-10 12:42 UTC (permalink / raw)
  To: ding

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Dan Christensen <jdc@uwo.ca> writes:
>
>> I forgot that I was running a wrapper around nnmairix-search that hid an
>> error it commonly produced.  This might explain the strange behaviour
>> we've been seeing.  In the past, things worked fine if I ignored this
>> error and just tried again to enter the group, but with the changes
>> to nnimap.el in the past six months, that is no longer the case.

> Yeah, I think in the end nnmairix will probably have to be adjusted --
> it's fallen behind in several regards, and my guess is it's just not
> quite doing the right thing anymore.
>
> Just so I'm perfectly clear: the above error is what you get without
> running *any* of the patches I or Bjørn have sent, and with your wrapper
> removed? Just plain vanilla Gnus?

The backtrace in the previous message was with your most recent patches
and with the line added that sets active to (0 0) if needed, but without
any wrapper.

With plain vanilla git head, and no wrapper, the backtrace is different
(see below).

It's possible that the difference might be due to restarting Gnus in
between (affecting some internal state) rather than from the patches

Dan

With patches:

Debugger entered--Lisp error: (error "Group nnmairix+mairixserver:nnmairixsearch couldn't be activated ")
  signal(error ("Group nnmairix+mairixserver:nnmairixsearch couldn't be activated "))
  error("Group %s couldn't be activated " "nnmairix+mairixserver:nnmairixsearch")
  gnus-list-of-unread-articles("nnmairix+mairixserver:nnmairixsearch")
  gnus-select-newsgroup("nnmairix+mairixserver:nnmairixsearch" t nil)
  gnus-summary-read-group-1("nnmairix+mairixserver:nnmairixsearch" t t nil nil nil)
  gnus-summary-read-group("nnmairix+mairixserver:nnmairixsearch" t t nil nil nil nil)
  gnus-group-read-group(nil t "nnmairix+mairixserver:nnmairixsearch")
  nnmairix-search("test d:1w-")
  call-interactively(nnmairix-search record nil)
  command-execute(nnmairix-search record)
  execute-extended-command(nil "nnmairix-search")
  call-interactively(execute-extended-command nil nil)

Without patches:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("^[^:]+:" nil)
  (if (string-match "^[^:]+:" gname) (substring gname (match-end 0)) gname)
  (let ((gname (nth 0 info))) (if (string-match "^[^:]+:" gname) (substring gname (match-end 0)) gname))
  (nnimap-decode-gnus-group (let ((gname (nth 0 info))) (if (string-match "^[^:]+:" gname) (substring gname (match-end 0)) gname)))
  (setq params (nth 5 info) group (nnimap-decode-gnus-group (let ((gname (nth 0 info))) (if (string-match "^[^:]+:" gname) (substring gname (match-end 0)) gname))) active (cdr (assq (quote active) params)) unexist (assq (quote unexist) (nth 3 info)) uidvalidity (cdr (assq (quote uidvalidity) params)) modseq (cdr (assq (quote modseq) params)))
  (while --dolist-tail-- (setq info (car --dolist-tail--)) (setq params (nth 5 info) group (nnimap-decode-gnus-group (let ((gname (nth 0 info))) (if (string-match "^[^:]+:" gname) (substring gname (match-end 0)) gname))) active (cdr (assq (quote active) params)) unexist (assq (quote unexist) (nth 3 info)) uidvalidity (cdr (assq (quote uidvalidity) params)) modseq (cdr (assq (quote modseq) params))) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-examined) (quote nnimap))) (let* ((v nnimap-object)) (aset v 10 group))) (if (and qresyncp uidvalidity active modseq unexist) (setq sequences (cons (list (nnimap-send-command "EXAMINE %S (%s (%s %s))" (utf7-encode group t) (nnimap-quirk "QRESYNC") uidvalidity modseq) (quote qresync) nil group (quote qresync)) sequences)) (let ((command (if uidvalidity "EXAMINE" "SELECT")) start) (if (and active uidvalidity unexist) (setq start (max 1 (- (cdr active) 100))) (progn (or (and (vectorp nnimap-object) (>= ... 13) (memq ... cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-initial-resync) (quote nnimap))) (let* ((v nnimap-object)) (aset v 12 (+ ... 1)))) (setq start 1)) (setq sequences (cons (list (nnimap-send-command "%s %S" command (utf7-encode group t)) (nnimap-send-command "UID FETCH %d:* FLAGS" start) start group command) sequences)))) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (let ((--dolist-tail-- infos) info) (while --dolist-tail-- (setq info (car --dolist-tail--)) (setq params (nth 5 info) group (nnimap-decode-gnus-group (let ((gname (nth 0 info))) (if (string-match "^[^:]+:" gname) (substring gname (match-end 0)) gname))) active (cdr (assq (quote active) params)) unexist (assq (quote unexist) (nth 3 info)) uidvalidity (cdr (assq (quote uidvalidity) params)) modseq (cdr (assq (quote modseq) params))) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-examined) (quote nnimap))) (let* ((v nnimap-object)) (aset v 10 group))) (if (and qresyncp uidvalidity active modseq unexist) (setq sequences (cons (list (nnimap-send-command "EXAMINE %S (%s (%s %s))" (utf7-encode group t) (nnimap-quirk "QRESYNC") uidvalidity modseq) (quote qresync) nil group (quote qresync)) sequences)) (let ((command (if uidvalidity "EXAMINE" "SELECT")) start) (if (and active uidvalidity unexist) (setq start (max 1 (- ... 100))) (progn (or (and ... ... ...) (error "%s accessing a non-%s" ... ...)) (let* (...) (aset v 12 ...))) (setq start 1)) (setq sequences (cons (list (nnimap-send-command "%s %S" command ...) (nnimap-send-command "UID FETCH %d:* FLAGS" start) start group command) sequences)))) (setq --dolist-tail-- (cdr --dolist-tail--))))
  (progn (let ((--dolist-tail-- infos) info) (while --dolist-tail-- (setq info (car --dolist-tail--)) (setq params (nth 5 info) group (nnimap-decode-gnus-group (let ((gname ...)) (if (string-match "^[^:]+:" gname) (substring gname ...) gname))) active (cdr (assq (quote active) params)) unexist (assq (quote unexist) (nth 3 info)) uidvalidity (cdr (assq (quote uidvalidity) params)) modseq (cdr (assq (quote modseq) params))) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-examined) (quote nnimap))) (let* ((v nnimap-object)) (aset v 10 group))) (if (and qresyncp uidvalidity active modseq unexist) (setq sequences (cons (list (nnimap-send-command "EXAMINE %S (%s (%s %s))" ... ... uidvalidity modseq) (quote qresync) nil group (quote qresync)) sequences)) (let ((command (if uidvalidity "EXAMINE" "SELECT")) start) (if (and active uidvalidity unexist) (setq start (max 1 ...)) (progn (or ... ...) (let* ... ...)) (setq start 1)) (setq sequences (cons (list ... ... start group command) sequences)))) (setq --dolist-tail-- (cdr --dolist-tail--)))))
  (let ((qresyncp (nnimap-capability "QRESYNC")) params groups sequences active uidvalidity modseq group unexist) (progn (let ((--dolist-tail-- infos) info) (while --dolist-tail-- (setq info (car --dolist-tail--)) (setq params (nth 5 info) group (nnimap-decode-gnus-group (let (...) (if ... ... gname))) active (cdr (assq (quote active) params)) unexist (assq (quote unexist) (nth 3 info)) uidvalidity (cdr (assq (quote uidvalidity) params)) modseq (cdr (assq (quote modseq) params))) (progn (or (and (vectorp nnimap-object) (>= ... 13) (memq ... cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-examined) (quote nnimap))) (let* ((v nnimap-object)) (aset v 10 group))) (if (and qresyncp uidvalidity active modseq unexist) (setq sequences (cons (list ... ... nil group ...) sequences)) (let ((command ...) start) (if (and active uidvalidity unexist) (setq start ...) (progn ... ...) (setq start 1)) (setq sequences (cons ... sequences)))) (setq --dolist-tail-- (cdr --dolist-tail--))))) sequences)
  (save-current-buffer (set-buffer (nnimap-buffer)) (erase-buffer) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-group) (quote nnimap))) (let* ((v nnimap-object)) (aset v 1 nil))) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-initial-resync) (quote nnimap))) (let* ((v nnimap-object)) (aset v 12 0))) (let ((qresyncp (nnimap-capability "QRESYNC")) params groups sequences active uidvalidity modseq group unexist) (progn (let ((--dolist-tail-- infos) info) (while --dolist-tail-- (setq info (car --dolist-tail--)) (setq params (nth 5 info) group (nnimap-decode-gnus-group (let ... ...)) active (cdr (assq ... params)) unexist (assq (quote unexist) (nth 3 info)) uidvalidity (cdr (assq ... params)) modseq (cdr (assq ... params))) (progn (or (and ... ... ...) (error "%s accessing a non-%s" ... ...)) (let* (...) (aset v 10 group))) (if (and qresyncp uidvalidity active modseq unexist) (setq sequences (cons ... sequences)) (let (... start) (if ... ... ... ...) (setq sequences ...))) (setq --dolist-tail-- (cdr --dolist-tail--))))) sequences))
  (progn (save-current-buffer (set-buffer (nnimap-buffer)) (erase-buffer) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-group) (quote nnimap))) (let* ((v nnimap-object)) (aset v 1 nil))) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-initial-resync) (quote nnimap))) (let* ((v nnimap-object)) (aset v 12 0))) (let ((qresyncp (nnimap-capability "QRESYNC")) params groups sequences active uidvalidity modseq group unexist) (progn (let ((--dolist-tail-- infos) info) (while --dolist-tail-- (setq info (car --dolist-tail--)) (setq params (nth 5 info) group (nnimap-decode-gnus-group ...) active (cdr ...) unexist (assq ... ...) uidvalidity (cdr ...) modseq (cdr ...)) (progn (or ... ...) (let* ... ...)) (if (and qresyncp uidvalidity active modseq unexist) (setq sequences ...) (let ... ... ...)) (setq --dolist-tail-- (cdr --dolist-tail--))))) sequences)))
  (if (and (nnimap-change-group nil server) infos) (progn (save-current-buffer (set-buffer (nnimap-buffer)) (erase-buffer) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-group) (quote nnimap))) (let* ((v nnimap-object)) (aset v 1 nil))) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-initial-resync) (quote nnimap))) (let* ((v nnimap-object)) (aset v 12 0))) (let ((qresyncp (nnimap-capability "QRESYNC")) params groups sequences active uidvalidity modseq group unexist) (progn (let ((--dolist-tail-- infos) info) (while --dolist-tail-- (setq info ...) (setq params ... group ... active ... unexist ... uidvalidity ... modseq ...) (progn ... ...) (if ... ... ...) (setq --dolist-tail-- ...)))) sequences))))
  nnimap-retrieve-group-data-early("rocky" (nil))
  (let ((sequences (nnimap-retrieve-group-data-early server (list info)))) (nnimap-finish-retrieve-group-infos server (list info) sequences t) (setq active (nth 2 (assoc group nnimap-current-infos))))
  (progn (let ((sequences (nnimap-retrieve-group-data-early server (list info)))) (nnimap-finish-retrieve-group-infos server (list info) sequences t) (setq active (nth 2 (assoc group nnimap-current-infos)))))
  (if (or (not dont-check) (not (setq active (nth 2 (assoc group nnimap-current-infos))))) (progn (let ((sequences (nnimap-retrieve-group-data-early server (list info)))) (nnimap-finish-retrieve-group-infos server (list info) sequences t) (setq active (nth 2 (assoc group nnimap-current-infos))))))
  (progn (if (or (not dont-check) (not (setq active (nth 2 (assoc group nnimap-current-infos))))) (progn (let ((sequences (nnimap-retrieve-group-data-early server (list info)))) (nnimap-finish-retrieve-group-infos server (list info) sequences t) (setq active (nth 2 (assoc group nnimap-current-infos)))))) (erase-buffer) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t)
  (if result (progn (if (or (not dont-check) (not (setq active (nth 2 (assoc group nnimap-current-infos))))) (progn (let ((sequences (nnimap-retrieve-group-data-early server ...))) (nnimap-finish-retrieve-group-infos server (list info) sequences t) (setq active (nth 2 (assoc group nnimap-current-infos)))))) (erase-buffer) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t))
  (save-current-buffer (set-buffer nntp-server-buffer) (if result (progn (if (or (not dont-check) (not (setq active (nth 2 ...)))) (progn (let ((sequences ...)) (nnimap-finish-retrieve-group-infos server (list info) sequences t) (setq active (nth 2 ...))))) (erase-buffer) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t)))
  (let ((result (nnimap-change-group (if (and (not dont-check) (assoc group nnimap-current-infos)) nil group) server)) active) (save-current-buffer (set-buffer nntp-server-buffer) (if result (progn (if (or (not dont-check) (not (setq active ...))) (progn (let (...) (nnimap-finish-retrieve-group-infos server ... sequences t) (setq active ...)))) (erase-buffer) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t))))
  nnimap-request-group("zz_mairix-nnmairixsearch-1" "rocky")
  apply(nnimap-request-group ("zz_mairix-nnmairixsearch-1" "rocky"))
  nnmairix-call-backend("request-group" "zz_mairix-nnmairixsearch-1" "rocky")
  nnmairix-request-group-with-article-number-correction("zz_mairix-nnmairixsearch-1" "nnmairix+mairixserver:nnmairixsearch")
  nnmairix-request-group("nnmairixsearch" "mairixserver" nil ("nnmairix+mairixserver:nnmairixsearch" 2 nil nil (nnmairix "mairixserver" (nnmairix-backend nnimap) (nnmairix-backend-server "rocky") (nnmairix-mairix-command "mairix") (nnmairix-hidden-folders t) (nnmairix-default-group "nnmairixsearch")) ((numcorr t 47906 47995) (query "test" "d:1w-") (display) (folder . "zz_mairix-nnmairixsearch-1") (threads))))
  gnus-activate-group("nnmairix+mairixserver:nnmairixsearch" scan nil (nnmairix "mairixserver" (nnmairix-backend nnimap) (nnmairix-backend-server "rocky") (nnmairix-mairix-command "mairix") (nnmairix-hidden-folders t) (nnmairix-default-group "nnmairixsearch")))
  gnus-group-get-new-news-this-group()
  nnmairix-update-and-clear-marks("nnmairix+mairixserver:nnmairixsearch")
  nnmairix-search("test d:1w-")
  call-interactively(nnmairix-search record nil)
  command-execute(nnmairix-search record)
  execute-extended-command(nil "nnmairix-search")
  call-interactively(execute-extended-command nil nil)




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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-09  2:52             ` Dan Christensen
  2015-07-09 13:47               ` Dan Christensen
@ 2015-07-12  4:11               ` Eric Abrahamsen
  2015-07-12  4:27                 ` Eric Abrahamsen
  1 sibling, 1 reply; 25+ messages in thread
From: Eric Abrahamsen @ 2015-07-12  4:11 UTC (permalink / raw)
  To: ding

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

Dan Christensen <jdc@uwo.ca> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> I pushed a small change to `nnimap-request-group' yesterday that would
>> have prevented the first patch from applying cleanly -- sorry, I should
>> have mentioned you'd need to pull again first.
>
> No problem!
>
>> I thought my changes to the group creation process would have ensured
>> that all new groups had an "active" entry, but I guess not.
>>
>> I'd like to take one more whack at this, and then I'm going to give up
>> and just put Bjørn's guard in. Would you mind removing Bjørn's patches,
>> pulling once more, and trying these two?
>
> I just tried your latest patches against the latest git version.  As
> before, the problem with info being nil is handled, but active is still
> nil and I get the backtrace below.  If I add Bjørn's line
>
> +	(or active (setq active (cons 0 0)))
>
> then the error goes away, but Gnus thinks that the group is empty
> (not surprisingly), so this isn't really a solution.
>
> I only update Gnus periodically.  I had no trouble with nnmairix 
> with the 2014/10/10 version, but when I next updated on 2015/5/4
> the problem started.  Would it be helpful to bisect?  Based on
> "git log nnimap.el", there aren't many relevant changes, and the
> ones most likely responsible are (from newer to older):
>
> commit 10c00cefb79ea94c49a659b1f063218152e9b379
> commit 04550947fe524054fdc5626ff7b342baca0c18d9
> commit 1b4d1bd1ca7a32d8f9cb7c1ffe02af08f2c4b2c6
> commit 062698a34df9fd679229f7dea14cfaaf408f87de
> commit c2b17919646859aef0e1d329e052dadbbf042eca
> commit 447c56af7cb2afac14a0f3ed23f85d907c443a5d
>
> 447c5 looks especially relevant, but seems to have been buggy since
> later ones made fixes.
>
> Could nnmairix be adjusted to make an extra call at some point to
> activate the appropriate group?  Maybe it needs to call
> nnimap-request-group-scan instead of nnimap-request-group, now that
> 447c5 changed the behaviour of the latter?

I think this is probably the right solution. I'm still convinced that
nnimap should do something in the group creation process to register the
group with Gnus, but you're right that your problem is likely a direct
result of "request-group" getting split into "request-group" and
"request-group-scan", and nnmairix not being edited to follow.

I'm a little bit out of my depth here, but give this patch a whirl and
see how it goes.

I'm trying to set up mairix so I can test this myself, but am having
difficulty just making it do the basics...

Eric


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nnmairix-create-group.patch --]
[-- Type: text/x-diff, Size: 634 bytes --]

diff --git a/lisp/nnmairix.el b/lisp/nnmairix.el
index 96b40e5..693d3ee 100644
--- a/lisp/nnmairix.el
+++ b/lisp/nnmairix.el
@@ -534,6 +534,9 @@ Other back ends might or might not work.")
 		   "request-group" groupname nnmairix-backend-server)))
     (nnmairix-call-backend
      "request-create-group" groupname nnmairix-backend-server)
+    (when (eq nnmairix-backend 'nnimap)
+      (nnmairix-call-backend
+       "request-group-scan" groupname nnmairix-backend-server))
     (gnus-group-add-parameter qualgroup '(folder . nil))
     (when nnmairix-allowfast-default
       (gnus-group-add-parameter qualgroup '(allow-fast . t)))

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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-12  4:11               ` Eric Abrahamsen
@ 2015-07-12  4:27                 ` Eric Abrahamsen
  2015-07-12 17:01                   ` Dan Christensen
  0 siblings, 1 reply; 25+ messages in thread
From: Eric Abrahamsen @ 2015-07-12  4:27 UTC (permalink / raw)
  To: ding

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

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Dan Christensen <jdc@uwo.ca> writes:
>
>> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>>
>>> I pushed a small change to `nnimap-request-group' yesterday that would
>>> have prevented the first patch from applying cleanly -- sorry, I should
>>> have mentioned you'd need to pull again first.
>>
>> No problem!
>>
>>> I thought my changes to the group creation process would have ensured
>>> that all new groups had an "active" entry, but I guess not.
>>>
>>> I'd like to take one more whack at this, and then I'm going to give up
>>> and just put Bjørn's guard in. Would you mind removing Bjørn's patches,
>>> pulling once more, and trying these two?
>>
>> I just tried your latest patches against the latest git version.  As
>> before, the problem with info being nil is handled, but active is still
>> nil and I get the backtrace below.  If I add Bjørn's line
>>
>> +	(or active (setq active (cons 0 0)))
>>
>> then the error goes away, but Gnus thinks that the group is empty
>> (not surprisingly), so this isn't really a solution.
>>
>> I only update Gnus periodically.  I had no trouble with nnmairix 
>> with the 2014/10/10 version, but when I next updated on 2015/5/4
>> the problem started.  Would it be helpful to bisect?  Based on
>> "git log nnimap.el", there aren't many relevant changes, and the
>> ones most likely responsible are (from newer to older):
>>
>> commit 10c00cefb79ea94c49a659b1f063218152e9b379
>> commit 04550947fe524054fdc5626ff7b342baca0c18d9
>> commit 1b4d1bd1ca7a32d8f9cb7c1ffe02af08f2c4b2c6
>> commit 062698a34df9fd679229f7dea14cfaaf408f87de
>> commit c2b17919646859aef0e1d329e052dadbbf042eca
>> commit 447c56af7cb2afac14a0f3ed23f85d907c443a5d
>>
>> 447c5 looks especially relevant, but seems to have been buggy since
>> later ones made fixes.
>>
>> Could nnmairix be adjusted to make an extra call at some point to
>> activate the appropriate group?  Maybe it needs to call
>> nnimap-request-group-scan instead of nnimap-request-group, now that
>> 447c5 changed the behaviour of the latter?
>
> I think this is probably the right solution. I'm still convinced that
> nnimap should do something in the group creation process to register the
> group with Gnus, but you're right that your problem is likely a direct
> result of "request-group" getting split into "request-group" and
> "request-group-scan", and nnmairix not being edited to follow.
>
> I'm a little bit out of my depth here, but give this patch a whirl and
> see how it goes.

Dammit, I think that was wrong. Would you try it anyway, then unapply it
and try this one instead?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: nnmairix-scan-imap-groups.patch --]
[-- Type: text/x-diff, Size: 540 bytes --]

diff --git a/lisp/nnmairix.el b/lisp/nnmairix.el
index 96b40e5..c9446b0 100644
--- a/lisp/nnmairix.el
+++ b/lisp/nnmairix.el
@@ -495,6 +495,9 @@ Other back ends might or might not work.")
 	  (nnml-generate-nov-databases-directory mfolder nil t))
 	(nnmairix-call-backend
 	 "request-scan" folder nnmairix-backend-server)
+	(when (eq nnmairix-backend 'nnimap)
+	  (nnmairix-call-backend
+	   "request-group-scan" folder nnmairix-backend-server))
 	(if (and fast allowfast)
 	    t
 	  (nnmairix-request-group-with-article-number-correction

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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-12  4:27                 ` Eric Abrahamsen
@ 2015-07-12 17:01                   ` Dan Christensen
  2015-07-13  5:36                     ` Eric Abrahamsen
  0 siblings, 1 reply; 25+ messages in thread
From: Dan Christensen @ 2015-07-12 17:01 UTC (permalink / raw)
  To: ding

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Dan Christensen <jdc@uwo.ca> writes:
>>
>>> Could nnmairix be adjusted to make an extra call at some point to
>>> activate the appropriate group?  Maybe it needs to call
>>> nnimap-request-group-scan instead of nnimap-request-group, now that
>>> 447c5 changed the behaviour of the latter?
>>
>> I think this is probably the right solution. I'm still convinced that
>> nnimap should do something in the group creation process to register the
>> group with Gnus, but you're right that your problem is likely a direct
>> result of "request-group" getting split into "request-group" and
>> "request-group-scan", and nnmairix not being edited to follow.
>>
>> I'm a little bit out of my depth here, but give this patch a whirl and
>> see how it goes.
>
> Dammit, I think that was wrong. Would you try it anyway, then unapply it
> and try this one instead?

I tried the first, the second, and both, and didn't notice any change.
(I still had your nnimap.el patches applied as well.)

Here is the backtrace with the patch nnmairix-scan-imap-groups.patch
applied.

Dan

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("^[^:]+:" nil)
  (if (string-match "^[^:]+:" gname) (substring gname (match-end 0)) gname)
  (let ((gname (nth 0 info))) (if (string-match "^[^:]+:" gname) (substring gname (match-end 0)) gname))
  (nnimap-decode-gnus-group (let ((gname (nth 0 info))) (if (string-match "^[^:]+:" gname) (substring gname (match-end 0)) gname)))
  (setq params (nth 5 info) group (nnimap-decode-gnus-group (let ((gname (nth 0 info))) (if (string-match "^[^:]+:" gname) (substring gname (match-end 0)) gname))) active (cdr (assq (quote active) params)) unexist (assq (quote unexist) (nth 3 info)) uidvalidity (cdr (assq (quote uidvalidity) params)) modseq (cdr (assq (quote modseq) params)))
  (while --dolist-tail-- (setq info (car --dolist-tail--)) (setq params (nth 5 info) group (nnimap-decode-gnus-group (let ((gname (nth 0 info))) (if (string-match "^[^:]+:" gname) (substring gname (match-end 0)) gname))) active (cdr (assq (quote active) params)) unexist (assq (quote unexist) (nth 3 info)) uidvalidity (cdr (assq (quote uidvalidity) params)) modseq (cdr (assq (quote modseq) params))) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-examined) (quote nnimap))) (let* ((v nnimap-object)) (aset v 10 group))) (if (and qresyncp uidvalidity active modseq unexist) (setq sequences (cons (list (nnimap-send-command "EXAMINE %S (%s (%s %s))" (utf7-encode group t) (nnimap-quirk "QRESYNC") uidvalidity modseq) (quote qresync) nil group (quote qresync)) sequences)) (let ((command (if uidvalidity "EXAMINE" "SELECT")) start) (if (and active uidvalidity unexist) (setq start (max 1 (- (cdr active) 100))) (progn (or (and (vectorp nnimap-object) (>= ... 13) (memq ... cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-initial-resync) (quote nnimap))) (let* ((v nnimap-object)) (aset v 12 (+ ... 1)))) (setq start 1)) (setq sequences (cons (list (nnimap-send-command "%s %S" command (utf7-encode group t)) (nnimap-send-command "UID FETCH %d:* FLAGS" start) start group command) sequences)))) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (let ((--dolist-tail-- infos) info) (while --dolist-tail-- (setq info (car --dolist-tail--)) (setq params (nth 5 info) group (nnimap-decode-gnus-group (let ((gname (nth 0 info))) (if (string-match "^[^:]+:" gname) (substring gname (match-end 0)) gname))) active (cdr (assq (quote active) params)) unexist (assq (quote unexist) (nth 3 info)) uidvalidity (cdr (assq (quote uidvalidity) params)) modseq (cdr (assq (quote modseq) params))) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-examined) (quote nnimap))) (let* ((v nnimap-object)) (aset v 10 group))) (if (and qresyncp uidvalidity active modseq unexist) (setq sequences (cons (list (nnimap-send-command "EXAMINE %S (%s (%s %s))" (utf7-encode group t) (nnimap-quirk "QRESYNC") uidvalidity modseq) (quote qresync) nil group (quote qresync)) sequences)) (let ((command (if uidvalidity "EXAMINE" "SELECT")) start) (if (and active uidvalidity unexist) (setq start (max 1 (- ... 100))) (progn (or (and ... ... ...) (error "%s accessing a non-%s" ... ...)) (let* (...) (aset v 12 ...))) (setq start 1)) (setq sequences (cons (list (nnimap-send-command "%s %S" command ...) (nnimap-send-command "UID FETCH %d:* FLAGS" start) start group command) sequences)))) (setq --dolist-tail-- (cdr --dolist-tail--))))
  (progn (let ((--dolist-tail-- infos) info) (while --dolist-tail-- (setq info (car --dolist-tail--)) (setq params (nth 5 info) group (nnimap-decode-gnus-group (let ((gname ...)) (if (string-match "^[^:]+:" gname) (substring gname ...) gname))) active (cdr (assq (quote active) params)) unexist (assq (quote unexist) (nth 3 info)) uidvalidity (cdr (assq (quote uidvalidity) params)) modseq (cdr (assq (quote modseq) params))) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-examined) (quote nnimap))) (let* ((v nnimap-object)) (aset v 10 group))) (if (and qresyncp uidvalidity active modseq unexist) (setq sequences (cons (list (nnimap-send-command "EXAMINE %S (%s (%s %s))" ... ... uidvalidity modseq) (quote qresync) nil group (quote qresync)) sequences)) (let ((command (if uidvalidity "EXAMINE" "SELECT")) start) (if (and active uidvalidity unexist) (setq start (max 1 ...)) (progn (or ... ...) (let* ... ...)) (setq start 1)) (setq sequences (cons (list ... ... start group command) sequences)))) (setq --dolist-tail-- (cdr --dolist-tail--)))))
  (let ((qresyncp (nnimap-capability "QRESYNC")) params groups sequences active uidvalidity modseq group unexist) (progn (let ((--dolist-tail-- infos) info) (while --dolist-tail-- (setq info (car --dolist-tail--)) (setq params (nth 5 info) group (nnimap-decode-gnus-group (let (...) (if ... ... gname))) active (cdr (assq (quote active) params)) unexist (assq (quote unexist) (nth 3 info)) uidvalidity (cdr (assq (quote uidvalidity) params)) modseq (cdr (assq (quote modseq) params))) (progn (or (and (vectorp nnimap-object) (>= ... 13) (memq ... cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-examined) (quote nnimap))) (let* ((v nnimap-object)) (aset v 10 group))) (if (and qresyncp uidvalidity active modseq unexist) (setq sequences (cons (list ... ... nil group ...) sequences)) (let ((command ...) start) (if (and active uidvalidity unexist) (setq start ...) (progn ... ...) (setq start 1)) (setq sequences (cons ... sequences)))) (setq --dolist-tail-- (cdr --dolist-tail--))))) sequences)
  (save-current-buffer (set-buffer (nnimap-buffer)) (erase-buffer) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-group) (quote nnimap))) (let* ((v nnimap-object)) (aset v 1 nil))) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-initial-resync) (quote nnimap))) (let* ((v nnimap-object)) (aset v 12 0))) (let ((qresyncp (nnimap-capability "QRESYNC")) params groups sequences active uidvalidity modseq group unexist) (progn (let ((--dolist-tail-- infos) info) (while --dolist-tail-- (setq info (car --dolist-tail--)) (setq params (nth 5 info) group (nnimap-decode-gnus-group (let ... ...)) active (cdr (assq ... params)) unexist (assq (quote unexist) (nth 3 info)) uidvalidity (cdr (assq ... params)) modseq (cdr (assq ... params))) (progn (or (and ... ... ...) (error "%s accessing a non-%s" ... ...)) (let* (...) (aset v 10 group))) (if (and qresyncp uidvalidity active modseq unexist) (setq sequences (cons ... sequences)) (let (... start) (if ... ... ... ...) (setq sequences ...))) (setq --dolist-tail-- (cdr --dolist-tail--))))) sequences))
  (progn (save-current-buffer (set-buffer (nnimap-buffer)) (erase-buffer) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-group) (quote nnimap))) (let* ((v nnimap-object)) (aset v 1 nil))) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-initial-resync) (quote nnimap))) (let* ((v nnimap-object)) (aset v 12 0))) (let ((qresyncp (nnimap-capability "QRESYNC")) params groups sequences active uidvalidity modseq group unexist) (progn (let ((--dolist-tail-- infos) info) (while --dolist-tail-- (setq info (car --dolist-tail--)) (setq params (nth 5 info) group (nnimap-decode-gnus-group ...) active (cdr ...) unexist (assq ... ...) uidvalidity (cdr ...) modseq (cdr ...)) (progn (or ... ...) (let* ... ...)) (if (and qresyncp uidvalidity active modseq unexist) (setq sequences ...) (let ... ... ...)) (setq --dolist-tail-- (cdr --dolist-tail--))))) sequences)))
  (if (and (nnimap-change-group nil server) infos) (progn (save-current-buffer (set-buffer (nnimap-buffer)) (erase-buffer) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-group) (quote nnimap))) (let* ((v nnimap-object)) (aset v 1 nil))) (progn (or (and (vectorp nnimap-object) (>= (length nnimap-object) 13) (memq (aref nnimap-object 0) cl-struct-nnimap-tags)) (error "%s accessing a non-%s" (quote nnimap-initial-resync) (quote nnimap))) (let* ((v nnimap-object)) (aset v 12 0))) (let ((qresyncp (nnimap-capability "QRESYNC")) params groups sequences active uidvalidity modseq group unexist) (progn (let ((--dolist-tail-- infos) info) (while --dolist-tail-- (setq info ...) (setq params ... group ... active ... unexist ... uidvalidity ... modseq ...) (progn ... ...) (if ... ... ...) (setq --dolist-tail-- ...)))) sequences))))
  nnimap-retrieve-group-data-early("rocky" (nil))
  (let ((sequences (nnimap-retrieve-group-data-early server (list info)))) (nnimap-finish-retrieve-group-infos server (list info) sequences t) (setq active (nth 2 (assoc group nnimap-current-infos))))
  (progn (let ((sequences (nnimap-retrieve-group-data-early server (list info)))) (nnimap-finish-retrieve-group-infos server (list info) sequences t) (setq active (nth 2 (assoc group nnimap-current-infos)))))
  (if (or (not dont-check) (not (setq active (nth 2 (assoc group nnimap-current-infos))))) (progn (let ((sequences (nnimap-retrieve-group-data-early server (list info)))) (nnimap-finish-retrieve-group-infos server (list info) sequences t) (setq active (nth 2 (assoc group nnimap-current-infos))))))
  (progn (if (or (not dont-check) (not (setq active (nth 2 (assoc group nnimap-current-infos))))) (progn (let ((sequences (nnimap-retrieve-group-data-early server (list info)))) (nnimap-finish-retrieve-group-infos server (list info) sequences t) (setq active (nth 2 (assoc group nnimap-current-infos)))))) (erase-buffer) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t)
  (if result (progn (if (or (not dont-check) (not (setq active (nth 2 (assoc group nnimap-current-infos))))) (progn (let ((sequences (nnimap-retrieve-group-data-early server ...))) (nnimap-finish-retrieve-group-infos server (list info) sequences t) (setq active (nth 2 (assoc group nnimap-current-infos)))))) (erase-buffer) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t))
  (save-current-buffer (set-buffer nntp-server-buffer) (if result (progn (if (or (not dont-check) (not (setq active (nth 2 ...)))) (progn (let ((sequences ...)) (nnimap-finish-retrieve-group-infos server (list info) sequences t) (setq active (nth 2 ...))))) (erase-buffer) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t)))
  (let ((result (nnimap-change-group (if (and (not dont-check) (assoc group nnimap-current-infos)) nil group) server)) active) (save-current-buffer (set-buffer nntp-server-buffer) (if result (progn (if (or (not dont-check) (not (setq active ...))) (progn (let (...) (nnimap-finish-retrieve-group-infos server ... sequences t) (setq active ...)))) (erase-buffer) (insert (format "211 %d %d %d %S\n" (- (cdr active) (car active)) (car active) (cdr active) group)) t))))
  nnimap-request-group("zz_mairix-nnmairixsearch-1" "rocky")
  apply(nnimap-request-group ("zz_mairix-nnmairixsearch-1" "rocky"))
  nnmairix-call-backend("request-group" "zz_mairix-nnmairixsearch-1" "rocky")
  (save-excursion (nnmairix-call-backend "request-group" folder nnmairix-backend-server) (set-buffer nnmairix-mairix-output-buffer) (goto-char (point-min)) (re-search-forward "^Matched.*messages") (nnheader-message 7 (match-string 0)) (set-buffer nntp-server-buffer) (goto-char (point-min)) (let ((status (read (current-buffer))) (total (read (current-buffer))) (low (read (current-buffer))) (high (read (current-buffer))) (corr (gnus-group-get-parameter qualgroup (quote numcorr) t))) (if (= status 211) (progn (if (and corr (> (+ ... high) 0)) (progn (if (car corr) (progn ... ...)) (setq low (+ low ...) high (+ high ...))) (if (member nnmairix-backend nnmairix-delete-and-create-on-change) (progn (gnus-group-set-parameter qualgroup ... ...)))) (erase-buffer) (insert (format "%d %d %d %d %s" status total low high (let (...) (if ... ... gname)))) t) (progn (nnheader-report (quote nnmairix) "Error calling back end on group %s" folder) nil))))
  nnmairix-request-group-with-article-number-correction("zz_mairix-nnmairixsearch-1" "nnmairix+mairixserver:nnmairixsearch")
  (if (and fast allowfast) t (nnmairix-request-group-with-article-number-correction folder qualgroup))
  (cond ((zerop rval) (nnmairix-call-backend "open-server" nnmairix-backend-server) (if (eq nnmairix-backend (quote nnml)) (progn (if nnmairix-rename-files-for-nnml (progn (nnmairix-rename-files-consecutively mfolder))) (nnml-generate-nov-databases-directory mfolder nil t))) (nnmairix-call-backend "request-scan" folder nnmairix-backend-server) (if (eq nnmairix-backend (quote nnimap)) (progn (nnmairix-call-backend "request-group-scan" folder nnmairix-backend-server))) (if (and fast allowfast) t (nnmairix-request-group-with-article-number-correction folder qualgroup))) ((and (= rval 1) (save-current-buffer (set-buffer nnmairix-mairix-output-buffer) (goto-char (point-min)) (looking-at "^Matched 0 messages"))) (nnheader-message 5 "Mairix: No matches found.") (set-buffer nntp-server-buffer) (erase-buffer) (insert (concat "211 0 1 0 " group)) t) (t (nnheader-report (quote nnmairix) "Error running mairix. See buffer %s for details" nnmairix-mairix-output-buffer) nil))
  (cond ((not folder) (nnheader-report (quote nnmairix) "Check folder parameter for group %s" group) nil) ((not query) (save-current-buffer (set-buffer nntp-server-buffer) (erase-buffer) (insert (concat "211 0 1 0 " group)) t)) (t (setq mfolder (if (and nnmairix-hidden-folders (not (string-match "^\\." folder))) (concat "." folder) folder)) (if (eq nnmairix-backend (quote nnml)) (progn (setq folderpath (cadr (assoc (quote nnml-directory) backendmethod))) (if (not folderpath) (progn (setq folderpath nnml-directory))))) (if (eq nnmairix-backend (quote nnmaildir)) (progn (setq folderpath (cadr (assoc (quote directory) backendmethod))))) (if folderpath (progn (setq mfolder (concat (file-name-as-directory (expand-file-name folderpath)) mfolder)))) (setq rval (if (and fast allowfast) 0 (nnmairix-call-mairix-binary (split-string nnmairix-mairix-command) mfolder query threads))) (cond ((zerop rval) (nnmairix-call-backend "open-server" nnmairix-backend-server) (if (eq nnmairix-backend (quote nnml)) (progn (if nnmairix-rename-files-for-nnml (progn ...)) (nnml-generate-nov-databases-directory mfolder nil t))) (nnmairix-call-backend "request-scan" folder nnmairix-backend-server) (if (eq nnmairix-backend (quote nnimap)) (progn (nnmairix-call-backend "request-group-scan" folder nnmairix-backend-server))) (if (and fast allowfast) t (nnmairix-request-group-with-article-number-correction folder qualgroup))) ((and (= rval 1) (save-current-buffer (set-buffer nnmairix-mairix-output-buffer) (goto-char (point-min)) (looking-at "^Matched 0 messages"))) (nnheader-message 5 "Mairix: No matches found.") (set-buffer nntp-server-buffer) (erase-buffer) (insert (concat "211 0 1 0 " group)) t) (t (nnheader-report (quote nnmairix) "Error running mairix. See buffer %s for details" nnmairix-mairix-output-buffer) nil))))
  (let* ((qualgroup (if server (gnus-group-prefixed-name group (list (quote nnmairix) server)) group)) (folder (gnus-group-get-parameter qualgroup (quote folder))) (allowfast (gnus-group-get-parameter qualgroup (quote allow-fast))) (query (gnus-group-get-parameter qualgroup (quote query) t)) (threads (gnus-group-get-parameter qualgroup (quote threads))) (backendmethod (gnus-server-to-method (format "%s:%s" (symbol-name nnmairix-backend) nnmairix-backend-server))) rval mfolder folderpath args) (cond ((not folder) (nnheader-report (quote nnmairix) "Check folder parameter for group %s" group) nil) ((not query) (save-current-buffer (set-buffer nntp-server-buffer) (erase-buffer) (insert (concat "211 0 1 0 " group)) t)) (t (setq mfolder (if (and nnmairix-hidden-folders (not (string-match "^\\." folder))) (concat "." folder) folder)) (if (eq nnmairix-backend (quote nnml)) (progn (setq folderpath (cadr (assoc ... backendmethod))) (if (not folderpath) (progn (setq folderpath nnml-directory))))) (if (eq nnmairix-backend (quote nnmaildir)) (progn (setq folderpath (cadr (assoc ... backendmethod))))) (if folderpath (progn (setq mfolder (concat (file-name-as-directory ...) mfolder)))) (setq rval (if (and fast allowfast) 0 (nnmairix-call-mairix-binary (split-string nnmairix-mairix-command) mfolder query threads))) (cond ((zerop rval) (nnmairix-call-backend "open-server" nnmairix-backend-server) (if (eq nnmairix-backend (quote nnml)) (progn (if nnmairix-rename-files-for-nnml ...) (nnml-generate-nov-databases-directory mfolder nil t))) (nnmairix-call-backend "request-scan" folder nnmairix-backend-server) (if (eq nnmairix-backend (quote nnimap)) (progn (nnmairix-call-backend "request-group-scan" folder nnmairix-backend-server))) (if (and fast allowfast) t (nnmairix-request-group-with-article-number-correction folder qualgroup))) ((and (= rval 1) (save-current-buffer (set-buffer nnmairix-mairix-output-buffer) (goto-char ...) (looking-at "^Matched 0 messages"))) (nnheader-message 5 "Mairix: No matches found.") (set-buffer nntp-server-buffer) (erase-buffer) (insert (concat "211 0 1 0 " group)) t) (t (nnheader-report (quote nnmairix) "Error running mairix. See buffer %s for details" nnmairix-mairix-output-buffer) nil)))))
  nnmairix-request-group("nnmairixsearch" "mairixserver" nil ("nnmairix+mairixserver:nnmairixsearch" 3 nil nil (nnmairix "mairixserver" (nnmairix-backend nnimap) (nnmairix-backend-server "rocky") (nnmairix-mairix-command "mairix") (nnmairix-hidden-folders t) (nnmairix-default-group "nnmairixsearch")) ((query "test" "d:1w-") (folder . "zz_mairix-nnmairixsearch-1") (threads))))
  gnus-activate-group("nnmairix+mairixserver:nnmairixsearch" scan nil (nnmairix "mairixserver" (nnmairix-backend nnimap) (nnmairix-backend-server "rocky") (nnmairix-mairix-command "mairix") (nnmairix-hidden-folders t) (nnmairix-default-group "nnmairixsearch")))
  gnus-group-get-new-news-this-group()
  (save-excursion (nnmairix-open-server (nth 1 method)) (set-buffer gnus-group-buffer) (setq info (nth 2 (symbol-value (intern-soft group gnus-newsrc-hashtb)))) (set (intern group gnus-active-hashtb) nil) (gnus-info-clear-data info) (nnmairix-delete-recreate-group group) (if (member nnmairix-backend nnmairix-delete-and-create-on-change) (progn (if corr (progn (setcar corr t) (gnus-group-set-parameter group (quote numcorr) corr))))) (gnus-group-jump-to-group group) (gnus-group-get-new-news-this-group))
  (if (eq (nth 0 method) (quote nnmairix)) (save-excursion (nnmairix-open-server (nth 1 method)) (set-buffer gnus-group-buffer) (setq info (nth 2 (symbol-value (intern-soft group gnus-newsrc-hashtb)))) (set (intern group gnus-active-hashtb) nil) (gnus-info-clear-data info) (nnmairix-delete-recreate-group group) (if (member nnmairix-backend nnmairix-delete-and-create-on-change) (progn (if corr (progn (setcar corr t) (gnus-group-set-parameter group (quote numcorr) corr))))) (gnus-group-jump-to-group group) (gnus-group-get-new-news-this-group)) (error "`nnmairix-update-and-clear-marks' called with non-nnmairix group"))
  (let ((method (or method (gnus-find-method-for-group group))) (corr (gnus-group-get-parameter group (quote numcorr) t)) info) (if (or (gnus-group-prefixed-p group) (not method)) nil (setq group (gnus-group-prefixed-name group method))) (if (eq (nth 0 method) (quote nnmairix)) (save-excursion (nnmairix-open-server (nth 1 method)) (set-buffer gnus-group-buffer) (setq info (nth 2 (symbol-value (intern-soft group gnus-newsrc-hashtb)))) (set (intern group gnus-active-hashtb) nil) (gnus-info-clear-data info) (nnmairix-delete-recreate-group group) (if (member nnmairix-backend nnmairix-delete-and-create-on-change) (progn (if corr (progn (setcar corr t) (gnus-group-set-parameter group ... corr))))) (gnus-group-jump-to-group group) (gnus-group-get-new-news-this-group)) (error "`nnmairix-update-and-clear-marks' called with non-nnmairix group")))
  nnmairix-update-and-clear-marks("nnmairix+mairixserver:nnmairixsearch")
  (let* ((qualgroup (gnus-group-prefixed-name nnmairix-default-group (list (quote nnmairix) (nth 1 server))))) (set-buffer gnus-group-buffer) (if (stringp query) (progn (setq query (split-string query)))) (gnus-group-set-parameter qualgroup (quote query) query) (if (symbolp threads) (if (eq threads (quote t)) (progn (gnus-group-set-parameter qualgroup (quote threads) t))) (if (< threads 0) (progn (gnus-group-set-parameter qualgroup (quote threads) nil)))) (nnmairix-update-and-clear-marks qualgroup) (if (equal (symbol-value (intern-soft qualgroup gnus-active-hashtb)) (quote (1 . 0))) nil (gnus-group-read-group nil t qualgroup)))
  nnmairix-search("test d:1w-")
  call-interactively(nnmairix-search record nil)
  command-execute(nnmairix-search record)
  execute-extended-command(nil "nnmairix-search")
  call-interactively(execute-extended-command nil nil)




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

* Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling
  2015-07-12 17:01                   ` Dan Christensen
@ 2015-07-13  5:36                     ` Eric Abrahamsen
  0 siblings, 0 replies; 25+ messages in thread
From: Eric Abrahamsen @ 2015-07-13  5:36 UTC (permalink / raw)
  To: ding

Dan Christensen <jdc@uwo.ca> writes:

> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>
>> Eric Abrahamsen <eric@ericabrahamsen.net> writes:
>>
>>> Dan Christensen <jdc@uwo.ca> writes:
>>>
>>>> Could nnmairix be adjusted to make an extra call at some point to
>>>> activate the appropriate group?  Maybe it needs to call
>>>> nnimap-request-group-scan instead of nnimap-request-group, now that
>>>> 447c5 changed the behaviour of the latter?
>>>
>>> I think this is probably the right solution. I'm still convinced that
>>> nnimap should do something in the group creation process to register the
>>> group with Gnus, but you're right that your problem is likely a direct
>>> result of "request-group" getting split into "request-group" and
>>> "request-group-scan", and nnmairix not being edited to follow.
>>>
>>> I'm a little bit out of my depth here, but give this patch a whirl and
>>> see how it goes.
>>
>> Dammit, I think that was wrong. Would you try it anyway, then unapply it
>> and try this one instead?
>
> I tried the first, the second, and both, and didn't notice any change.
> (I still had your nnimap.el patches applied as 
> Here is the backtrace with the patch nnmairix-scan-imap-groups.patch
> applied.

Bah! Thanks for testing. I'm going to stop throwing patches at you until
I can get my own nnmairix installation working, and test things there.
This is a silly way of doing it.

More later...

eric




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

end of thread, other threads:[~2015-07-13  5:36 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-01 11:37 [PATCH 0/2] two minor fixes for new/empty nnimap group handling Bjørn Mork
2015-07-01 11:37 ` [PATCH 1/2] nnimap.el (nnimap-request-group): don't make nil into a list Bjørn Mork
2015-07-01 11:37 ` [PATCH 2/2] nnimap.el (nnimap-request-group): group could be empty Bjørn Mork
2015-07-01 11:50 ` [PATCH 0/2] two minor fixes for new/empty nnimap group handling Alan Schmitt
2015-07-01 12:23   ` Bjørn Mork
2015-07-01 13:49     ` Alan Schmitt
2015-07-02  2:18 ` Nikolaus Rath
2015-07-06  2:45 ` Eric Abrahamsen
2015-07-06  8:40   ` Bjørn Mork
2015-07-06 15:11     ` Eric Abrahamsen
2015-07-06 15:32 ` Dan Christensen
2015-07-07  2:48   ` Eric Abrahamsen
2015-07-07 23:12     ` Dan Christensen
2015-07-08  4:20       ` Eric Abrahamsen
2015-07-08 21:45         ` Dan Christensen
2015-07-09  1:53           ` Eric Abrahamsen
2015-07-09  2:52             ` Dan Christensen
2015-07-09 13:47               ` Dan Christensen
2015-07-10  2:41                 ` Eric Abrahamsen
2015-07-10 12:42                   ` Dan Christensen
2015-07-12  4:11               ` Eric Abrahamsen
2015-07-12  4:27                 ` Eric Abrahamsen
2015-07-12 17:01                   ` Dan Christensen
2015-07-13  5:36                     ` Eric Abrahamsen
2015-07-08 12:41       ` Eric Abrahamsen

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