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 1CF97431FB6 for ; Sat, 10 Nov 2012 09:02:21 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 2.7 X-Spam-Level: ** X-Spam-Status: No, score=2.7 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, FREEMAIL_REPLY=2.499, 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 seGkCylElSPg for ; Sat, 10 Nov 2012 09:02:20 -0800 (PST) Received: from mail-wg0-f45.google.com (mail-wg0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 830AB431FAF for ; Sat, 10 Nov 2012 09:02:20 -0800 (PST) Received: by mail-wg0-f45.google.com with SMTP id dq12so2695379wgb.2 for ; Sat, 10 Nov 2012 09:02:19 -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=7A/lHek2vsIdmV1nspVjYl+xcftSvsTarNacOd/HEAg=; b=tV4b25m9ngk4Wx+Qu4xEe/GU6jusd+nRbybYqFdozfrcIgf34Iw5zp2gBYom13ViYP 4s6m3Od8DFNDwjc9hwJNBLbQlNRIeg4pxluZN23C7N1aSC1P8h29MTQs7gcyyK4KYdKK fVGIb8a8l4H3oDi3WctAe8E389eG8wEupzvHv6FRyXDG4JLiiPjLBjR9cI2uq2F+GqYP O+M9FUyWI0gGmXlNJGc4zZQQztOA5htRhlJqCUYgmxshea/sgfW6VQmWtjwtOggUpZDa UONnB46/pZpU5/F2p+kHFFWKb67dJKWRFUPDpojZxB4wzfcYzVruAJ6+T9Y51U4VRyXK ulDQ== Received: by 10.180.84.101 with SMTP id x5mr4883283wiy.18.1352566939273; Sat, 10 Nov 2012 09:02:19 -0800 (PST) Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) by mx.google.com with ESMTPS id ey2sm3116666wib.9.2012.11.10.09.02.17 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 10 Nov 2012 09:02:18 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH v3] contrib: pick: bugfix when trying to show a non-message Date: Sat, 10 Nov 2012 17:02:18 +0000 Message-Id: <1352566938-12473-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: Sat, 10 Nov 2012 17:02:21 -0000 If the user pressed return on the end result status line it gave a blank message. Modify the function notmuch-pick-get-message-id to return nil rather than an empty message-id in this case to fix this. This also fixes a bug in the (lack of) quoting of the id string. --- v2 is at id:1352562350-8219-1-git-send-email-markwalters1009@gmail.com As suggested by bremner make the nil return from the if clause explicit (as that is the point of the change). contrib/notmuch-pick/notmuch-pick.el | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index 15ac5e8..4db9632 100644 --- a/contrib/notmuch-pick/notmuch-pick.el +++ b/contrib/notmuch-pick/notmuch-pick.el @@ -241,7 +241,10 @@ Some useful entries are: (defun notmuch-pick-get-message-id () "Return the message id of the current message." - (concat "id:\"" (notmuch-pick-get-prop :id) "\"")) + (let ((id (notmuch-pick-get-prop :id))) + (if id + (notmuch-id-to-query id) + nil))) (defun notmuch-pick-get-match () "Return whether the current message is a match." -- 1.7.9.1