From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/85259 Path: news.gmane.org!not-for-mail From: Trevor Murphy Newsgroups: gmane.emacs.gnus.general Subject: Extend nnimap to request Gmail labels with message headers Date: Mon, 10 Nov 2014 20:09:20 -0500 Message-ID: <1415668163-29280-1-git-send-email-trevor.m.murphy@gmail.com> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1415668238 29129 80.91.229.3 (11 Nov 2014 01:10:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Nov 2014 01:10:38 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M33500@lists.math.uh.edu Tue Nov 11 02:10:26 2014 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XnzyR-0004VF-RG for ding-account@gmane.org; Tue, 11 Nov 2014 02:10:24 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Xnzxq-0003hz-Gg; Mon, 10 Nov 2014 19:09:46 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Xnzxo-0003hh-PD for ding@lists.math.uh.edu; Mon, 10 Nov 2014 19:09:44 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES128-SHA:128) (Exim 4.76) (envelope-from ) id 1Xnzxn-0002Gb-Pc for ding@lists.math.uh.edu; Mon, 10 Nov 2014 19:09:44 -0600 Original-Received: from mail-yk0-f178.google.com ([209.85.160.178]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1Xnzxm-0005rS-9Z for ding@gnus.org; Tue, 11 Nov 2014 02:09:42 +0100 Original-Received: by mail-yk0-f178.google.com with SMTP id 79so4161290ykr.9 for ; Mon, 10 Nov 2014 17:09:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=zQa+B4HnyP4qhVxqaIT4UWW15G38AeVe4AHlshYWQN8=; b=ZG8QMraTfD/Z+tDF6rKsFiJp3tt9oHabnKKtbqhlL/RPd6k6k4AqwtrxX8V1DMiO4d ErM0Y9xzBH+5MaXTIVHUup8Dz8499/WdsH2YjeyTkLnTNIMJL2nf24v7mB3v27WgnTze SpYjMn0PTkCt43q66x1Ep+ZwjvV/JxQuEjSB/ZRkvQIURUu/dmc4jNYzF3AMvg8eNo8e 8PFvuBGGf6lOv6JAlHhcdQloEKVtYenMtnSd9f4CXStCOqwxFtnuj2aAipcdXftv+xr2 6g/6/8zJ3Q6Hl/I35T4hubkV7Ty4ICs8fDrxwV9Oa1IdkcF3ietqxs8OuAL3ZooT4Sib nQqA== X-Received: by 10.170.67.138 with SMTP id j132mr37879630ykj.72.1415668175944; Mon, 10 Nov 2014 17:09:35 -0800 (PST) Original-Received: from organize.localdomain (z65-50-91-81.ips.direcpath.com. [65.50.91.81]) by mx.google.com with ESMTPSA id i60sm10088853yha.3.2014.11.10.17.09.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 10 Nov 2014 17:09:34 -0800 (PST) X-Mailer: git-send-email 2.1.3 X-Spam-Score: -3.0 (---) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:85259 Archived-At: This is a proof-of-concept / RFC series of patches. It may not make sense to treat these labels as message headers, I just find it suits my workflow pretty well. I had to significantly rewrite `nnimap-header-parameters' to incorporate the option, so please pay special attention to the first patch. Note that the it shouldn't change the functionality, it's just a rewrite that makes the later patches possible. After that first patch the next two just parse Google's response. I haven't extensively tested Google's API, so even though this code works for me and looks simple, I don't know when it will break. The net result is that you get X-GM-LABELS exposed as a message header. The content is always a parenthesized (possibly empty) list. Full docs here: https://developers.google.com/gmail/imap_extensions#access_to_gmail_labels_x-gm-labels I add this to `gnus-extra-headers' and use it all over my Gmail summary buffers. For instance, you can display the labels in summary buffer lines with a user format function and narrow the buffer to a label with limit-to-extra. Thoughts? -- Trevor Murphy, ASA, MAAA GnuPG Key: 0x83881C0A