From 07d2f2c7478912ad9467796d179a6dc5c03d6398 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Fri, 12 Jun 2015 09:15:32 +0100 Subject: [PATCH] [PATCH] emacs search: stash query --- 51/68cb3b72ead234cf865904127eaab906ba490e | 102 ++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 51/68cb3b72ead234cf865904127eaab906ba490e diff --git a/51/68cb3b72ead234cf865904127eaab906ba490e b/51/68cb3b72ead234cf865904127eaab906ba490e new file mode 100644 index 000000000..3e0b7cc63 --- /dev/null +++ b/51/68cb3b72ead234cf865904127eaab906ba490e @@ -0,0 +1,102 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by arlo.cworth.org (Postfix) with ESMTP id 2F1346DE15DD + for ; Fri, 12 Jun 2015 01:15:48 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: 0.462 +X-Spam-Level: +X-Spam-Status: No, score=0.462 tagged_above=-999 required=5 tests=[AWL=1.032, + DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, + RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, + RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled +Received: from arlo.cworth.org ([127.0.0.1]) + by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id yz08Rqa6zAqW for ; + Fri, 12 Jun 2015 01:15:46 -0700 (PDT) +Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com + [209.85.212.174]) + by arlo.cworth.org (Postfix) with ESMTPS id 17DC26DE15D8 + for ; Fri, 12 Jun 2015 01:15:46 -0700 (PDT) +Received: by wiwd19 with SMTP id d19so10867165wiw.0 + for ; Fri, 12 Jun 2015 01:15:42 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id; + bh=ahHyMKlhQRTuoS6k4VDRz+7QGP5/VPp6h8lt6uUOr7w=; + b=uRba2Sj9hwVPdOdzy7SRGHneD8rsEkfgp/xQBDVOD5GNJ3i9GtLlGJgeCuRUpcrCs9 + V0BAt5vR/4QNs6kOd3W5anGH3WHHB/u8xKzomWAxgASYZVlncn5vUQi1hXKYYBeO0h0p + KcRx15R5ltGIEMsHcj5t9BEyk1OCK538zwV13F69D0xBiYVKr73/etIzL2TS6GuHHAMl + F/JMMeSknbsljRrlvtWin4GRtmXnx6mZwTgJP3Xrd7B1n6IyXU7kONWzRJaF5EVbTLds + oOWDq/yKr3/9IL3pz/Lx/AB9p3SusdJlXb6P3ipz14Jot48DZKs5CH9xTLYPT7p+fhaz + DB2Q== +X-Received: by 10.194.62.228 with SMTP id b4mr23865270wjs.2.1434096942263; + Fri, 12 Jun 2015 01:15:42 -0700 (PDT) +Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) + by mx.google.com with ESMTPSA id gh3sm4664041wjb.36.2015.06.12.01.15.41 + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Fri, 12 Jun 2015 01:15:41 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH] emacs search: stash query +Date: Fri, 12 Jun 2015 09:15:32 +0100 +Message-Id: <1434096932-20901-1-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 2.1.4 +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.18 +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: Fri, 12 Jun 2015 08:15:48 -0000 + +Add keybinding c q to stash the current query in search mode. +--- + +We could add something similar in show or tree mode but the query is +then partly notmuch generated (in particular the choice of thread) so +it is not so useful there. + +Best wishes + +Mark + + +emacs/notmuch.el | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/emacs/notmuch.el b/emacs/notmuch.el +index f03c2f9..6564816 100644 +--- a/emacs/notmuch.el ++++ b/emacs/notmuch.el +@@ -181,6 +181,7 @@ (defvar notmuch-search-mode-map + (defvar notmuch-search-stash-map + (let ((map (make-sparse-keymap))) + (define-key map "i" 'notmuch-search-stash-thread-id) ++ (define-key map "q" 'notmuch-stash-query) + (define-key map "?" 'notmuch-subkeymap-help) + map) + "Submap for stash commands") +@@ -191,6 +192,11 @@ (defun notmuch-search-stash-thread-id () + (interactive) + (notmuch-common-do-stash (notmuch-search-find-thread-id))) + ++(defun notmuch-stash-query () ++ "Copy current query to kill-ring." ++ (interactive) ++ (notmuch-common-do-stash (notmuch-search-get-query))) ++ + (defvar notmuch-search-query-string) + (defvar notmuch-search-target-thread) + (defvar notmuch-search-target-line) +-- +2.1.4 + -- 2.26.2