Re: (emacs) customise key bindings taking text input
authorMatthew Lear <matt@bubblegen.co.uk>
Wed, 15 Jul 2015 08:28:51 +0000 (09:28 +0100)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:49:10 +0000 (14:49 -0700)
5b/d3558933046c2815ad3ecd9a26dc186e29216b [new file with mode: 0644]

diff --git a/5b/d3558933046c2815ad3ecd9a26dc186e29216b b/5b/d3558933046c2815ad3ecd9a26dc186e29216b
new file mode 100644 (file)
index 0000000..72fd839
--- /dev/null
@@ -0,0 +1,115 @@
+Return-Path: <matt@bubblegen.co.uk>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 12E4F6DE02DD\r
+ for <notmuch@notmuchmail.org>; Wed, 15 Jul 2015 01:28:59 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.593\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.593 tagged_above=-999 required=5 tests=[AWL=0.107,\r
+  RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id ayGxeYiQyiZ4 for <notmuch@notmuchmail.org>;\r
+ Wed, 15 Jul 2015 01:28:56 -0700 (PDT)\r
+Received: from avasout04.plus.net (avasout04.plus.net [212.159.14.19])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 89EFF6DE0243\r
+ for <notmuch@notmuchmail.org>; Wed, 15 Jul 2015 01:28:55 -0700 (PDT)\r
+Received: from localhost ([84.93.237.98]) by avasout04 with smtp\r
+ id sYUr1q007283uBY01YUsDe; Wed, 15 Jul 2015 09:28:54 +0100\r
+X-CM-Score: 0.00\r
+X-CNFS-Analysis: v=2.1 cv=JOrGyJ+b c=1 sm=1 tr=0\r
+ a=BJaFPv9AyABFDM2hXLRoEA==:117 a=BJaFPv9AyABFDM2hXLRoEA==:17 a=0Bzu9jTXAAAA:8\r
+ a=80hmnl3cAAAA:8 a=qFRnvRBcnqcA:10 a=8nJEP1OIZ-IA:10 a=zOBTXjUuO1YA:10\r
+ a=VA9x5NBs7_5sdWHAPJUA:9 a=gQA8C8--ayaFZDxL:21 a=FLZN7u4ZqtSCcmyE:21\r
+ a=wPNLvfGTeEIA:10\r
+Received: from localhost ([127.0.0.1] helo=webmail.plus.net)\r
+ by localhost with esmtp (Exim 4.76)\r
+ (envelope-from <matt@bubblegen.co.uk>)\r
+ id 1ZFI3f-00013r-B8; Wed, 15 Jul 2015 09:28:51 +0100\r
+Received: from 216.31.211.11 (proxying for unknown)\r
+ (SquirrelMail authenticated user bubblegen+matt)\r
+ by webmail.plus.net with HTTP; Wed, 15 Jul 2015 09:28:51 +0100\r
+Message-ID: <8c802621a74950fb3216c86b117a7b93.squirrel@webmail.plus.net>\r
+In-Reply-To: <87bnff0wb9.fsf@qmul.ac.uk>\r
+References: <8cd45d0665469d8f5e98928e61e9a411.squirrel@webmail.plus.net>\r
+ <87bnff0wb9.fsf@qmul.ac.uk>\r
+Date: Wed, 15 Jul 2015 09:28:51 +0100\r
+Subject: Re: (emacs) customise key bindings taking text input\r
+From: "Matthew Lear" <matt@bubblegen.co.uk>\r
+To: "Mark Walters" <markwalters1009@gmail.com>\r
+Reply-To: matt@bubblegen.co.uk\r
+User-Agent: SquirrelMail\r
+MIME-Version: 1.0\r
+Content-Type: text/plain;charset=iso-8859-1\r
+Content-Transfer-Encoding: 8bit\r
+X-Priority: 3 (Normal)\r
+Importance: Normal\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 15 Jul 2015 08:28:59 -0000\r
+\r
+>\r
+> On Tue, 14 Jul 2015, Matthew Lear <matt@bubblegen.co.uk> wrote:\r
+>> Hi all,\r
+>>\r
+>> I was wondering if there was a way to add a new search similar to what\r
+>> pressing s does, but make it use a predefined list of search terms in\r
+>> addition to the text being entered? For example, I have reams of bug\r
+>> notification emails which currently have various tags applied. If I\r
+>> wanted\r
+>> to search a subset of these tags with a number (bug id) in the subject,\r
+>> right now I have to press s and type tag:foo and tag:bar and\r
+>> subject:1234.\r
+>> If I could add a new search option (eg 'B') and after pressing that I\r
+>> simply enter the bug id and hit return, it would save me a lot of\r
+>> typing.\r
+>> I have custom searches set up which do the 'tag:foo and tag:bar' and I\r
+>> can\r
+>> filter on the subject, but that still means pressing f and typing\r
+>> subject:1234.\r
+>>\r
+>> I fear I'm rambling here but hopefully I've conveyed what I'm trying to\r
+>> do.\r
+>> Is this possible?\r
+>> Just trying to cut down on my typing ;-)\r
+>\r
+> I don't think there is anything built in but adding something like this\r
+> snippet\r
+>\r
+> (defun my-search (&optional bug)\r
+>   (interactive)\r
+>   (let* ((bug (or bug (notmuch-read-query "Bug number: ")))\r
+>       (query (concat "tag:foo and tag:bar and subject:" bug)))\r
+>     (notmuch-search query)))\r
+>\r
+> to your .emacs file and binding it to B in the notmuch-common-keymap would\r
+> probably\r
+> do what you want.\r
+>\r
+> If people think this would be more generally useful it may be possible\r
+> to add something like this to saved searches (ie a partial saved search)\r
+> and then they would be accessible from notmuch-hello or via notmuch\r
+> jump.\r
+\r
+That's a good idea. Hooking into saved searches and then being able to\r
+refine/enhance them via a customisable text input field would be really\r
+nice.\r
+The above lisp-fu works a treat. Thank you very much, and thanks for\r
+fixing the mark read logic in notmuch-tree :-)\r
+Cheers,\r
+--  Matt\r
+\r