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 13F24429E4D for ; Wed, 23 Nov 2011 13:08:51 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 Teh-ziWhupWE for ; Wed, 23 Nov 2011 13:08:50 -0800 (PST) Received: from mail-fx0-f53.google.com (mail-fx0-f53.google.com [209.85.161.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 8086A429E4B for ; Wed, 23 Nov 2011 13:08:50 -0800 (PST) Received: by faan15 with SMTP id n15so3100209faa.26 for ; Wed, 23 Nov 2011 13:08:49 -0800 (PST) Received: by 10.204.147.215 with SMTP id m23mr26455923bkv.84.1322082529247; Wed, 23 Nov 2011 13:08:49 -0800 (PST) Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi. [80.220.92.23]) by mx.google.com with ESMTPS id i3sm23177109faf.0.2011.11.23.13.08.47 (version=SSLv3 cipher=OTHER); Wed, 23 Nov 2011 13:08:48 -0800 (PST) From: Jani Nikula To: notmuch@notmuchmail.org Subject: [RFC PATCH 2/2] emacs: a couple of example functions that might be useful with saved searches Date: Wed, 23 Nov 2011 23:08:37 +0200 Message-Id: <07d589cdf6c229a2f53b584eef273781b5f129bb.1322080622.git.jani@nikula.org> X-Mailer: git-send-email 1.7.5.4 In-Reply-To: References: In-Reply-To: References: 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: Wed, 23 Nov 2011 21:08:51 -0000 Signed-off-by: Jani Nikula --- 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