From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Pluim Newsgroups: gmane.emacs.bugs Subject: bug#21057: [PATCH] nnimap.el: add support for IMAP namespaces Date: Mon, 23 Jul 2018 13:28:50 +0200 Message-ID: <87r2jukx71.fsf@gmail.com> References: <87efrlfa20.fsf@thinkpad.rath.org> <87a829f9pc.fsf@thinkpad.rath.org> <1504800077.365137.1098530944.678C4105@webmail.messagingengine.com> <87k212zetg.fsf@mouse.gnus.org> <877ewxoi32.fsf@vostro.rath.org> <87r2rfj2r7.fsf@mouse.gnus.org> <1527766712.3634038.1391649040.3CF55CA8@webmail.messagingengine.com> <87in56h4o7.fsf@ericabrahamsen.net> <8736wazaa5.fsf@thinkpad.rath.org> <96381CD8-3F69-4C9C-9252-CB351CD47B03@rath.org> <87o9eyjn0t.fsf@thinkpad.rath.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1532345230 30804 195.159.176.226 (23 Jul 2018 11:27:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 23 Jul 2018 11:27:10 +0000 (UTC) Cc: Eric Abrahamsen , Andreas Schwab , Lars Ingebrigtsen , 21057@debbugs.gnu.org To: Nikolaus Rath Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 23 13:27:05 2018 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fhYzZ-0007rV-60 for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Jul 2018 13:27:05 +0200 Original-Received: from localhost ([::1]:33958 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhZ1e-0005Mc-DT for geb-bug-gnu-emacs@m.gmane.org; Mon, 23 Jul 2018 07:29:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51298) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fhZ1X-0005MH-2A for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2018 07:29:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fhZ1T-0001gg-PX for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2018 07:29:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48104) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fhZ1T-0001fJ-KH for bug-gnu-emacs@gnu.org; Mon, 23 Jul 2018 07:29:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fhZ1S-0005Jj-5l; Mon, 23 Jul 2018 07:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Robert Pluim Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bugs@gnus.org Resent-Date: Mon, 23 Jul 2018 11:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21057 X-GNU-PR-Package: emacs,gnus X-GNU-PR-Keywords: patch Original-Received: via spool by 21057-submit@debbugs.gnu.org id=B21057.153234534020432 (code B ref 21057); Mon, 23 Jul 2018 11:29:02 +0000 Original-Received: (at 21057) by debbugs.gnu.org; 23 Jul 2018 11:29:00 +0000 Original-Received: from localhost ([127.0.0.1]:53121 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fhZ1Q-0005JU-IE for submit@debbugs.gnu.org; Mon, 23 Jul 2018 07:29:00 -0400 Original-Received: from mail-ed1-f68.google.com ([209.85.208.68]:35961) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fhZ1P-0005JG-38 for 21057@debbugs.gnu.org; Mon, 23 Jul 2018 07:28:59 -0400 Original-Received: by mail-ed1-f68.google.com with SMTP id k15-v6so644884edr.3 for <21057@debbugs.gnu.org>; Mon, 23 Jul 2018 04:28:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:mail-copies-to:gmane-reply-to-list :date:in-reply-to:message-id:mime-version:content-transfer-encoding; bh=7peB/KcIbiBjMqZgTm0cS9QedNqR6qjPxRG8FtD5mGc=; b=P1FeOhhLLXl3LbLX6DqGjPogwyfplqy1GBUfZXkV8iAlzhsuFNKZmigWifUYnpsYGv 8YE5YBxfYxmxLuixNqSE+iniQHDw70itSayHDkmaGHNPcRfIaTo8pl7/hNUbrGY6EqNC zymzYchGnWIJB9KyGfaRjqUyYlXaHjhMR0xpofKx+TBwYeaUw9sxmOQnWZjSiqpNJlOt kgOGOuwtzqdEpXZ8valdXMeNMQcj4ibk9iVtPHUB2IC2i8Pp160gBdvJVYpy7PfnNh8T RALg5pzdIifzhkWh/Uc831G53cpRcm+AWMcuQbkjCEFg2/frb6rxWSoLOk2i30RtGbQ2 +Y1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:mail-copies-to :gmane-reply-to-list:date:in-reply-to:message-id:mime-version :content-transfer-encoding; bh=7peB/KcIbiBjMqZgTm0cS9QedNqR6qjPxRG8FtD5mGc=; b=WvhhQvlbJ3qQjoOB2zkPj2LMgyk74staPZ27fdFzAttvEow+Ab58TIyOcOlwq21LlX EY+KBPUnuPVxCdYcaZ4RKWCr42xSTtk0i90JgPRqdQUPNejXmgeuFFECqrg34LnNgRho vEjODLoSllWVAQiB/erEtbzonkytwgmSnVu+9NzCIx806ew/b8CYMwBi5kp4J7aWYaIK +UI02/nM3+4BtFNquq7VoTqAw6EOl+PBF/xA6b58s5AAykLWTOIINvwTc8kVOndeV4Zv eTKYxZIr++ZwLrx+83Z0iwbAP9gysQ108zjThfWpqe6QjeGNRnwlXuUT32AQcJWc19iw H9fw== X-Gm-Message-State: AOUpUlGC77adkFEI41fLUawwi4wmPMkA/DHrgckCW+f/gcI1rJEV2Ioz 2eXw/DhCWEQsW51/kqizKy4UYKUsj04= X-Google-Smtp-Source: AAOMgpfZivPVXW7yW90pC38xlbbJkk1G1PL2f/pKd96POdrKIURSzOap42f8mE5aqlBpucmprX0YdQ== X-Received: by 2002:a50:9135:: with SMTP id e50-v6mr13919098eda.191.1532345332722; Mon, 23 Jul 2018 04:28:52 -0700 (PDT) Original-Received: from rpluim-ubuntu ([149.5.228.1]) by smtp.gmail.com with ESMTPSA id n17-v6sm7089321edq.10.2018.07.23.04.28.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Jul 2018 04:28:51 -0700 (PDT) Mail-Copies-To: never Gmane-Reply-To-List: yes In-Reply-To: <87o9eyjn0t.fsf@thinkpad.rath.org> (Nikolaus Rath's message of "Mon, 23 Jul 2018 10:53:54 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:148852 Archived-At: Nikolaus Rath writes: Nitpicks below. > Hi, > > Reworked patch is attached. > > I tested with and and without nnimap-use-namespaces on Emacs 25.1.1. > > Best, > Nikolaus > > --=20 > GPG Fingerprint: ED31 791B 2C5C 1613 AF38 8B8A D113 FCAC 3C4E 599F > > =C2=BBTime flies like an arrow, fruit flies like a Banana.= =C2=AB > > From ff88c4969617ede5742e039136159fe3650ac693 Mon Sep 17 00:00:00 2001 > From: Nikolaus Rath > Date: Mon, 23 Jul 2018 10:21:46 +0100 > Subject: [PATCH] Make nnimap support IMAP namespaces > > * lisp/gnus/nnimap.el (nnimap-use-namespaces): Introduce new > server variable. > (nnimap-group-to-imap, nnimap-get-groups): Transform IMAP group > names to Gnus group name by stripping / prefixing personal > namespace prefix. > (nnimap-open-connection-1): Ask server for namespaces and store them. > > * lisp/gnus/nnimap.el (nnimap-request-group-scan) > (nnimap-request-create-group, nnimap-request-delete-group) > (nnimap-request-rename-group, nnimap-request-move-article) > (nnimap-process-expiry-targets) > (nnimap-request-update-group-status) > (nnimap-request-accept-article, nnimap-request-list) > (nnimap-retrieve-group-data-early, nnimap-change-group) > (nnimap-split-incoming-mail): Use nnimap-group-to-imap. > (nnimap-group-to-imap): New function to map Gnus group names to > IMAP folder names. > --- > doc/misc/gnus.texi | 6 ++++ > etc/NEWS | 5 +++ > lisp/gnus/nnimap.el | 93 +++++++++++++++++++++++++++++++++++++----------= ------ > 3 files changed, 77 insertions(+), 27 deletions(-) > > diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi > index 6793ed..cd97cf 100644 > --- a/doc/misc/gnus.texi > +++ b/doc/misc/gnus.texi > @@ -14320,6 +14320,12 @@ fetch all textual parts, while leaving the rest = on the server. > If non-@code{nil}, record all @acronym{IMAP} commands in the > @samp{"*imap log*"} buffer. >=20=20 > +@item nnimap-use-namespaces > +If non-@code{nil}, omit the IMAP namespace prefix in nnimap group > +names. If your IMAP mailboxes are called something like @samp{INBOX} > +and @samp{INBOX.Lists.emacs}, but you'd like the nnimap group names to > +be @samp{INBOX} and @samp{Lists.emacs}, you should enable this option. > + > @end table > Does this also work for secondary servers? I imagine it does. >=20=20 > diff --git a/etc/NEWS b/etc/NEWS > index fc2a5..57b51 100644 > --- a/etc/NEWS > +++ b/etc/NEWS > @@ -46,6 +46,11 @@ option --enable-check-lisp-object-type is therefore no= longer as > useful and so is no longer enabled by default in developer builds, > to reduce differences between developer and production builds. >=20=20 > +** Gnus > + > ++++ > +*** The nnimap backend now has support for IMAP namespaces. > + This should mention the 'nnimap-use-namespaces' variable. > > * Startup Changes in Emacs 27.1 >=20=20 > diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el > index 3b397..efcb68 100644 > --- a/lisp/gnus/nnimap.el > +++ b/lisp/gnus/nnimap.el > @@ -55,6 +55,13 @@ > If nnimap-stream is `ssl', this will default to `imaps'. If not, > it will default to `imap'.") >=20=20 > +(defvoo nnimap-use-namespaces nil > + "Whether to use IMAP namespaces. > +If in Gnus your folder names in all start with (e.g.) `INBOX', > +you probably want to set this to t. The effects of this are > +purely cosmetical, but changing this variable will affect the cosmetical=E2=87=92cosmetic Thanks Robert