[PATCH] lib: reword comment about XFOLDER: prefix
[notmuch-archives.git] / 6d / 1f64c76e764d4782b648db3b4863f85e299880
1 Return-Path: <too@guru-group.fi>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 90229431FAE\r
6         for <notmuch@notmuchmail.org>; Thu,  8 Nov 2012 04:08:03 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id Zz9mlEeI3xkC for <notmuch@notmuchmail.org>;\r
16         Thu,  8 Nov 2012 04:08:02 -0800 (PST)\r
17 Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
18         by olra.theworths.org (Postfix) with ESMTP id 76886431FB6\r
19         for <notmuch@notmuchmail.org>; Thu,  8 Nov 2012 04:08:02 -0800 (PST)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id 684E610009E; Thu,  8 Nov 2012 14:08:02 +0200 (EET)\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>\r
23 To: notmuch@notmuchmail.org\r
24 Subject: [PATCH v3 1/2] notmuch-show.el: import calendar data with public\r
25         function after CR removal\r
26 Date: Thu,  8 Nov 2012 14:07:59 +0200\r
27 Message-Id: <1352376480-29961-2-git-send-email-tomi.ollila@iki.fi>\r
28 X-Mailer: git-send-email 1.8.0\r
29 In-Reply-To: <1352376480-29961-1-git-send-email-tomi.ollila@iki.fi>\r
30 References: <1352376480-29961-1-git-send-email-tomi.ollila@iki.fi>\r
31 Cc: tomi.ollila@iki.fi\r
32 X-BeenThere: notmuch@notmuchmail.org\r
33 X-Mailman-Version: 2.1.13\r
34 Precedence: list\r
35 List-Id: "Use and development of the notmuch mail system."\r
36         <notmuch.notmuchmail.org>\r
37 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
38         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
39 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
40 List-Post: <mailto:notmuch@notmuchmail.org>\r
41 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
42 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
44 X-List-Received-Date: Thu, 08 Nov 2012 12:08:03 -0000\r
45 \r
46 notmuch-get-bodypart-content provides raw data to its caller so\r
47 that it can be stored verbatim whenever needed. icalendar functions\r
48 expect Emacs to do EOL conversion for the data given to these. Therefore\r
49 it the CRLF -> LF conversion is now done explicitly.\r
50 \r
51 The calls to private functions icalendar--convert-ical-to-diary and\r
52 icalendar--read-element are replaced with call to public function\r
53 icalendar-import-buffer.\r
54 ---\r
55  emacs/notmuch-show.el | 8 +++++---\r
56  1 file changed, 5 insertions(+), 3 deletions(-)\r
57 \r
58 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
59 index d061367..e3977cc 100644\r
60 --- a/emacs/notmuch-show.el\r
61 +++ b/emacs/notmuch-show.el\r
62 @@ -747,12 +747,14 @@ message at DEPTH in the current thread."\r
63    (notmuch-show-insert-part-header nth declared-type content-type (plist-get part :filename))\r
64    (insert (with-temp-buffer\r
65             (insert (notmuch-get-bodypart-content msg part nth notmuch-show-process-crypto))\r
66 +           ;; notmuch-get-bodypart-content provides "raw", non-converted\r
67 +           ;; data. Replace CRLF with LF before icalendar can use it.\r
68             (goto-char (point-min))\r
69 +           (while (re-search-forward "\r\n" nil t)\r
70 +             (replace-match "\n" nil nil))\r
71             (let ((file (make-temp-file "notmuch-ical"))\r
72                   result)\r
73 -             (icalendar--convert-ical-to-diary\r
74 -              (icalendar--read-element nil nil)\r
75 -              file t)\r
76 +             (icalendar-import-buffer file t)\r
77               (set-buffer (get-file-buffer file))\r
78               (setq result (buffer-substring (point-min) (point-max)))\r
79               (set-buffer-modified-p nil)\r
80 -- \r
81 1.8.0\r
82 \r