Re: [PATCH] emacs: wash: make word-wrap bound message width
[notmuch-archives.git] / c9 / e66097df4001c23ebd368a89348a5a7c01ab56
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 068F9431FB6\r
6         for <notmuch@notmuchmail.org>; Wed,  7 Nov 2012 07:54:41 -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 hKmX0YbpCboC for <notmuch@notmuchmail.org>;\r
16         Wed,  7 Nov 2012 07:54:39 -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 51187431FAE\r
19         for <notmuch@notmuchmail.org>; Wed,  7 Nov 2012 07:54:39 -0800 (PST)\r
20 Received: by guru.guru-group.fi (Postfix, from userid 501)\r
21         id BD5B010009D; Wed,  7 Nov 2012 17:54:38 +0200 (EET)\r
22 From: Tomi Ollila <tomi.ollila@iki.fi>\r
23 To: notmuch@notmuchmail.org\r
24 Subject: [PATCH 1/1] notmuch-show.el: extended icalendar unfolding with single\r
25         CR removal\r
26 Date: Wed,  7 Nov 2012 17:54:36 +0200\r
27 Message-Id: <1352303676-21920-1-git-send-email-tomi.ollila@iki.fi>\r
28 X-Mailer: git-send-email 1.8.0\r
29 Cc: tomi.ollila@iki.fi\r
30 X-BeenThere: notmuch@notmuchmail.org\r
31 X-Mailman-Version: 2.1.13\r
32 Precedence: list\r
33 List-Id: "Use and development of the notmuch mail system."\r
34         <notmuch.notmuchmail.org>\r
35 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
36         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
37 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
38 List-Post: <mailto:notmuch@notmuchmail.org>\r
39 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
40 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
41         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
42 X-List-Received-Date: Wed, 07 Nov 2012 15:54:41 -0000\r
43 \r
44 In case text/calendar content contained "folded" data (i.e. line\r
45 continues to next line which begins with whitespace...\r
46 \r
47 or\r
48 \r
49 The text/calendar content is inside separate (application/octet-stream)\r
50 content and the text/calendar entry there contains carriage returns...\r
51 \r
52 ... The parsing of text/calendar content fails and next method of\r
53 inserting the content is used (if any), usually providing less readable\r
54 output.\r
55 \r
56 In this change the input calendar content is unfolded extending the\r
57 unfolding code used in `icalendar--get-unfolded-buffer` with single CRs\r
58 removal.\r
59 ---\r
60 \r
61 This obsoletes id:1349333712-18347-1-git-send-email-tomi.ollila@iki.fi\r
62 Commit message is changed to reflect change in pushed patch \r
63 id:1350826509-12119-1-git-send-email-tomi.ollila@iki.fi\r
64 also, '\\r?' part in regexp was removed.\r
65 \r
66 Note the difference how id:87d31artti.fsf@inf-8657.int-evry.fr\r
67 is inserted before and after this change.\r
68 \r
69  emacs/notmuch-show.el | 5 +++++\r
70  1 file changed, 5 insertions(+)\r
71 \r
72 diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
73 index d061367..d51345e 100644\r
74 --- a/emacs/notmuch-show.el\r
75 +++ b/emacs/notmuch-show.el\r
76 @@ -750,6 +750,11 @@ message at DEPTH in the current thread."\r
77             (goto-char (point-min))\r
78             (let ((file (make-temp-file "notmuch-ical"))\r
79                   result)\r
80 +             ;; `icalendar--get-unfolded-buffer' unfolds with "\r?\n[ \t]".\r
81 +             ;; This unfolding extends that by removing other CRs too.\r
82 +             (while (re-search-forward "\\(\r\\|\n[ \t]\\)" nil t)\r
83 +               (replace-match "" nil nil))\r
84 +             (goto-char (point-min))\r
85               (icalendar--convert-ical-to-diary\r
86                (icalendar--read-element nil nil)\r
87                file t)\r
88 -- \r
89 1.8.0\r
90 \r