From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id DFC3E6DE0F56 for ; Thu, 7 Feb 2019 07:36:46 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.2 X-Spam-Level: X-Spam-Status: No, score=-0.2 tagged_above=-999 required=5 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, 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 zaaUdTh_tiDU for ; Thu, 7 Feb 2019 07:36:46 -0800 (PST) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com [209.85.221.53]) by arlo.cworth.org (Postfix) with ESMTPS id F17586DE0F51 for ; Thu, 7 Feb 2019 07:36:45 -0800 (PST) Received: by mail-wr1-f53.google.com with SMTP id r2so258101wrv.10 for ; Thu, 07 Feb 2019 07:36:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version:content-disposition :content-transfer-encoding:content-description; bh=d/8TSPuIPC/o4ZtBU1fb0ny6PylTqkIttgLquMSPac8=; b=CBm6WBQ1p7ufr9Gvn+pHe23vjQS2uc0ndosomgjz3vyH+RgRGAeyvEjU70fpmYcqP5 EiUsYQcbkKSqHAz4KvQp0QRjsM5j2gaQw7BEICX4G8UJNcgQo9Qt2qC2FH9HVETlJ4Q4 9RnOlptA+ob6wO+i4Kw/yV8aVjk88ECcYqrWfEOeOR0PGg+1AKiBjiT8/FwvQRp3RVGW 48uLdusw7b3sSUY2cdV/4PSqb0vuWr/6udbFYLxeIyKGIDIvBuu0ic+fabHHXWO5NUV+ Lw2qC1ZhHC7Ziw3XC+dG46l9PKIcXC6xI9PyoqpnIIqbWfeJf43T70x1YGB2q9eFDV5F Wm6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-disposition:content-transfer-encoding:content-description; bh=d/8TSPuIPC/o4ZtBU1fb0ny6PylTqkIttgLquMSPac8=; b=JiZq/w8AEFEsmOFxKm2bpHZYBlaRdwbXKWUb+0GOupdjvLKQky+tmN/bbpEuWyLNbD ySVVCvB487kUWa9mo7sxIg10zvFS6ZQKWc+tKzxHUuezxZlHWh/0pnYEfIibl+y/TwNr hSF4lKMg+rWaQsBrDh17pccD+Ayh/Lr4KzJ7E+QYbciph/Z7cOoH16jr+c6jCETruB7L BBqg0515LGIdMWGAgl7b20ms584IEGi7tebxtihzvJvHm0vn6GsdIR57kSuQo4nS6rFW 5qYuZfaaWLHSKZTrI4voEGEdbJ6e1W9VAKXS/PwVQL1lyzBZbYtfZnMpoHo2BBJo0Wsd htSw== X-Gm-Message-State: AHQUAuYlcN/F7amQDZcMpexNuuq7oH+UpJNIQY9IB+g8mc11VDU8W7oe AF4wgHgQKT3ccNUw5wYGeBBMp3Tw X-Google-Smtp-Source: AHgI3IZBifGmDbLXGBXhb7GBuZJsDlxRAYw3KmYelmM4LYUW4YOws4bN+6N3wna59niR0TGYzrykpg== X-Received: by 2002:adf:c108:: with SMTP id r8mr13378027wre.233.1549553801233; Thu, 07 Feb 2019 07:36:41 -0800 (PST) Received: from thinkpad.localdomain (lcs07-lyo-176-188-242-162.sfr.lns.abo.bbox.fr. [176.188.242.162]) by smtp.gmail.com with ESMTPSA id n9sm19589114wrx.80.2019.02.07.07.36.40 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Feb 2019 07:36:40 -0800 (PST) From: zaephon@gmail.com To: notmuch@notmuchmail.org Subject: [PATCH 1/4] emacs: Implement notmuch-search-refine Date: Thu, 07 Feb 2019 16:36:39 +0100 Message-ID: <87wombliew.fsf@hidden> MIME-Version: 1.0 Content-Type: text/x-patch; charset=utf-8 Content-Disposition: inline; filename=0001-emacs-Implement-notmuch-search-refine.patch Content-Transfer-Encoding: quoted-printable Content-Description: [PATCH 1/4] emacs: Implement notmuch-search-refine X-Mailman-Approved-At: Thu, 07 Feb 2019 09:22:23 -0800 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 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: Thu, 07 Feb 2019 15:36:47 -0000 >From 6f73e9aa2031de33eb48a05807295fdb7c3bb566 Mon Sep 17 00:00:00 2001 From: Leo Vivier Date: Wed, 6 Feb 2019 16:44:59 +0100 Subject: [PATCH 1/4] emacs: Implement notmuch-search-refine MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit Refine the current query string. --- Filtering was already implemented with notmuch-search-filter, but there wasn=E2=80=99t any way to refine the current query. --- emacs/notmuch.el | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/emacs/notmuch.el b/emacs/notmuch.el index 804e78ab..8bbed17d 100644 --- a/emacs/notmuch.el +++ b/emacs/notmuch.el @@ -1070,6 +1070,27 @@ current search results AND the additional query stri= ng provided." (concat grouped-original-query " and " grouped-query)) notmuch-search-oldest-first))) =20 +(defvar notmuch-search-refine-replace-buffer nil + "Should =E2=80=98not-much-refine=E2=80=99 replace the current search?") + +(defun notmuch-search-refine (query &optional replace) + "Refine the current query string. + +When REPLACE is non-nil, do not create another buffer. See also +=E2=80=98notmuch-search-refine-replace-buffer=E2=80=99." + (interactive (list (minibuffer-with-setup-hook + (lambda () + (next-history-element 1) + (end-of-line) + (insert " ")) + (notmuch-read-query "Refine search: ")))) + (let ((grouped-query (notmuch-group-disjunctive-query-string + query))) + (when (or replace + notmuch-search-refine-replace-buffer) + (notmuch-bury-or-kill-this-buffer)) + (notmuch-search grouped-query notmuch-search-oldest-first))) + (defun notmuch-search-filter-by-tag (tag) "Filter the current search results based on a single tag. =20 --=20 2.20.1