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 254BC431FAE for ; Fri, 5 Jul 2013 11:11:35 -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 OGQm-fmNiski for ; Fri, 5 Jul 2013 11:11:27 -0700 (PDT) Received: from mail-ea0-f177.google.com (mail-ea0-f177.google.com [209.85.215.177]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 794A0431FBC for ; Fri, 5 Jul 2013 11:11:27 -0700 (PDT) Received: by mail-ea0-f177.google.com with SMTP id j14so1610113eak.36 for ; Fri, 05 Jul 2013 11:11:26 -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:x-mailer:in-reply-to:references; bh=GGz13JsJHsZgBWvQ8vXZi/SQtYU43NSHI2r6oKMiaVo=; b=KEey9gJkKT5MqWtlTK4sWt5pqfAEArIeJbkYUYn9yAF3pcNGzJVCEq0/8j/nT2vYEc j/eXnSi3MV8qHoYcNC3Y0yjJVvahg92DY0X/qjrXX8zandNjgdCvSP8oHn6nii5emoFa Ew8kBtcM13POrAIVei9C1Q4vVrUVQNdldzMVHmPJtnzNEZK8gOJTXFDAKlwFFtfDy+jM zYAKs8ja5qNubJsQAp6BwM75U35Hmie3TwC8wCxg7038dFeLknydZPNjYDKXrlQti8oL 4zBRqAoZfAEppZDt9ZzqOcaoOyVDFMBjk/ptzfeGyTsiMLy5/s/bZQZxdeHtnaqQEyoQ +xzQ== X-Received: by 10.15.34.77 with SMTP id d53mr13345124eev.95.1373047886320; Fri, 05 Jul 2013 11:11:26 -0700 (PDT) Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) by mx.google.com with ESMTPSA id a4sm16046387eez.0.2013.07.05.11.11.25 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 05 Jul 2013 11:11:25 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH 01/11] contrib: pick: override notmuch-show-get-prop Date: Fri, 5 Jul 2013 19:11:08 +0100 Message-Id: <1373047878-20822-2-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.9.1 In-Reply-To: <1373047878-20822-1-git-send-email-markwalters1009@gmail.com> References: <1373047878-20822-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: Fri, 05 Jul 2013 18:11:35 -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 fbd7c0b..d07f393 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))) +;; 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