From 1dc211802a0d316f88bbd76a3bf5a6928263a83e Mon Sep 17 00:00:00 2001 From: Austin Clements Date: Thu, 6 Dec 2012 11:01:28 +1900 Subject: [PATCH] Re: [PATCH v2] emacs: stash bugfix --- 07/99acb30ace0224fa59dfebf2343e6186111d91 | 119 ++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 07/99acb30ace0224fa59dfebf2343e6186111d91 diff --git a/07/99acb30ace0224fa59dfebf2343e6186111d91 b/07/99acb30ace0224fa59dfebf2343e6186111d91 new file mode 100644 index 000000000..0c8484dd5 --- /dev/null +++ b/07/99acb30ace0224fa59dfebf2343e6186111d91 @@ -0,0 +1,119 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 4F8F6431FB6 + for ; Wed, 5 Dec 2012 08:01:35 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id 6YZJK8xXO63M for ; + Wed, 5 Dec 2012 08:01:31 -0800 (PST) +Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU + [18.7.68.36]) + by olra.theworths.org (Postfix) with ESMTP id 7BCC4431FAE + for ; Wed, 5 Dec 2012 08:01:31 -0800 (PST) +X-AuditID: 12074424-b7fe06d0000008f0-6b-50bf6fdb29b1 +Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) + by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP + id 4B.5C.02288.BDF6FB05; Wed, 5 Dec 2012 11:01:31 -0500 (EST) +Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) + by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id qB5G1Um6001379; + Wed, 5 Dec 2012 11:01:30 -0500 +Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) + (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id qB5G1SQW004559 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); + Wed, 5 Dec 2012 11:01:29 -0500 (EST) +Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80) + (envelope-from ) + id 1TgHPc-0007v9-D7; Wed, 05 Dec 2012 11:01:28 -0500 +From: Austin Clements +To: Mark Walters , notmuch@notmuchmail.org +Subject: Re: [PATCH v2] emacs: stash bugfix +In-Reply-To: <1354710054-23093-1-git-send-email-markwalters1009@gmail.com> +References: <20121203152015.GD1020@mit.edu> + <1354710054-23093-1-git-send-email-markwalters1009@gmail.com> +User-Agent: Notmuch/0.14+100~gcb9b0b0 (http://notmuchmail.org) Emacs/23.4.1 + (i486-pc-linux-gnu) +Date: Wed, 05 Dec 2012 11:01:28 -0500 +Message-ID: <87k3swcwtj.fsf@awakening.csail.mit.edu> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFrrDIsWRmVeSWpSXmKPExsUixG6nons7f3+AwfNzLBar5/JYXL85k9mB + yWPnrLvsHs9W3WIOYIrisklJzcksSy3St0vgyjj77yprwQ6uioabn9kbGOdxdDFycEgImEg8 + PQNkcgKZYhIX7q1n62Lk4hAS2Mco8fLFamYIZz2jxKarV9hAqoQELjBJ/J5cBZFYwiixqHMa + I0iCTUBfYsXaSawgtoiAq8TTb5+ZQWxhAW2JY+vfs4PYnAJeEs/WrGeHGJQp8Wn/XWaQK0QF + 4iUuL1UAMVkEVCU+rzYEMXmBbru5xxikmFdAUOLkzCcsIDazgJbEjX8vmSYwCsxCkpqFJLWA + kWkVo2xKbpVubmJmTnFqsm5xcmJeXmqRrrlebmaJXmpK6SZGcCC6qOxgbD6kdIhRgINRiYdX + wnhfgBBrYllxZe4hRkkOJiVR3p+5+wOE+JLyUyozEosz4otKc1KLDzFKcDArifAW+wHleFMS + K6tSi/JhUtIcLErivNdTbvoLCaQnlqRmp6YWpBbBZGU4OJQkeB3zgBoFi1LTUyvSMnNKENJM + HJwgw3mAhseB1PAWFyTmFmemQ+RPMSpKifOGgCQEQBIZpXlwvbBE8YpRHOgVYd5QkCoeYJKB + 634FNJgJaHAUO9jgkkSElFQDIyt3Hpv9t0NsjEZvnso3/Tie4pG0/2fkwqBdZ5RfcjcY6Kzg + Pt0iGs/1+eiD9JyIuJNlR7ZbG+40uB3F/uCLKbN04+p7bVtCDHMlHvYzcSjpzrikVuO8iK/C + fdqUZQpO/ntMJFNYuMpskpaltyow70wvD7OLfrTD2E5gw1TrnVxbWreWrBNXYinOSDTUYi4q + TgQASGxMfO8CAAA= +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Wed, 05 Dec 2012 16:01:35 -0000 + +LGTM. + +On Wed, 05 Dec 2012, Mark Walters wrote: +> Currently an attempt to stash a non-existent field (eg cc when not +> present) throws an error. Catch this case and give the user a warning +> message. +> --- +> +> This fixes the comment and stashes an empty string in the +> case there is nothing to stash (both suggested by Austin). +> +> +> emacs/notmuch-lib.el | 10 ++++++++-- +> 1 files changed, 8 insertions(+), 2 deletions(-) +> +> diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el +> index 1d0ec17..5c44867 100644 +> --- a/emacs/notmuch-lib.el +> +++ b/emacs/notmuch-lib.el +> @@ -183,8 +183,14 @@ user-friendly queries." +> +> (defun notmuch-common-do-stash (text) +> "Common function to stash text in kill ring, and display in minibuffer." +> - (kill-new text) +> - (message "Stashed: %s" text)) +> + (if text +> + (progn +> + (kill-new text) +> + (message "Stashed: %s" text)) +> + ;; There is nothing to stash so stash an empty string so the user +> + ;; doesn't accidentally paste something else somewhere. +> + (kill-new "") +> + (message "Nothing to stash!"))) +> +> ;; +> +> -- +> 1.7.9.1 +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2