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