From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/86034 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: Tue, 07 Jul 2015 10:48:30 +0800 Message-ID: <878uaspts1.fsf@ericabrahamsen.net> References: <1435750676-710-1-git-send-email-bjorn@mork.no> <87y4itti71.fsf@uwo.ca> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: ger.gmane.org 1436237415 20910 80.91.229.3 (7 Jul 2015 02:50:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 7 Jul 2015 02:50:15 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M34269@lists.math.uh.edu Tue Jul 07 04:50:03 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 1ZCIxO-0007Zg-18 for ding-account@gmane.org; Tue, 07 Jul 2015 04:50:02 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by lists1.math.uh.edu with smtp (Exim 4.84) (envelope-from ) id 1ZCIwS-00087g-5C; Mon, 06 Jul 2015 21:49: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.84) (envelope-from ) id 1ZCIwQ-00087S-JA for ding@lists.math.uh.edu; Mon, 06 Jul 2015 21:49: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 1ZCIwO-0003iB-FI for ding@lists.math.uh.edu; Mon, 06 Jul 2015 21:49:02 -0500 Original-Received: from mail-la0-f53.google.com ([209.85.215.53]) by quimby.gnus.org with esmtps (TLS1.2:RSA_ARCFOUR_SHA1:128) (Exim 4.80) (envelope-from ) id 1ZCIw7-0007sQ-91 for ding@gnus.org; Tue, 07 Jul 2015 04:48:53 +0200 Original-Received: by lagx9 with SMTP id x9so178046042lag.1 for ; Mon, 06 Jul 2015 19:48:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=tMa6qzO0SBVE1y28lZBUnEQFxvGcy/NvRq8t3e0+vGk=; b=QfWhQXdcva9ZGmuC2vIif2Bdj1eZ3z9NcrwGNwW9JDv61ISINBzRQn82jCDiruNU79 gGGR1gOI6l+JiKAG77mCOUTCn9t4+8n7oKai2EQLUVBIX9rEXx4X4L9vsJ1Nx/5q/55B +37zM2k4aiwfplLXN0EoqwDVKiIKYvv+IY8TSehQBpPZq+GOd9ioAle3QFrFRnL5Wq7K ffj6YqDgFGxNmu2ZCdNKf1rwmaOAIYOms1F1Z0wtsxhtAx93zJE6L+C8ravkA5y4KPs/ TTYlS3/EbvwJBhqsdIUn/n02LWGBthWiz8IbQq3qJPOlpGyZH5lbklLw04P5bAsFJZCy XiAg== X-Gm-Message-State: ALoCoQkqpJQNwB8FV0eMYumw96dsRCfTofYsvla9XgmVQWDMHrfqcZK+KbXbNRQz1lziifiioxe3 X-Received: by 10.152.244.132 with SMTP id xg4mr1805131lac.1.1436237316407; Mon, 06 Jul 2015 19:48:36 -0700 (PDT) Original-Received: from localhost ([111.199.149.245]) by mx.google.com with ESMTPSA id oq2sm5238175lbb.34.2015.07.06.19.48.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Jul 2015 19:48:35 -0700 (PDT) In-Reply-To: <87y4itti71.fsf@uwo.ca> (Dan Christensen's message of "Mon, 06 Jul 2015 11:32:50 -0400") User-Agent: Gnus/5.130014 (Ma Gnus v0.14) Emacs/25.0.50 (gnu/linux) X-Spam-Score: -2.9 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:86034 Archived-At: --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Dan Christensen writes: > Bj=C3=B8rn Mork 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 --=-=-= Content-Type: text/x-diff Content-Disposition: attachment; filename=0001-Tell-Gnus-about-newly-created-imap-groups.patch >From 2d2388ef099ab4105d6e0106a33495e995d73d6a Mon Sep 17 00:00:00 2001 From: Eric Abrahamsen 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 --=-=-=--