From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/85267 Path: news.gmane.org!not-for-mail From: Eric Abrahamsen Newsgroups: gmane.emacs.gnus.general Subject: Re: Extend nnimap to request Gmail labels with message headers Date: Tue, 11 Nov 2014 15:11:29 +0800 Message-ID: <87y4rinrdq.fsf@ericabrahamsen.net> References: <1415668163-29280-1-git-send-email-trevor.m.murphy@gmail.com> <877fz2bhsp.fsf@ericabrahamsen.net> <87vbmmwh2z.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1415689655 13290 80.91.229.3 (11 Nov 2014 07:07:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 11 Nov 2014 07:07:35 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M33511@lists.math.uh.edu Tue Nov 11 08:07:28 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 1Xo5Xx-0001GF-VI for ding-account@gmane.org; Tue, 11 Nov 2014 08:07:27 +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 1Xo5XD-0005fJ-4c; Tue, 11 Nov 2014 01:06:39 -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 1Xo5X1-0005ex-Fu for ding@lists.math.uh.edu; Tue, 11 Nov 2014 01:06:27 -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 1Xo5Wz-0003Kr-Ve for ding@lists.math.uh.edu; Tue, 11 Nov 2014 01:06:26 -0600 Original-Received: from plane.gmane.org ([80.91.229.3]) by quimby.gnus.org with esmtp (Exim 4.80) (envelope-from ) id 1Xo5Wx-0005GF-Vs for ding@gnus.org; Tue, 11 Nov 2014 08:06:24 +0100 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Xo5Wt-0000ak-9p for ding@gnus.org; Tue, 11 Nov 2014 08:06:19 +0100 Original-Received: from 123.123.17.194 ([123.123.17.194]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 11 Nov 2014 08:06:19 +0100 Original-Received: from eric by 123.123.17.194 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 11 Nov 2014 08:06:19 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 39 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 123.123.17.194 User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:9s0yOwNS2lwo8g6lT2TCW0G3j1I= X-Spam-Score: -0.3 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:85267 Archived-At: Trevor Murphy writes: > On Mon, Nov 10 2014, Eric Abrahamsen wrote: > >> I'm curious how this interacts with Gmail labels' current behavior: >> treating them like imap groups. If a message has multiple labels, it >> appears copied to multiple groups, is that right? So won't all the >> messages in a group just have the same label? (Unless a message >> happens to have multiple labels.) > > Google's actually pretty clever about that. They change up the way > they give you the X-GM-LABELS info depending on which folder you're > reading from. So if you throw it into a format function you don't get > the redundant group name, only the other labels if there are any. > > At least, I think that's Google's doing. I know I didn't write code > to make it happen. > > Google does send down some labels that I never want to see in my > summary lines, though. "Important", "Starred", "Sent", and some old > labels that I keep around but find boring. Since the X-GM-LABELS info > always comes as a parenthesized list, it's easy to go: > > (defun my-gmail-label-format-function (header) > (let (labels (ignore-errors (read (gnus-extra-header 'X-GM-LABELS > header)))) > ...)) > > Now `labels' is a (possibly empty) list of symbols and I just go to > town with delq and what not. I strip out the ones I don't care about > and mapconcat the symbol-names of the rest. Interesting -- thanks for the rundown! I guess I rarely have messages with more than one label (I don't use the webmail interface at all, and do my best to pretend I'm not using gmail), but I can certainly see where this would be useful for those who do. Thanks, Eric