From dda74250bfb1336d5c33ff48b7eeea89fd55d1ee Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Mon, 3 Dec 2012 09:27:57 +0000 Subject: [PATCH] Re: [PATCH] emacs: stash bugfix --- 93/4c6bc28b54390a566307bea67391f75f342309 | 120 ++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 93/4c6bc28b54390a566307bea67391f75f342309 diff --git a/93/4c6bc28b54390a566307bea67391f75f342309 b/93/4c6bc28b54390a566307bea67391f75f342309 new file mode 100644 index 000000000..2149ac452 --- /dev/null +++ b/93/4c6bc28b54390a566307bea67391f75f342309 @@ -0,0 +1,120 @@ +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 AC738431FB6 + for ; Mon, 3 Dec 2012 01:28:02 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -1.098 +X-Spam-Level: +X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 kTOv39+p1ytV for ; + Mon, 3 Dec 2012 01:28:02 -0800 (PST) +Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) + (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id BF016431FAE + for ; Mon, 3 Dec 2012 01:28:01 -0800 (PST) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1TfSJe-0005uU-W7; Mon, 03 Dec 2012 09:27:55 +0000 +Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) + (envelope-from ) + id 1TfSJe-0006HL-Jd; Mon, 03 Dec 2012 09:27:54 +0000 +From: Mark Walters +To: Austin Clements +Subject: Re: [PATCH] emacs: stash bugfix +In-Reply-To: <20121203013402.GC1020@mit.edu> +References: <1354443068-5030-1-git-send-email-markwalters1009@gmail.com> + <20121203013402.GC1020@mit.edu> +User-Agent: Notmuch/0.14+81~g9730584 (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Mon, 03 Dec 2012 09:27:57 +0000 +Message-ID: <87ehj71o4i.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Sender-Host-Address: 93.97.24.31 +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: c8fefd036ec0434acef57d560fb3d19d (of first 20000 bytes) +X-SpamAssassin-Score: -1.7 +X-SpamAssassin-SpamBar: - +X-SpamAssassin-Report: The QM spam filters have analysed this message to + determine if it is + spam. We require at least 5.0 points to mark a message as spam. + This message scored -1.7 points. + Summary of the scoring: + * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, + * medium trust + * [138.37.6.40 listed in list.dnswl.org] + * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail + provider * (markwalters1009[at]gmail.com) + * 0.6 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +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 09:28:02 -0000 + + +On Mon, 03 Dec 2012, Austin Clements wrote: +> 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. + +I am obviously happy to remove the "warning": however do you think +stashing a non-existent thing should empty the kill-ring? I am a little +worried about someone stashing something, not noticing the "nothing to +stash" and then pasting some random thing somewhere (eg something +private into irc). + +Best wishes + +Mark -- 2.26.2