Re: [PATCH] emacs: show: make show-get-message-prop usable from pick
authorMark Walters <markwalters1009@gmail.com>
Mon, 3 Dec 2012 01:22:53 +0000 (01:22 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:51:22 +0000 (09:51 -0800)
40/d211da7434f28b7555d5aa9d2c36bd761bba48 [new file with mode: 0644]

diff --git a/40/d211da7434f28b7555d5aa9d2c36bd761bba48 b/40/d211da7434f28b7555d5aa9d2c36bd761bba48
new file mode 100644 (file)
index 0000000..d384286
--- /dev/null
@@ -0,0 +1,136 @@
+Return-Path: <m.walters@qmul.ac.uk>\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 76D12431FB6\r
+       for <notmuch@notmuchmail.org>; Sun,  2 Dec 2012 17:22:59 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.098\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
+       tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
+       NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 SZUcBBFEFbiR for <notmuch@notmuchmail.org>;\r
+       Sun,  2 Dec 2012 17:22:57 -0800 (PST)\r
+Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
+       (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id D7D88431FAE\r
+       for <notmuch@notmuchmail.org>; Sun,  2 Dec 2012 17:22:56 -0800 (PST)\r
+Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
+       by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
+       (envelope-from <m.walters@qmul.ac.uk>)\r
+       id 1TfKkH-000281-2U; Mon, 03 Dec 2012 01:22:53 +0000\r
+Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost)\r
+       by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69)\r
+       (envelope-from <m.walters@qmul.ac.uk>)\r
+       id 1TfKkG-000429-Nz; Mon, 03 Dec 2012 01:22:52 +0000\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] emacs: show: make show-get-message-prop usable from pick\r
+In-Reply-To: <1354486881-32456-1-git-send-email-markwalters1009@gmail.com>\r
+References: <1354483744-27541-1-git-send-email-markwalters1009@gmail.com>\r
+       <1354486881-32456-1-git-send-email-markwalters1009@gmail.com>\r
+User-Agent: Notmuch/0.14+81~g9730584 (http://notmuchmail.org) Emacs/23.4.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Mon, 03 Dec 2012 01:22:53 +0000\r
+Message-ID: <87ip8kszde.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Sender-Host-Address: 93.97.24.31\r
+X-QM-SPAM-Info: Sender has good ham record.  :)\r
+X-QM-Body-MD5: ba5ea7ff61b574f194e6c0f9eae19574 (of first 20000 bytes)\r
+X-SpamAssassin-Score: -1.7\r
+X-SpamAssassin-SpamBar: -\r
+X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
+       determine if it is\r
+       spam. We require at least 5.0 points to mark a message as spam.\r
+       This message scored -1.7 points.\r
+       Summary of the scoring: \r
+       * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\r
+       *      medium trust\r
+       *      [138.37.6.40 listed in list.dnswl.org]\r
+       * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
+       provider *      (markwalters1009[at]gmail.com)\r
+       *  0.6 AWL AWL: From: address is in the auto white-list\r
+X-QM-Scan-Virus: ClamAV says the message is clean\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: Mon, 03 Dec 2012 01:22:59 -0000\r
+\r
+\r
+Hi\r
+\r
+On Sun, 02 Dec 2012, Mark Walters <markwalters1009@gmail.com> wrote:\r
+> Make notmuch-show-get-prop choose the get-message-properties routine\r
+> based on the major mode. This make it usable from notmuch-pick and\r
+> thus a large number of functions are usable directly from\r
+> notmuch-show.el and do not need to be reimplemented in pick.\r
+> ---\r
+>\r
+> Ok so the previous version was me being stupid. I was wanting to avoid\r
+> errors caused by notmuch-pick-get-message-properties not existing but\r
+> the obvious solution is just to define it in a trivial fashion as\r
+> here.\r
+\r
+and to continue the stupidity the first hunk is no longer needed: it's\r
+just the second hunk now.\r
+\r
+MW\r
+\r
+>\r
+> Anyway would this be acceptable?\r
+>\r
+> Best wishes\r
+>\r
+> Mark\r
+>\r
+>\r
+>  emacs/notmuch-show.el |   10 +++++++++-\r
+>  1 files changed, 9 insertions(+), 1 deletions(-)\r
+>\r
+> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+> index 4d6c014..b7f64e3 100644\r
+> --- a/emacs/notmuch-show.el\r
+> +++ b/emacs/notmuch-show.el\r
+> @@ -1378,6 +1378,10 @@ Some useful entries are:\r
+>      (notmuch-show-move-to-message-top)\r
+>      (get-text-property (point) :notmuch-message-properties)))\r
+>  \r
+> +(defun notmuch-show-mode-get-message-properties ()\r
+> +  "Wrapper for notmuch-show-get-message-properties"\r
+> +  (notmuch-show-get-message-properties))\r
+> +\r
+>  (defun notmuch-show-set-prop (prop val &optional props)\r
+>    (let ((inhibit-read-only t)\r
+>      (props (or props\r
+> @@ -1385,9 +1389,13 @@ Some useful entries are:\r
+>      (plist-put props prop val)\r
+>      (notmuch-show-set-message-properties props)))\r
+>  \r
+> +(defun notmuch-pick-get-message-properties ())\r
+> +\r
+>  (defun notmuch-show-get-prop (prop &optional props)\r
+>    (let ((props (or props\r
+> -               (notmuch-show-get-message-properties))))\r
+> +               (if (eq major-mode 'notmuch-show-mode)\r
+> +                   (notmuch-show-get-message-properties)\r
+> +                 (notmuch-pick-get-message-properties)))))\r
+>      (plist-get props prop)))\r
+>  \r
+>  (defun notmuch-show-get-message-id (&optional bare)\r
+> -- \r
+> 1.7.9.1\r