[RFC PATCH 2/2] emacs: a couple of example functions that might be useful with saved searches

Jani Nikula jani at nikula.org
Wed Nov 23 13:08:37 PST 2011


Signed-off-by: Jani Nikula <jani at nikula.org>
---
 emacs/notmuch-hello.el |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el
index ad3ae74..f03e4b9 100644
--- a/emacs/notmuch-hello.el
+++ b/emacs/notmuch-hello.el
@@ -26,6 +26,24 @@
 (require 'notmuch-lib)
 (require 'notmuch-mua)
 
+(defun notmuch-no-saved-search-match (this)
+  (mapconcat (lambda (arg) (concat "(not ("
+				   (if (functionp (cdr arg))
+				       (funcall (cdr arg) arg)
+				     (cdr arg)) "))"))
+	     (loop for elem in notmuch-saved-searches
+		   if (not (equal (car this) (car elem)))
+		   collect elem)
+	     " and "))
+
+(defun notmuch-get-saved-search (name)
+  (let ((elem (assoc name notmuch-saved-searches)))
+    (if elem
+	(if (functionp (cdr elem))
+	    (funcall (cdr elem) elem)
+	  (cdr elem))
+      "")))
+
 (declare-function notmuch-search "notmuch" (query &optional oldest-first target-thread target-line continuation))
 (declare-function notmuch-poll "notmuch" ())
 
-- 
1.7.5.4



More information about the notmuch mailing list