[PATCH v3 01/11] contrib: pick: override notmuch-show-get-prop
authorMark Walters <markwalters1009@gmail.com>
Thu, 22 Aug 2013 17:10:16 +0000 (18:10 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:56:32 +0000 (09:56 -0800)
26/c05177aaaa8dc0b75aeca04019bf3a8b010594 [new file with mode: 0644]

diff --git a/26/c05177aaaa8dc0b75aeca04019bf3a8b010594 b/26/c05177aaaa8dc0b75aeca04019bf3a8b010594
new file mode 100644 (file)
index 0000000..98057a1
--- /dev/null
@@ -0,0 +1,100 @@
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 3812F429E34\r
+       for <notmuch@notmuchmail.org>; Thu, 22 Aug 2013 10:10:40 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.201\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.201 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001,\r
+       RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id NqRQX-BaXTxD for <notmuch@notmuchmail.org>;\r
+       Thu, 22 Aug 2013 10:10:34 -0700 (PDT)\r
+Received: from mail-wg0-f43.google.com (mail-wg0-f43.google.com\r
+ [74.125.82.43])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ 2DDEA431FC4   for <notmuch@notmuchmail.org>; Thu, 22 Aug 2013 10:10:34 -0700\r
+ (PDT)\r
+Received: by mail-wg0-f43.google.com with SMTP id z12so1895251wgg.22\r
+       for <notmuch@notmuchmail.org>; Thu, 22 Aug 2013 10:10:33 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:cc:subject:date:message-id:in-reply-to:references;\r
+       bh=ER/JPS+bch1EHRerTB5t6hFWxmz5YcXbqvv8zEJwtLE=;\r
+       b=bchxadbWwBtCNTD+kpl16ewsiqhXuhaC3L8NTghZkU8G8j5g70IRT5pwD3DyPNA2MZ\r
+       qPpNmHOc3+jxLW8I0RGDdK97h2imCH0uhTLIxFY/yQ3r0NP9N12O1Z081ZcyL1GHHdOi\r
+       +qp1v8iKr8P3M+kqg+EtQomku9jWYpQeodOQJo/0rPDh/MFUNRtp2Eh7XMeE/v7jU1nR\r
+       PGO/bq+Cp/rwM8kgIdUUHjehVhwfwIjTktr4S/Oap15hsSEgorpvp2PCwXlbvdGMWa54\r
+       71LPsJSLN8quA5GrAHFvfjJwHrzE2SZPgdmfn00xJ8OKlaRV+2+Nem42gH/clQ0dsxHN\r
+       WQqQ==\r
+X-Received: by 10.180.19.196 with SMTP id h4mr10563675wie.38.1377191432997;\r
+       Thu, 22 Aug 2013 10:10:32 -0700 (PDT)\r
+Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31])\r
+       by mx.google.com with ESMTPSA id i5sm39986792wiw.7.1969.12.31.16.00.00\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Thu, 22 Aug 2013 10:10:32 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v3 01/11] contrib: pick: override notmuch-show-get-prop\r
+Date: Thu, 22 Aug 2013 18:10:16 +0100\r
+Message-Id: <1377191427-6821-2-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1377191427-6821-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1377191427-6821-1-git-send-email-markwalters1009@gmail.com>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Thu, 22 Aug 2013 17:10:40 -0000\r
+\r
+We override notmuch-show-get-prop so that many of the show functions\r
+can be used in notmuch-pick without modification. The main use is that\r
+it means notmuch-show-get-message-id `works' in pick. Thus we get all\r
+the stash functions and several other `for free' in pick.\r
+---\r
+ contrib/notmuch-pick/notmuch-pick.el |   16 ++++++++++++++++\r
+ 1 files changed, 16 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el\r
+index 7f5f729..04e37ee 100644\r
+--- a/contrib/notmuch-pick/notmuch-pick.el\r
++++ b/contrib/notmuch-pick/notmuch-pick.el\r
+@@ -238,6 +238,22 @@ Some useful entries are:\r
+     (beginning-of-line)\r
+     (get-text-property (point) :notmuch-message-properties)))\r
\r
++;; XXX This should really be a lib function but we are trying to\r
++;; reduce impact on the code base.\r
++(defun notmuch-show-get-prop (prop &optional props)\r
++  "This is a pick overridden version of notmuch-show-get-prop\r
++\r
++It gets property PROP from PROPS or, if PROPS is nil, the current\r
++message in either pick or show. This means that several functions\r
++in notmuch-show now work unchanged in pick as they just need the\r
++correct message properties."\r
++  (let ((props (or props\r
++                 (cond ((eq major-mode 'notmuch-show-mode)\r
++                        (notmuch-show-get-message-properties))\r
++                       ((eq major-mode 'notmuch-pick-mode)\r
++                        (notmuch-pick-get-message-properties))))))\r
++    (plist-get props prop)))\r
++\r
+ (defun notmuch-pick-set-message-properties (props)\r
+   (save-excursion\r
+     (beginning-of-line)\r
+-- \r
+1.7.9.1\r
+\r