From 9abbad847e617891958710e2a176e97bb60e191e Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Mon, 13 Feb 2012 01:20:11 +0000 Subject: [PATCH] [RFC PATCH v3 07/11] emacs: add entry to notmuch-pick from notmuch.el --- 12/1671ccf7e822a8cbd004ca6e13fc9e5b82355e | 122 ++++++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 12/1671ccf7e822a8cbd004ca6e13fc9e5b82355e diff --git a/12/1671ccf7e822a8cbd004ca6e13fc9e5b82355e b/12/1671ccf7e822a8cbd004ca6e13fc9e5b82355e new file mode 100644 index 000000000..879d5aab8 --- /dev/null +++ b/12/1671ccf7e822a8cbd004ca6e13fc9e5b82355e @@ -0,0 +1,122 @@ +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 7C147421198 + for ; Sun, 12 Feb 2012 17:19:28 -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 IimSLn1iqxdU for ; + Sun, 12 Feb 2012 17:19:27 -0800 (PST) +Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com + [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 76B8C421171 + for ; Sun, 12 Feb 2012 17:19:27 -0800 (PST) +Received: by mail-wi0-f181.google.com with SMTP id hi8so3615406wib.26 + for ; Sun, 12 Feb 2012 17:19:27 -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=JoVR2Z6W7fGXZ6kRe/dVDRXYwLcmBIEgc1k9q8dCN20=; + b=r8lIjF79ZYAWcLFk32kFWWniyA4jbP/le1/4RnFVWi5nEzifcq3d9boiPKnVcRjT7J + oiRJ3x++hF0oOBhbVbPqq7OwFHp4JBRDmCfEG1S0ZKuyCJiOebFSyeWt4SQB/mxhmvrd + iKtGHUddShu/BWdAiJHcsEje3i8K/OMJ3reFg= +Received: by 10.216.135.76 with SMTP id t54mr5600836wei.14.1329095967213; + Sun, 12 Feb 2012 17:19:27 -0800 (PST) +Received: from localhost (94-192-233-223.zone6.bethere.co.uk. + [94.192.233.223]) by mx.google.com with ESMTPS id + ex2sm41853756wib.1.2012.02.12.17.19.25 (version=TLSv1/SSLv3 cipher=OTHER); + Sun, 12 Feb 2012 17:19:26 -0800 (PST) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [RFC PATCH v3 07/11] emacs: add entry to notmuch-pick from notmuch.el +Date: Mon, 13 Feb 2012 01:20:11 +0000 +Message-Id: <1329096015-8078-8-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:29 -0000 + +Add bindings 'z' to enter a notmuch-pick search and 'Z' to go straight +to the current search (i.e. the on being viewed in notmuch.el buffer) +in notmuch-pick. Also add binding `M-RET' to view the currently selected +thread with notmuch-pick. +--- + emacs/notmuch.el | 20 ++++++++++++++++++++ + 1 files changed, 20 insertions(+), 0 deletions(-) + +diff --git a/emacs/notmuch.el b/emacs/notmuch.el +index 5b4f1c5..28f7953 100644 +--- a/emacs/notmuch.el ++++ b/emacs/notmuch.el +@@ -54,6 +54,7 @@ + + (require 'notmuch-lib) + (require 'notmuch-show) ++(require 'notmuch-pick) + (require 'notmuch-mua) + (require 'notmuch-hello) + (require 'notmuch-maildir-fcc) +@@ -272,6 +273,8 @@ For a mouse binding, return nil." + (define-key map "R" 'notmuch-search-reply-to-thread) + (define-key map "m" 'notmuch-mua-new-mail) + (define-key map "s" 'notmuch-search) ++ (define-key map "z" 'notmuch-pick) ++ (define-key map "Z" 'notmuch-search-pick-current-query) + (define-key map "o" 'notmuch-search-toggle-order) + (define-key map "c" 'notmuch-search-stash-map) + (define-key map "=" 'notmuch-search-refresh-view) +@@ -284,6 +287,7 @@ For a mouse binding, return nil." + (define-key map "-" 'notmuch-search-remove-tag) + (define-key map "+" 'notmuch-search-add-tag) + (define-key map (kbd "RET") 'notmuch-search-show-thread) ++ (define-key map (kbd "M-RET") 'notmuch-search-pick-thread) + map) + "Keymap for \"notmuch search\" buffers.") + (fset 'notmuch-search-mode-map notmuch-search-mode-map) +@@ -1021,6 +1025,22 @@ same relative position within the new buffer." + (notmuch-search query oldest-first target-thread target-line continuation) + (goto-char (point-min)))) + ++(defun notmuch-search-pick-current-query () ++ "Call notmuch pick with the current query" ++ (interactive) ++ (notmuch-pick notmuch-search-query-string)) ++ ++(defun notmuch-search-pick-thread () ++ "Show the selected thread with notmuch-pick" ++ (interactive) ++ (notmuch-pick (notmuch-search-find-thread-id) ++ notmuch-search-query-string ++ (notmuch-prettify-subject (notmuch-search-find-subject))) ++ (unless (notmuch-pick-get-match) ++ (notmuch-pick-next-message)) ++ (notmuch-pick-show-message)) ++ ++ + (defcustom notmuch-poll-script nil + "An external script to incorporate new mail into the notmuch database. + +-- +1.7.2.3 + -- 2.26.2