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 3A2F5431FAF for ; Sun, 2 Dec 2012 02:11:15 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 0.201 X-Spam-Level: X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, 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 OQHCU0M+gbPm for ; Sun, 2 Dec 2012 02:11:14 -0800 (PST) Received: from mail-we0-f181.google.com (mail-we0-f181.google.com [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id ABE7A431FAE for ; Sun, 2 Dec 2012 02:11:14 -0800 (PST) Received: by mail-we0-f181.google.com with SMTP id t11so851520wey.26 for ; Sun, 02 Dec 2012 02:11:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=3ymxTMJP7uRdSAq+Abd7TPtRGMDJtV32j4aZPjvYiWM=; b=AgwAWioqE8szHien4GQG+vl1NqveI9IM6CdKQcZbyMQx3xpFDGpjacdQJad7RAOQ6x mWLkgaiKg8xvgwmEtFXzk/KJy/oLvUx++Kcik7Ly50yyw9eQ80UyCEUer95TsC0sb+jo oSbc51E9+hEID05PiRKqSPGo8OfDoB5cU83JwzA9/MUt5xHiirNZcvvG8lhAEkHxhe/4 u6t6uuhWMPQtl9lEL5usDEiu97WcBUuWKyGnNkBRAYY/yOblzDGElfAWNUNwOhz7n/t9 hMnPqDs1nFeqkQJbV4ZEln3VETH9Zim2fv3vrLNtcdEvyoQPR5CzCLmWCdxT4GVuu83P TjsA== Received: by 10.216.70.70 with SMTP id o48mr2335581wed.59.1354443072043; Sun, 02 Dec 2012 02:11:12 -0800 (PST) Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) by mx.google.com with ESMTPS id i2sm6243272wiw.3.2012.12.02.02.11.09 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 02 Dec 2012 02:11:10 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH] emacs: stash bugfix Date: Sun, 2 Dec 2012 10:11:08 +0000 Message-Id: <1354443068-5030-1-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 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 10:11:15 -0000 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!"))) ;; -- 1.7.9.1