From: Sebastian Fischmeister Date: Mon, 6 Apr 2015 01:13:29 +0000 (+2000) Subject: [PATCH] custom search prefix X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1117fff39f1ae784533d61080a05132f5d01fcda;p=notmuch-archives.git [PATCH] custom search prefix --- diff --git a/69/503ec556b8e56d20e9dc3cf776d33665be8d65 b/69/503ec556b8e56d20e9dc3cf776d33665be8d65 new file mode 100644 index 000000000..7609f0891 --- /dev/null +++ b/69/503ec556b8e56d20e9dc3cf776d33665be8d65 @@ -0,0 +1,96 @@ +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 54B106DE1B73 + for ; Sun, 5 Apr 2015 18:29:48 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at cworth.org +X-Spam-Flag: NO +X-Spam-Score: -1.048 +X-Spam-Level: +X-Spam-Status: No, score=-1.048 tagged_above=-999 required=5 tests=[AWL=1.823, + RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, + RP_MATCHES_RCVD=-0.55, 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 pBpJi5YT59mV for ; + Sun, 5 Apr 2015 18:29:45 -0700 (PDT) +Received: from mailchk-m01.uwaterloo.ca (mailservices.uwaterloo.ca + [129.97.128.141]) + by arlo.cworth.org (Postfix) with ESMTPS id EA3286DE1B83 + for ; Sun, 5 Apr 2015 18:29:44 -0700 (PDT) +Received: from connect.uwaterloo.ca (connhub1.connect.uwaterloo.ca + [129.97.149.113]) + by mailchk-m01.uwaterloo.ca (8.14.4/8.14.4) with ESMTP id t361DTA5016758 + (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=OK) + for ; Sun, 5 Apr 2015 21:13:32 -0400 +Received: from CONNHUB4.connect.uwaterloo.ca (129.97.149.122) by + connhub1.connect.uwaterloo.ca (129.97.149.113) with Microsoft SMTP Server + (TLS) id 14.3.210.2; Sun, 5 Apr 2015 21:13:30 -0400 +Received: from uwaterloo.ca (172.16.36.43) by connhub4.connect.uwaterloo.ca + (129.97.149.122) with Microsoft SMTP Server (TLS) id 14.3.210.2; Sun, 5 Apr + 2015 21:13:29 -0400 +From: Sebastian Fischmeister +To: notmuch +Subject: [PATCH] custom search prefix +Reply-To: +X-Homepage: http://esg.uwaterloo.ca +Date: Sun, 5 Apr 2015 21:13:29 -0400 +Message-ID: <87siceqcyl.fsf@uwaterloo.ca> +MIME-Version: 1.0 +Content-Type: text/plain +X-UUID: 7e799838-187b-4f31-8593-4e75ef902469 +X-Miltered: at mailchk-m01 with ID 5521DDB9.000 by Joe's j-chkmail + (http://j-chkmail.ensmp.fr)! +X-Virus-Scanned: clamav-milter 0.98.6 at mailchk-m01 +X-Virus-Status: Clean +X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 + (mailchk-m01.uwaterloo.ca [129.97.128.141]); + Sun, 05 Apr 2015 21:13:32 -0400 (EDT) +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: Mon, 06 Apr 2015 01:29:48 -0000 + + +--- + emacs/notmuch.el | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/emacs/notmuch.el b/emacs/notmuch.el +index ab00454..c9cd31a 100644 +--- a/emacs/notmuch.el ++++ b/emacs/notmuch.el +@@ -851,6 +851,12 @@ See `notmuch-tag' for information on the format of TAG-CHANGES." + (concat "*notmuch-search-" query "*")) + ))) + ++(defcustom notmuch-query-prefix nil ++ "Add a prefix to the standard query." ++ :type 'string ++ :group 'notmuch-search) ++ ++ + (defun notmuch-read-query (prompt) + "Read a notmuch-query from the minibuffer with completion. + +@@ -883,7 +889,7 @@ PROMPT is the string to prompt with." + ;; this was simpler than convincing completing-read to accept spaces: + (define-key keymap (kbd "TAB") 'minibuffer-complete) + (let ((history-delete-duplicates t)) +- (read-from-minibuffer prompt nil keymap nil ++ (read-from-minibuffer prompt notmuch-query-prefix keymap nil + 'notmuch-search-history current-query nil))))) + + (defun notmuch-search-get-query () +-- +2.3.5