[PATCH 1/1] emacs/notmuch-show.el: handle bodypart insert error
authorTomi Ollila <tomi.ollila@iki.fi>
Sun, 21 Oct 2012 13:20:42 +0000 (16:20 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:56 +0000 (09:49 -0800)
8e/2e743be10906862d07385d4c19c7184a0b3647 [new file with mode: 0644]

diff --git a/8e/2e743be10906862d07385d4c19c7184a0b3647 b/8e/2e743be10906862d07385d4c19c7184a0b3647
new file mode 100644 (file)
index 0000000..a3f2706
--- /dev/null
@@ -0,0 +1,80 @@
+Return-Path: <too@guru-group.fi>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 37F8B431FAF\r
+       for <notmuch@notmuchmail.org>; Sun, 21 Oct 2012 06:20:43 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
+       autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id VtBVXSLvaXmn for <notmuch@notmuchmail.org>;\r
+       Sun, 21 Oct 2012 06:20:42 -0700 (PDT)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+       by olra.theworths.org (Postfix) with ESMTP id F0BBB431FAE\r
+       for <notmuch@notmuchmail.org>; Sun, 21 Oct 2012 06:20:41 -0700 (PDT)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+       id D6345100372; Sun, 21 Oct 2012 16:20:44 +0300 (EEST)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 1/1] emacs/notmuch-show.el: handle bodypart insert error\r
+Date: Sun, 21 Oct 2012 16:20:42 +0300\r
+Message-Id: <1350825642-11652-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 1.7.1\r
+Cc: tomi.ollila@iki.fi\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 21 Oct 2012 13:20:43 -0000\r
+\r
+When inserting of email bodypart failes, insert a failure message\r
+to the buffer (and continue) instead of halting the insertion of\r
+the rest of that email thread in question.\r
+---\r
+\r
+This is alternative to \r
+\r
+id:"1350824336-11060-1-git-send-email-tomi.ollila@iki.fi"\r
+\r
+This adds error message string to the output, error message in\r
+id:"87d31artti.fsf@inf-8657.int-evry.fr" is shown as\r
+\r
+  !!! bodypart insert error: Wrong type argument: stringp, nil !!!\r
+\r
+See id:"1350824336-11060-1-git-send-email-tomi.ollila@iki.fi"\r
+for more discussion.\r
+\r
+ emacs/notmuch-show.el |    4 +++-\r
+ 1 files changed, 3 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index f273eb4..651a5ee 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -815,7 +815,9 @@ message at DEPTH in the current thread."\r
+     ;; Run the content handlers until one of them returns a non-nil\r
+     ;; value.\r
+     (while (and handlers\r
+-              (not (funcall (car handlers) msg part content-type nth depth declared-type)))\r
++              (not (condition-case nil\r
++                       (funcall (car handlers) msg part content-type nth depth declared-type)\r
++                     (error (progn (insert "!!! bodypart insert error !!!\n") nil)))))\r
+       (setq handlers (cdr handlers))))\r
+   t)\r
+ \r
+-- \r
+1.7.1\r
+\r