Gnus development mailing list
 help / color / mirror / Atom feed
From: Trevor Murphy <trevor.m.murphy@gmail.com>
To: ding@gnus.org
Subject: [RFC 3/3] Parse Gmail labels as IMAP headers
Date: Mon, 10 Nov 2014 20:09:23 -0500	[thread overview]
Message-ID: <1415668163-29280-4-git-send-email-trevor.m.murphy@gmail.com> (raw)
In-Reply-To: <1415668163-29280-1-git-send-email-trevor.m.murphy@gmail.com>

---
 lisp/gnus/nnimap.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el
index 5eb812a..f9b92eb 100644
--- a/lisp/gnus/nnimap.el
+++ b/lisp/gnus/nnimap.el
@@ -203,7 +203,7 @@ textual parts.")
 
 (defun nnimap-transform-headers ()
   (goto-char (point-min))
-  (let (article lines size string)
+  (let (article lines size string labels)
     (block nil
       (while (not (eobp))
 	(while (not (looking-at "\\* [0-9]+ FETCH"))
@@ -238,6 +238,9 @@ textual parts.")
 				      t)
 		   (match-string 1)))
 	(beginning-of-line)
+	(when (search-forward "X-GM-LABELS" (line-end-position) t)
+	  (setq labels (ignore-errors (read (current-buffer)))))
+	(beginning-of-line)
 	(when (search-forward "BODYSTRUCTURE" (line-end-position) t)
 	  (let ((structure (ignore-errors
 			     (read (current-buffer)))))
@@ -257,6 +260,8 @@ textual parts.")
 	  (insert (format "Chars: %s\n" size)))
 	(when lines
 	  (insert (format "Lines: %s\n" lines)))
+	(when labels
+	  (insert (format "X-GM-LABELS: %s\n" labels)))
 	;; Most servers have a blank line after the headers, but
 	;; Davmail doesn't.
 	(unless (re-search-forward "^\r$\\|^)\r?$" nil t)
-- 
2.1.3




  parent reply	other threads:[~2014-11-11  1:09 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-11  1:09 Extend nnimap to request Gmail labels with message headers Trevor Murphy
2014-11-11  1:09 ` [RFC 1/3] Rewrite `nnimap-header-parameters' Trevor Murphy
2014-11-11  1:09 ` [RFC 2/3] Request Gmail labels in IMAP headers Trevor Murphy
2014-11-11  1:09 ` Trevor Murphy [this message]
2014-11-11  1:18 ` Extend nnimap to request Gmail labels with message headers Ted Zlatanov
2014-11-11  2:19 ` Eric Abrahamsen
2014-11-11  3:29   ` Trevor Murphy
2014-11-11  7:11     ` Eric Abrahamsen
2014-11-14  4:15 ` Trevor Murphy
2015-01-26  4:31 ` Lars Ingebrigtsen
2015-01-26  5:44   ` Trevor Murphy
2015-01-26  7:12     ` Lars Ingebrigtsen
2015-01-26  9:41       ` Lars Ingebrigtsen
2015-01-29 18:13         ` Trevor Murphy
2015-02-04 11:40           ` Ted Zlatanov
2015-02-05  2:38             ` Lars Ingebrigtsen
2015-02-05  4:09               ` Ted Zlatanov
2015-02-05  4:42                 ` Lars Ingebrigtsen
2015-02-05  2:36           ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1415668163-29280-4-git-send-email-trevor.m.murphy@gmail.com \
    --to=trevor.m.murphy@gmail.com \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).