From 33817f565be012f43cdcacedb3352627d213a76c Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sun, 2 Dec 2012 22:21:21 +0000 Subject: [PATCH] [PATCH] emacs: show: make show-get-message-prop usable from pick --- 81/6df545d0297e5f07f17d8be7a64cbe4f7c1bb3 | 116 ++++++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 81/6df545d0297e5f07f17d8be7a64cbe4f7c1bb3 diff --git a/81/6df545d0297e5f07f17d8be7a64cbe4f7c1bb3 b/81/6df545d0297e5f07f17d8be7a64cbe4f7c1bb3 new file mode 100644 index 000000000..869cc246b --- /dev/null +++ b/81/6df545d0297e5f07f17d8be7a64cbe4f7c1bb3 @@ -0,0 +1,116 @@ +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 36285431FB6 + for ; Sun, 2 Dec 2012 14:21:39 -0800 (PST) +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 n1jXLEIy-wK0 for ; + Sun, 2 Dec 2012 14:21:35 -0800 (PST) +Received: from mail-we0-f181.google.com (mail-we0-f181.google.com + [74.125.82.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id B83DA431FAE + for ; Sun, 2 Dec 2012 14:21:34 -0800 (PST) +Received: by mail-we0-f181.google.com with SMTP id t11so1057869wey.26 + for ; Sun, 02 Dec 2012 14:21:33 -0800 (PST) +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=tTvhuYdxToiYMJ0A4tBp+S87+m5odwo63xEndvqdsd4=; + b=AyCl75yEriKi6vbmacNVq5B5o0JNXUtF1s7HUCzQSL97dARgCFklVf6GrSo00Czbac + 6qwHJpFYyQ9AIhyEEjibmA8IwD3WmzYs1LpYjQjuFtmT4iZuRvmTFWGztgWIbWgkyXQS + yoo/XebWGU9dNeoL6UKfDSBSEho9frT08hk0ZOeBDacKfR8v4WmWT559A0jfXBlqMffv + YAt82s6OjKlyClLQNnS/9Sj1ymVlZxc3lDvADXrO6rhftLY5LsZIG0owQAVdlJXsa93w + CLa92UiC2pVuzwVGXZ0VfAXr9A/HFIS/LPABYwXgi6zgP+QIfC/RcYcAg+vn+j5PyGcy + JEEg== +Received: by 10.216.209.70 with SMTP id r48mr2776155weo.196.1354486893615; + Sun, 02 Dec 2012 14:21:33 -0800 (PST) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPS id bd7sm9858720wib.8.2012.12.02.14.21.31 + (version=TLSv1/SSLv3 cipher=OTHER); + Sun, 02 Dec 2012 14:21:32 -0800 (PST) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH] emacs: show: make show-get-message-prop usable from pick +Date: Sun, 2 Dec 2012 22:21:21 +0000 +Message-Id: <1354486881-32456-1-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1354483744-27541-1-git-send-email-markwalters1009@gmail.com> +References: <1354483744-27541-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, 02 Dec 2012 22:21:39 -0000 + +Make notmuch-show-get-prop choose the get-message-properties routine +based on the major mode. This make it usable from notmuch-pick and +thus a large number of functions are usable directly from +notmuch-show.el and do not need to be reimplemented in pick. +--- + +Ok so the previous version was me being stupid. I was wanting to avoid +errors caused by notmuch-pick-get-message-properties not existing but +the obvious solution is just to define it in a trivial fashion as +here. + +Anyway would this be acceptable? + +Best wishes + +Mark + + + emacs/notmuch-show.el | 10 +++++++++- + 1 files changed, 9 insertions(+), 1 deletions(-) + +diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el +index 4d6c014..b7f64e3 100644 +--- a/emacs/notmuch-show.el ++++ b/emacs/notmuch-show.el +@@ -1378,6 +1378,10 @@ Some useful entries are: + (notmuch-show-move-to-message-top) + (get-text-property (point) :notmuch-message-properties))) + ++(defun notmuch-show-mode-get-message-properties () ++ "Wrapper for notmuch-show-get-message-properties" ++ (notmuch-show-get-message-properties)) ++ + (defun notmuch-show-set-prop (prop val &optional props) + (let ((inhibit-read-only t) + (props (or props +@@ -1385,9 +1389,13 @@ Some useful entries are: + (plist-put props prop val) + (notmuch-show-set-message-properties props))) + ++(defun notmuch-pick-get-message-properties ()) ++ + (defun notmuch-show-get-prop (prop &optional props) + (let ((props (or props +- (notmuch-show-get-message-properties)))) ++ (if (eq major-mode 'notmuch-show-mode) ++ (notmuch-show-get-message-properties) ++ (notmuch-pick-get-message-properties))))) + (plist-get props prop))) + + (defun notmuch-show-get-message-id (&optional bare) +-- +1.7.9.1 + -- 2.26.2