[PATCH] emacs: show: make show-get-message-prop usable from pick

Mark Walters markwalters1009 at gmail.com
Sun Dec 2 14:21:21 PST 2012


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



More information about the notmuch mailing list