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 2BAB2421163 for ; Sun, 18 Aug 2013 05:14:54 -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 ou5p4yOWf59o for ; Sun, 18 Aug 2013 05:14:48 -0700 (PDT) Received: from mail-wi0-f169.google.com (mail-wi0-f169.google.com [209.85.212.169]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id BB5E1431FD0 for ; Sun, 18 Aug 2013 05:14:47 -0700 (PDT) Received: by mail-wi0-f169.google.com with SMTP id f14so2902213wiw.2 for ; Sun, 18 Aug 2013 05:14:45 -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=MyZclYq9JQ4+Ty/d1TjybZMWUy77HXOv6zjKvYaHUt7ByhRNICzrtSmTI23p1tXGR1 9x+yuVrHINUEJsjceGlN5IVDd+jnL/wPGHmiqmEl1V8TuVCiGnj8SQ3q0Uqs0RIZqW1y 80QurVANsR0Uc4A3WYS+nXgordAc79GIYWnb4BWjPmZxA9Lq/XBQQTRDZDCB39eslKlS 9z7XYtWSwRfl/Phhq+AWQx+l3GkPKcZwzswN8txU5Xa511EFAE3L60uD8US6V0dqlnEO Trz3wNay8Sz9skaPXhwlRY0l/ai1XcK6BaC8pQETN9pVW1M8D4Pp/iHtU4FPaYwjmgxU u5xw== X-Received: by 10.194.123.199 with SMTP id mc7mr107828wjb.43.1376828085185; Sun, 18 Aug 2013 05:14:45 -0700 (PDT) Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) by mx.google.com with ESMTPSA id iz19sm9054786wic.9.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 18 Aug 2013 05:14:44 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH v2 01/11] contrib: pick: override notmuch-show-get-prop Date: Sun, 18 Aug 2013 13:14:29 +0100 Message-Id: <1376828079-21455-2-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1376828079-21455-1-git-send-email-markwalters1009@gmail.com> References: <1376828079-21455-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: Sun, 18 Aug 2013 12:14:54 -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