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 D4058431FAF for ; Sun, 2 Dec 2012 03:04:18 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] 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 yjcOI85dVBND for ; Sun, 2 Dec 2012 03:04:14 -0800 (PST) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id 965E8431FAE for ; Sun, 2 Dec 2012 03:04:14 -0800 (PST) Received: from guru.guru-group.fi (localhost [IPv6:::1]) by guru.guru-group.fi (Postfix) with ESMTP id 423F4100045; Sun, 2 Dec 2012 13:04:10 +0200 (EET) From: Tomi Ollila To: Mark Walters , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: stash bugfix In-Reply-To: <1354443068-5030-1-git-send-email-markwalters1009@gmail.com> References: <1354443068-5030-1-git-send-email-markwalters1009@gmail.com> User-Agent: Notmuch/0.14+116~g29fcdb5 (http://notmuchmail.org) Emacs/24.2.1 (x86_64-unknown-linux-gnu) X-Face: HhBM'cA~ MIME-Version: 1.0 Content-Type: text/plain 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: Sun, 02 Dec 2012 11:04:19 -0000 On Sun, Dec 02 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. > > --- LGTM. Tomi > 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!"))) > > ;; > > -- > 1.7.9.1 > > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch