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 3812F429E34 for ; Thu, 22 Aug 2013 10:10:40 -0700 (PDT) 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 NqRQX-BaXTxD for ; Thu, 22 Aug 2013 10:10:34 -0700 (PDT) Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com [74.125.82.43]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 2DDEA431FC4 for ; Thu, 22 Aug 2013 10:10:34 -0700 (PDT) Received: by mail-wg0-f43.google.com with SMTP id z12so1895251wgg.22 for ; Thu, 22 Aug 2013 10:10:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ER/JPS+bch1EHRerTB5t6hFWxmz5YcXbqvv8zEJwtLE=; b=bchxadbWwBtCNTD+kpl16ewsiqhXuhaC3L8NTghZkU8G8j5g70IRT5pwD3DyPNA2MZ qPpNmHOc3+jxLW8I0RGDdK97h2imCH0uhTLIxFY/yQ3r0NP9N12O1Z081ZcyL1GHHdOi +qp1v8iKr8P3M+kqg+EtQomku9jWYpQeodOQJo/0rPDh/MFUNRtp2Eh7XMeE/v7jU1nR PGO/bq+Cp/rwM8kgIdUUHjehVhwfwIjTktr4S/Oap15hsSEgorpvp2PCwXlbvdGMWa54 71LPsJSLN8quA5GrAHFvfjJwHrzE2SZPgdmfn00xJ8OKlaRV+2+Nem42gH/clQ0dsxHN WQqQ== X-Received: by 10.180.19.196 with SMTP id h4mr10563675wie.38.1377191432997; Thu, 22 Aug 2013 10:10:32 -0700 (PDT) Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) by mx.google.com with ESMTPSA id i5sm39986792wiw.7.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 22 Aug 2013 10:10:32 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH v3 01/11] contrib: pick: override notmuch-show-get-prop Date: Thu, 22 Aug 2013 18:10:16 +0100 Message-Id: <1377191427-6821-2-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1377191427-6821-1-git-send-email-markwalters1009@gmail.com> References: <1377191427-6821-1-git-send-email-markwalters1009@gmail.com> 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: Thu, 22 Aug 2013 17:10:40 -0000 We override notmuch-show-get-prop so that many of the show functions can be used in notmuch-pick without modification. The main use is that it means notmuch-show-get-message-id `works' in pick. Thus we get all the stash functions and several other `for free' in pick. --- contrib/notmuch-pick/notmuch-pick.el | 16 ++++++++++++++++ 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el index 7f5f729..04e37ee 100644 --- a/contrib/notmuch-pick/notmuch-pick.el +++ b/contrib/notmuch-pick/notmuch-pick.el @@ -238,6 +238,22 @@ Some useful entries are: (beginning-of-line) (get-text-property (point) :notmuch-message-properties))) +;; XXX This should really be a lib function but we are trying to +;; reduce impact on the code base. +(defun notmuch-show-get-prop (prop &optional props) + "This is a pick overridden version of notmuch-show-get-prop + +It gets property PROP from PROPS or, if PROPS is nil, the current +message in either pick or show. This means that several functions +in notmuch-show now work unchanged in pick as they just need the +correct message properties." + (let ((props (or props + (cond ((eq major-mode 'notmuch-show-mode) + (notmuch-show-get-message-properties)) + ((eq major-mode 'notmuch-pick-mode) + (notmuch-pick-get-message-properties)))))) + (plist-get props prop))) + (defun notmuch-pick-set-message-properties (props) (save-excursion (beginning-of-line) -- 1.7.9.1