From: Tomi Ollila <tomi.ollila@iki.fi>
To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org
Subject: Re: [PATCH v3 2/2] notmuch-show.el: handle the case where icalendar-import-buffer returns nil
Date: Thu, 22 Nov 2012 09:39:54 +0200 [thread overview]
Message-ID: <m2liduqe5x.fsf@guru.guru-group.fi> (raw)
In-Reply-To: <87sj82wb0f.fsf@zancas.localnet>
On Thu, Nov 22 2012, David Bremner <david@tethera.net> wrote:
> Tomi Ollila <tomi.ollila@iki.fi> writes:
>
>> icalendar-import-buffer can fail by an error signal (which have been
>> witnessed) but according to its docstring it can also return nil
>> when failing (it returns t when succeeding).
>>
>> Now that the error is caught by the caller of notmuch-show-inset-part-*
>> functions in case icalendar-import-buffer returns nil an explicit
>> error is signaled and unwind-protect takes care of deleting the
>> temporary file (just in case, it is usually not written to the fs yet).
>
> This one looks OK to me too, although the API that makes it necessary
> out to be taken out back...
I didn't quite understand the meaning of the last words...
Anyway, the point in this patch is that if icalendar-import-buffer (or
the older version using icalendar private functions) fail by returning
nil, the error case is not (and has not been) shown to the user (user
gets either empty or partially filled bodypart.
Now that we would have that condition-case in the caller this code can
signal error message to the user and provide info where more information
can be obtained (*ical-errors* buffer).
More complex code could be used to make
notmuch-show-insert-part-text/calendar return nil in case
icalendar-import-buffer fails -- then
notmuch-show-insert-bodypart-internal would attempt to use
next handler in chain to insert content (if any)
>
> d
Tomi
> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch
prev parent reply other threads:[~2012-11-22 7:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-08 12:07 [PATCH v3 0/2] notmuch-show.el: text/calendar part insert fix Tomi Ollila
2012-11-08 12:07 ` [PATCH v3 1/2] notmuch-show.el: import calendar data with public function after CR removal Tomi Ollila
2012-11-22 3:48 ` David Bremner
2012-11-25 15:19 ` David Bremner
2012-11-08 12:08 ` [PATCH v3 2/2] notmuch-show.el: handle the case where icalendar-import-buffer returns nil Tomi Ollila
2012-11-22 3:51 ` David Bremner
2012-11-22 7:39 ` Tomi Ollila [this message]
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
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2liduqe5x.fsf@guru.guru-group.fi \
--to=tomi.ollila@iki.fi \
--cc=david@tethera.net \
--cc=notmuch@notmuchmail.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.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
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 read-only IMAP folder(s) and NNTP newsgroup(s).