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 D18F6431FB6 for ; Sun, 2 Dec 2012 17:34:06 -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 heKTOQphOUnA for ; Sun, 2 Dec 2012 17:34:06 -0800 (PST) Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU [18.9.25.12]) by olra.theworths.org (Postfix) with ESMTP id E1BD4431FAE for ; Sun, 2 Dec 2012 17:34:05 -0800 (PST) X-AuditID: 1209190c-b7f886d000000936-36-50bc018c9af6 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP id 5B.A6.02358.C810CB05; Sun, 2 Dec 2012 20:34:04 -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 qB31Y4pK016383; Sun, 2 Dec 2012 20:34:04 -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 qB31Y2cC015358 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); Sun, 2 Dec 2012 20:34:03 -0500 (EST) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80) (envelope-from ) id 1TfKv4-0006dd-EH; Sun, 02 Dec 2012 20:34:02 -0500 Date: Sun, 2 Dec 2012 20:34:02 -0500 From: Austin Clements To: Mark Walters Subject: Re: [PATCH] emacs: stash bugfix Message-ID: <20121203013402.GC1020@mit.edu> References: <1354443068-5030-1-git-send-email-markwalters1009@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1354443068-5030-1-git-send-email-markwalters1009@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpileLIzCtJLcpLzFFi42IRYrdT0e1h3BNgsHSDtcXquTwW12/OZHZg 8tg56y67x7NVt5gDmKK4bFJSczLLUov07RK4Mt5P3s9U8ICjYvauRSwNjK/Zuhg5OSQETCTa tp5hh7DFJC7cWw8U5+IQEtjHKLFn4lQWCGc9o8StB39ZIZwLTBILJ2+GyixhlPg8+yCQw8HB IqAisbNRCWQUm4CGxLb9yxlBbBEBHYnbhxaArWAWkJb49ruZCcQWBqo5fukG2Bm8AtoSU7es BosLCXhIdG05wA4RF5Q4OfMJC0SvlsSNfy+ZQFaBzFn+jwMkzCngKXHnXBtYqyjQBVNObmOb wCg0C0n3LCTdsxC6FzAyr2KUTcmt0s1NzMwpTk3WLU5OzMtLLdI11MvNLNFLTSndxAgKak5J nh2Mbw4qHWIU4GBU4uF98GV3gBBrYllxZe4hRkkOJiVRXrP/QCG+pPyUyozE4oz4otKc1OJD jBIczEoivIsrgHK8KYmVValF+TApaQ4WJXHeyyk3/YUE0hNLUrNTUwtSi2CyMhwcShK8eQx7 AoQEi1LTUyvSMnNKENJMHJwgw3mAhrMCk4AQb3FBYm5xZjpE/hSjopQ470yQZgGQREZpHlwv LOm8YhQHekWYdy9IFQ8wYcF1vwIazAQ0+IUQyNXFJYkIKakGRr2Cs/N6Q39FSHy1Wylxye3j X910zj8vXHRT1+6TNmPfq5J8jcfw0OfIGULbypY+bi1sEHj1Sypt54u65Dti9vU2vHHh+mtT Na5KFa3yMD16RjEkXT1v96esd1UfV87f9Vs35+CaqJp5jPxOR+sb7Sdnzc++GtMyK6Anzc6C 2TLw1wHHvZdXKrEUZyQaajEXFScCAOUkencVAwAA Cc: notmuch@notmuchmail.org 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: Mon, 03 Dec 2012 01:34:07 -0000 Quoth Mark Walters on Dec 02 at 10:11 am: > 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. > > --- > While messing around with notmuch-pick key bindings I found the > following bug. The easiest way I have found to trigger it is cc > (stash-cc) in show mode on a message with no cc header. > > Best wishes > > Mark > > emacs/notmuch-lib.el | 7 +++++-- > 1 files changed, 5 insertions(+), 2 deletions(-) > > diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el > index 1d0ec17..c7d8e02 100644 > --- a/emacs/notmuch-lib.el > +++ b/emacs/notmuch-lib.el > @@ -183,8 +183,11 @@ 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)) > + (message "Warning: Nothing to stash!"))) Without the unnecessary "Warning:" bit of the message, LGTM.