--- /dev/null
+Return-Path: <markwalters1009@gmail.com>\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 CC6B8431FB6\r
+ for <notmuch@notmuchmail.org>; Wed, 5 Dec 2012 04:21:03 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+ tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+ RCVD_IN_DNSWL_LOW=-0.7] 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 z5bhWemH7e1m for <notmuch@notmuchmail.org>;\r
+ Wed, 5 Dec 2012 04:21:03 -0800 (PST)\r
+Received: from mail-we0-f181.google.com (mail-we0-f181.google.com\r
+ [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 40EA6431FAE\r
+ for <notmuch@notmuchmail.org>; Wed, 5 Dec 2012 04:21:03 -0800 (PST)\r
+Received: by mail-we0-f181.google.com with SMTP id t11so2420926wey.26\r
+ for <notmuch@notmuchmail.org>; Wed, 05 Dec 2012 04:21:02 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+ bh=PcigKZ42vJY/21M838jqdFbDFDn0yz86MNUYB3m9tvA=;\r
+ b=j8xNiFGl4EUo+nHhjgPtb/Eos7yE+QIBsRF75ko+FHLGBNGGOxYrGVEdtm6iqt+Y3N\r
+ yDRj5KT8wulu3BnLkhwO08bjZ0lW9jOgOgTxHHttONcZYWKzqeQfWfmpMv50n7Vt5Oos\r
+ ltlTTzR4nShfUaNnz6O2G2oLyI+qnXialSpcUH2X7FT5WbCl+B6MVOaa15PgEK6PdZp7\r
+ ndpU4rgsvk6EmCuFfcFpReRi/8OWj6GAF1n9czOul+JqA7pb3JYPSv+njZKCVmv9M4V5\r
+ ZDWuwyVFdPNKDx423Qck1GeXIqLZtq/CdQj7Q3imfDvaj1EFN4a99uat1YNmFaXmggGc\r
+ PMRQ==\r
+Received: by 10.180.85.194 with SMTP id j2mr2860308wiz.12.1354710062152;\r
+ Wed, 05 Dec 2012 04:21:02 -0800 (PST)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+ by mx.google.com with ESMTPS id p2sm6170537wic.7.2012.12.05.04.21.00\r
+ (version=TLSv1/SSLv3 cipher=OTHER);\r
+ Wed, 05 Dec 2012 04:21:01 -0800 (PST)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2] emacs: stash bugfix\r
+Date: Wed, 5 Dec 2012 12:20:54 +0000\r
+Message-Id: <1354710054-23093-1-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <20121203152015.GD1020@mit.edu>\r
+References: <20121203152015.GD1020@mit.edu>\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: Wed, 05 Dec 2012 12:21:03 -0000\r
+\r
+Currently an attempt to stash a non-existent field (eg cc when not\r
+present) throws an error. Catch this case and give the user a warning\r
+message.\r
+---\r
+\r
+This fixes the comment and stashes an empty string in the\r
+case there is nothing to stash (both suggested by Austin).\r
+\r
+\r
+ emacs/notmuch-lib.el | 10 ++++++++--\r
+ 1 files changed, 8 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el\r
+index 1d0ec17..5c44867 100644\r
+--- a/emacs/notmuch-lib.el\r
++++ b/emacs/notmuch-lib.el\r
+@@ -183,8 +183,14 @@ user-friendly queries."\r
+ \r
+ (defun notmuch-common-do-stash (text)\r
+ "Common function to stash text in kill ring, and display in minibuffer."\r
+- (kill-new text)\r
+- (message "Stashed: %s" text))\r
++ (if text\r
++ (progn\r
++ (kill-new text)\r
++ (message "Stashed: %s" text))\r
++ ;; There is nothing to stash so stash an empty string so the user\r
++ ;; doesn't accidentally paste something else somewhere.\r
++ (kill-new "")\r
++ (message "Nothing to stash!")))\r
+ \r
+ ;;\r
+ \r
+-- \r
+1.7.9.1\r
+\r