From cca3df844d7988afedd5b78bee1b018a82f88583 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sat, 8 Dec 2012 12:44:34 +0000 Subject: [PATCH] [PATCH] contrib: pick: slightly tweak running search and pick from pick buffer --- 25/5e9b020275866def92f2df5df9b7bb8e9bd8da | 128 ++++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 25/5e9b020275866def92f2df5df9b7bb8e9bd8da diff --git a/25/5e9b020275866def92f2df5df9b7bb8e9bd8da b/25/5e9b020275866def92f2df5df9b7bb8e9bd8da new file mode 100644 index 000000000..98af2d1f3 --- /dev/null +++ b/25/5e9b020275866def92f2df5df9b7bb8e9bd8da @@ -0,0 +1,128 @@ +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 49C8C431FB6 + for ; Sat, 8 Dec 2012 04:44:35 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 2.7 +X-Spam-Level: ** +X-Spam-Status: No, score=2.7 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, + FREEMAIL_REPLY=2.499, 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 PNblZuD5BeQU for ; + Sat, 8 Dec 2012 04:44:34 -0800 (PST) +Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com + [209.85.212.175]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id A8EA8431FAE + for ; Sat, 8 Dec 2012 04:44:34 -0800 (PST) +Received: by mail-wi0-f175.google.com with SMTP id hm11so190829wib.2 + for ; Sat, 08 Dec 2012 04:44:33 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:x-mailer; + bh=PzmNXBgBtx+Kl8rgpsIjdngHlrjp9L2M6AUrIHpR2As=; + b=xOopKgPOI9oL9E6OaUpLfn5tnaz99dN8wKJzFc37+G24BHVeWUDRje07AvGD84fHnW + phgx/Th+mApqjkKoNGamXLPu8I0CeFlvqw/caUdkgg4YYM6V/74GvrVjbsHMOQhorwAL + ZviDoGDBT/xrnseT92m0yVnQ531VBpCHypIZzHDHEhRuCG+WNym47B0BFRWPcvA1P0xU + S/VHji/0A6vaDK4g0CLaJR0obGI/MN+i1GwaQ0tmUhay2d01ARVdxQ/+yoxVgnOhg9qI + 0StZT96UG8KXfZzE75PTZIAgFYKAhqhHpe4LzaturhfOHchq/49VyIlwJ5M15E4b1jyt + Y3rw== +Received: by 10.180.87.225 with SMTP id bb1mr2907782wib.20.1354970673405; + Sat, 08 Dec 2012 04:44:33 -0800 (PST) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPS id bd7sm2403136wib.8.2012.12.08.04.44.31 + (version=TLSv1/SSLv3 cipher=OTHER); + Sat, 08 Dec 2012 04:44:32 -0800 (PST) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH] contrib: pick: slightly tweak running search and pick from + pick buffer +Date: Sat, 8 Dec 2012 12:44:34 +0000 +Message-Id: <1354970674-18136-1-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +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: Sat, 08 Dec 2012 12:44:35 -0000 + +Previously running search or pick from the pick buffer did not close +the message pane (if open). This meant that then new search ends up in +a very small window. Fix this so that the message pane is +shut. However, make it so that the pane is shut after the search +string is entered in case the user is basing the search on something +in the current message. +--- + +This is essentially an independent patch but the context clashes with +id:1354970494-18050-1-git-send-email-markwalters1009@gmail.com so that +should be applied first for testing. + +If there is any problem with the first patch I can trivially rebase +this one. + +Best wishes + +Mark + + + contrib/notmuch-pick/notmuch-pick.el | 23 +++++++++++++++++++++-- + 1 files changed, 21 insertions(+), 2 deletions(-) + +diff --git a/contrib/notmuch-pick/notmuch-pick.el b/contrib/notmuch-pick/notmuch-pick.el +index 36587a6..b474231 100644 +--- a/contrib/notmuch-pick/notmuch-pick.el ++++ b/contrib/notmuch-pick/notmuch-pick.el +@@ -175,8 +175,8 @@ + (define-key map "?" 'notmuch-help) + (define-key map "a" 'notmuch-pick-archive-message-then-next) + (define-key map "=" 'notmuch-pick-refresh-view) +- (define-key map "s" 'notmuch-search) +- (define-key map "z" 'notmuch-pick) ++ (define-key map "s" 'notmuch-pick-to-search) ++ (define-key map "z" 'notmuch-pick-to-pick) + (define-key map "m" 'notmuch-pick-new-mail) + (define-key map "f" 'notmuch-pick-forward-message) + (define-key map "r" 'notmuch-pick-reply-sender) +@@ -289,6 +289,25 @@ Does NOT change the database." + (interactive) + (notmuch-pick-tag "-")) + ++;; The next two functions close the message window before searching or ++;; picking but they do so after the user has entered the query (in ++;; case the user was basing the query on something in the message ++;; window). ++ ++(defun notmuch-pick-to-search () ++ "Run \"notmuch search\" with the given `query' and display results." ++ (interactive) ++ (let ((query (notmuch-read-query "Notmuch search: "))) ++ (notmuch-pick-close-message-window) ++ (notmuch-search query))) ++ ++(defun notmuch-pick-to-pick () ++ "Run a query and display results in experimental notmuch-pick mode" ++ (interactive) ++ (let ((query (notmuch-read-query "Notmuch pick: "))) ++ (notmuch-pick-close-message-window) ++ (notmuch-pick query))) ++ + ;; This function should be in notmuch-hello.el but we are trying to + ;; minimise impact on the rest of the codebase. + (defun notmuch-pick-from-hello (&optional search) +-- +1.7.9.1 + -- 2.26.2