Re: Hi all
[notmuch-archives.git] / d2 / 48bc2b00a14d39276da41e0900f44829d20481
1 Return-Path: <tomi.ollila@iki.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 F0A45431FB6\r
6         for <notmuch@notmuchmail.org>; Wed, 21 Nov 2012 23:39:58 -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 Q8ZuqiAqOgb8 for <notmuch@notmuchmail.org>;\r
16         Wed, 21 Nov 2012 23:39:58 -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 D3DCB431FAF\r
19         for <notmuch@notmuchmail.org>; Wed, 21 Nov 2012 23:39:57 -0800 (PST)\r
20 Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
21         by guru.guru-group.fi (Postfix) with ESMTP id 1443010010B;\r
22         Thu, 22 Nov 2012 09:39:55 +0200 (EET)\r
23 From: Tomi Ollila <tomi.ollila@iki.fi>\r
24 To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
25 Subject: Re: [PATCH v3 2/2] notmuch-show.el: handle the case where\r
26         icalendar-import-buffer returns nil\r
27 In-Reply-To: <87sj82wb0f.fsf@zancas.localnet>\r
28 References: <1352376480-29961-1-git-send-email-tomi.ollila@iki.fi>\r
29         <1352376480-29961-3-git-send-email-tomi.ollila@iki.fi>\r
30         <87sj82wb0f.fsf@zancas.localnet>\r
31 User-Agent: Notmuch/0.14+84~g8a199bf (http://notmuchmail.org) Emacs/24.2.1\r
32         (x86_64-unknown-linux-gnu)\r
33 X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
34         $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
35         !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
36 Date: Thu, 22 Nov 2012 09:39:54 +0200\r
37 Message-ID: <m2liduqe5x.fsf@guru.guru-group.fi>\r
38 MIME-Version: 1.0\r
39 Content-Type: text/plain\r
40 X-BeenThere: notmuch@notmuchmail.org\r
41 X-Mailman-Version: 2.1.13\r
42 Precedence: list\r
43 List-Id: "Use and development of the notmuch mail system."\r
44         <notmuch.notmuchmail.org>\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
46         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
48 List-Post: <mailto:notmuch@notmuchmail.org>\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
51         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
52 X-List-Received-Date: Thu, 22 Nov 2012 07:39:59 -0000\r
53 \r
54 On Thu, Nov 22 2012, David Bremner <david@tethera.net> wrote:\r
55 \r
56 > Tomi Ollila <tomi.ollila@iki.fi> writes:\r
57 >\r
58 >> icalendar-import-buffer can fail by an error signal (which have been\r
59 >> witnessed) but according to its docstring it can also return nil\r
60 >> when failing (it returns t when succeeding).\r
61 >>\r
62 >> Now that the error is caught by the caller of notmuch-show-inset-part-*\r
63 >> functions in case icalendar-import-buffer returns nil an explicit\r
64 >> error is signaled and unwind-protect takes care of deleting the\r
65 >> temporary file (just in case, it is usually not written to the fs yet).\r
66 >\r
67 > This one looks OK to me too, although the API that makes it necessary\r
68 > out to be taken out back...\r
69 \r
70 I didn't quite understand the meaning of the last words...\r
71 \r
72 Anyway, the point in this patch is that if icalendar-import-buffer (or\r
73 the older version using icalendar private functions) fail by returning\r
74 nil, the error case is not (and has not been) shown to the user (user\r
75 gets either empty or partially filled bodypart.\r
76 \r
77 Now that we would have that condition-case in the caller this code can \r
78 signal error message to the user and provide info where more information\r
79 can be obtained (*ical-errors* buffer).\r
80 \r
81 More complex code could be used to make \r
82 notmuch-show-insert-part-text/calendar return nil in case \r
83 icalendar-import-buffer fails -- then \r
84 notmuch-show-insert-bodypart-internal would attempt to use\r
85 next handler in chain to insert content (if any)\r
86 \r
87 >\r
88 > d\r
89 \r
90 Tomi\r
91 \r
92 \r
93 > _______________________________________________\r
94 > notmuch mailing list\r
95 > notmuch@notmuchmail.org\r
96 > http://notmuchmail.org/mailman/listinfo/notmuch\r