From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/86047 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.gnus.general Subject: Re: [PATCH 0/2] two minor fixes for new/empty nnimap group handling Date: Thu, 09 Jul 2015 09:53:43 +0800 Message-ID: <871tgi9jvc.fsf@ericabrahamsen.net> References: <1435750676-710-1-git-send-email-bjorn@mork.no> <87y4itti71.fsf@uwo.ca> <878uaspts1.fsf@ericabrahamsen.net> <87io9va7f5.fsf@uwo.ca> <87zj37nuu3.fsf@ericabrahamsen.net> <877fqa728f.fsf@uwo.ca> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1436406881 18809 80.91.229.3 (9 Jul 2015 01:54:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 9 Jul 2015 01:54:41 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M34282@lists.math.uh.edu Thu Jul 09 03:54:26 2015 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from lists1.math.uh.edu ([129.7.128.208]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZD12e-0006vM-PE for ding-account@gmane.org; Thu, 09 Jul 2015 03:54:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.85) (envelope-from ) id 1ZD12K-0003fk-4a; Wed, 08 Jul 2015 20:54:04 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by lists1.math.uh.edu with esmtps (TLSv1.2:AES128-GCM-SHA256:128) (Exim 4.85) (envelope-from ) id 1ZD12I-0003fP-Fv for ding@lists.math.uh.edu; Wed, 08 Jul 2015 20:54:02 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1.2:DHE-RSA-AES128-SHA:128) (Exim 4.84) (envelope-from ) id 1ZD12H-0003Td-63 for ding@lists.math.uh.edu; Wed, 08 Jul 2015 20:54:02 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1ZD12F-0003M5-4L for ding@gnus.org; Thu, 09 Jul 2015 03:53:59 +0200 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ZD12E-0006dj-D4 for ding@gnus.org; Thu, 09 Jul 2015 03:53:58 +0200 Original-Received: from 111.199.149.245 ([111.199.149.245]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 09 Jul 2015 03:53:58 +0200 Original-Received: from eric by 111.199.149.245 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 09 Jul 2015 03:53:58 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 146 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 111.199.149.245 User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:gRF6cGo4x/21kkBS206T0MHM2zg= X-Spam-Score: -0.4 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:86047 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Dan Christensen writes: > Eric Abrahamsen 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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0002-Handle-nil-info-argument-to-nnimap-request-group.patch >From 9ac88493d7dab1aa2169230e329fda2c1550353e Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen 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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Tell-Gnus-about-newly-created-imap-groups.patch >From c0b97aeee190f87ff2a19193f951852b17705faf Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen 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 --=-=-=--