[PATCH 01/11] contrib: pick: override notmuch-show-get-prop
[notmuch-archives.git] / 6e / a6646e8e3ea78ab0d6e1ffa2a9901cd6bf9fd2
diff --git a/6e/a6646e8e3ea78ab0d6e1ffa2a9901cd6bf9fd2 b/6e/a6646e8e3ea78ab0d6e1ffa2a9901cd6bf9fd2
new file mode 100644 (file)
index 0000000..5c55ff7
--- /dev/null
@@ -0,0 +1,101 @@
+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 254BC431FAE\r
+       for <notmuch@notmuchmail.org>; Fri,  5 Jul 2013 11:11:35 -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 OGQm-fmNiski for <notmuch@notmuchmail.org>;\r
+       Fri,  5 Jul 2013 11:11:27 -0700 (PDT)\r
+Received: from mail-ea0-f177.google.com (mail-ea0-f177.google.com\r
+       [209.85.215.177]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 794A0431FBC\r
+       for <notmuch@notmuchmail.org>; Fri,  5 Jul 2013 11:11:27 -0700 (PDT)\r
+Received: by mail-ea0-f177.google.com with SMTP id j14so1610113eak.36\r
+       for <notmuch@notmuchmail.org>; Fri, 05 Jul 2013 11:11:26 -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:x-mailer:in-reply-to:references;\r
+       bh=GGz13JsJHsZgBWvQ8vXZi/SQtYU43NSHI2r6oKMiaVo=;\r
+       b=KEey9gJkKT5MqWtlTK4sWt5pqfAEArIeJbkYUYn9yAF3pcNGzJVCEq0/8j/nT2vYEc\r
+       j/eXnSi3MV8qHoYcNC3Y0yjJVvahg92DY0X/qjrXX8zandNjgdCvSP8oHn6nii5emoFa\r
+       Ew8kBtcM13POrAIVei9C1Q4vVrUVQNdldzMVHmPJtnzNEZK8gOJTXFDAKlwFFtfDy+jM\r
+       zYAKs8ja5qNubJsQAp6BwM75U35Hmie3TwC8wCxg7038dFeLknydZPNjYDKXrlQti8oL\r
+       4zBRqAoZfAEppZDt9ZzqOcaoOyVDFMBjk/ptzfeGyTsiMLy5/s/bZQZxdeHtnaqQEyoQ\r
+       +xzQ==\r
+X-Received: by 10.15.34.77 with SMTP id d53mr13345124eev.95.1373047886320;\r
+       Fri, 05 Jul 2013 11:11:26 -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 a4sm16046387eez.0.2013.07.05.11.11.25\r
+       for <multiple recipients>\r
+       (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
+       Fri, 05 Jul 2013 11:11:25 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 01/11] contrib: pick: override notmuch-show-get-prop\r
+Date: Fri,  5 Jul 2013 19:11:08 +0100\r
+Message-Id: <1373047878-20822-2-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 1.7.9.1\r
+In-Reply-To: <1373047878-20822-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1373047878-20822-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: Fri, 05 Jul 2013 18:11:35 -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 fbd7c0b..d07f393 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
++;; This should really be a lib function but we are trying to reduce\r
++;; 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