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 2325B421174 for ; Sun, 12 Feb 2012 17:19:24 -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 fZCi81zetwJ1 for ; Sun, 12 Feb 2012 17:19:22 -0800 (PST) Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com [74.125.82.45]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id E88D7421193 for ; Sun, 12 Feb 2012 17:19:19 -0800 (PST) Received: by mail-ww0-f45.google.com with SMTP id dt12so3923384wgb.2 for ; Sun, 12 Feb 2012 17:19:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=wyQH5qIrPO4XEuMD9aVM3se/EErzfcadjRwkDNsdkXQ=; b=UOhjkQKzwwR5SJ2i6oVlxm+YZBTQzGUY9VzSLfTbYpsszM1youuDDdl7PE3URz6Z35 isMSmA6aMEq5NfgVaKEBltEfGSaUQt3RsuAzG7m6UT8+UPUCFvnHveGj27dvQ5VAGHFL Oc0oDQzhIzCD9tbKN/Wprw2Zwxl7hRbVfK+8Q= Received: by 10.180.78.233 with SMTP id e9mr15283162wix.0.1329095959673; Sun, 12 Feb 2012 17:19:19 -0800 (PST) Received: from localhost (94-192-233-223.zone6.bethere.co.uk. [94.192.233.223]) by mx.google.com with ESMTPS id da8sm18415905wib.6.2012.02.12.17.19.18 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 12 Feb 2012 17:19:19 -0800 (PST) From: Mark Walters To: notmuch@notmuchmail.org Subject: [RFC PATCH v3 04/11] emacs: add entry to notmuch-pick from notmuch-hello.el Date: Mon, 13 Feb 2012 01:20:08 +0000 Message-Id: <1329096015-8078-5-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 1.7.2.3 In-Reply-To: <1329072579-27340-1-git-send-email-markwalters1009@gmail.com> References: <1329072579-27340-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: Mon, 13 Feb 2012 01:19:24 -0000 Add an entry to notmuch-pick from notmuch-hello and bind it to 'z'. --- emacs/notmuch-hello.el | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-) diff --git a/emacs/notmuch-hello.el b/emacs/notmuch-hello.el index d17a30f..6d28a7e 100644 --- a/emacs/notmuch-hello.el +++ b/emacs/notmuch-hello.el @@ -27,6 +27,7 @@ (require 'notmuch-mua) (declare-function notmuch-search "notmuch" (query &optional oldest-first target-thread target-line continuation)) +(declare-function notmuch-pick "notmuch-pick" (query &optional query-context buffer-name)) (declare-function notmuch-poll "notmuch" ()) (defcustom notmuch-hello-recent-searches-max 10 @@ -181,6 +182,14 @@ International Bureau of Weights and Measures." (notmuch-search search notmuch-search-oldest-first nil nil #'notmuch-hello-search-continuation)) +(defun notmuch-hello-pick (&optional search) + (interactive) + (unless (null search) + (setq search (notmuch-hello-trim search)) + (let ((history-delete-duplicates t)) + (add-to-history 'notmuch-search-history search))) + (notmuch-pick search)) + (defun notmuch-hello-add-saved-search (widget) (interactive) (let ((search (widget-value @@ -345,6 +354,7 @@ should be. Returns a cons cell `(tags-per-line width)'." (define-key map (kbd "") 'widget-backward) (define-key map "m" 'notmuch-mua-new-mail) (define-key map "s" 'notmuch-hello-search) + (define-key map "z" 'notmuch-hello-pick) map) "Keymap for \"notmuch hello\" buffers.") (fset 'notmuch-hello-mode-map notmuch-hello-mode-map) -- 1.7.2.3