Re: [PATCH] emacs: Sort saved searches
authorAntono Vasiljev <self@antono.info>
Mon, 5 Sep 2011 02:22:17 +0000 (05:22 +0300)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:39:21 +0000 (09:39 -0800)
5f/99fcf8df0f410f03c0db9baaccf8e5e3d7e23c [new file with mode: 0644]

diff --git a/5f/99fcf8df0f410f03c0db9baaccf8e5e3d7e23c b/5f/99fcf8df0f410f03c0db9baaccf8e5e3d7e23c
new file mode 100644 (file)
index 0000000..e6cf33c
--- /dev/null
@@ -0,0 +1,113 @@
+Return-Path: <self@antono.info>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 4BA34431FD0\r
+       for <notmuch@notmuchmail.org>; Sun,  4 Sep 2011 19:22:25 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.363\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.363 tagged_above=-999 required=5\r
+       tests=[RDNS_DYNAMIC=0.363] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 1i5lCbqsgW8U for <notmuch@notmuchmail.org>;\r
+       Sun,  4 Sep 2011 19:22:24 -0700 (PDT)\r
+Received: from mail.antono.info (ec2-50-19-243-116.compute-1.amazonaws.com\r
+       [50.19.243.116])\r
+       (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id B5687431FB6\r
+       for <notmuch@notmuchmail.org>; Sun,  4 Sep 2011 19:22:24 -0700 (PDT)\r
+Received: by mail.antono.info (Postfix, from userid 1003)\r
+       id E2D18615B7; Mon,  5 Sep 2011 02:22:53 +0000 (UTC)\r
+Received: from libero (unknown [178.121.201.33])\r
+       (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by mail.antono.info (Postfix) with ESMTPSA id ECB7160381;\r
+       Mon,  5 Sep 2011 02:22:50 +0000 (UTC)\r
+From: Antono Vasiljev <self@antono.info>\r
+To: Jani Nikula <jani@nikula.org>,\r
+       Jameson Graef Rollins <jrollins@finestructure.net>,\r
+       Tomi Ollila <tomi.ollila@nixu.com>\r
+Subject: Re: [PATCH] emacs: Sort saved searches\r
+In-Reply-To: <8739gcw4lj.fsf@nikula.org>\r
+References: <1314966486-20708-1-git-send-email-jani@nikula.org>\r
+       <yf61uvx261y.fsf@taco2.nixu.fi> <8739gdb7z8.fsf@nikula.org>\r
+       <878vq4agex.fsf@servo.factory.finestructure.net>\r
+       <8739gcw4lj.fsf@nikula.org>\r
+User-Agent: Notmuch/0.6.1-1 (http://notmuchmail.org) Emacs/24.0.50.1\r
+       (i686-pc-linux-gnu)\r
+Date: Mon, 05 Sep 2011 05:22:17 +0300\r
+Message-ID: <87fwkbd8yu.fsf@antono.info>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\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: Mon, 05 Sep 2011 02:22:25 -0000\r
+\r
+On Sun, 04 Sep 2011 21:21:44 +0300, Jani Nikula <jani@nikula.org> wrote:\r
+\r
+> Hmm. Let's look at this from another perspective: do you know if there's\r
+> a reasonable way to make ordering of the customized saved searches\r
+> easier? It's not exactly user friendly to move items up and down in the\r
+> list. Or to sort them.\r
+> \r
+> On the other hand, the tags are sorted. Saved searches are not. Should\r
+> it be possible to display tags in user defined order...?\r
+> \r
+> I know I can twist this the way I want and carry my own modifications,\r
+> but I'd like to make notmuch user friendly for people who don't know\r
+> elisp.\r
+\r
+\r
+Note exactrly on Your topic, but my solution for the problem is\r
+\r
+anything-notmuch:\r
+\r
+;; Notmuch Anything Source\r
+;; anything-sources\r
+(defvar notmuch-anything-source-saved-searches\r
+  '((name . "Notmuch Mail - Saved Searches")\r
+    (candidates . notmuch-saved-searches)\r
+    (action  ("Search with notmuch" . notmuch-search))\r
+    (candidate-number-limit . 100)\r
+    ;; (requires-pattern . 2)\r
+    "Source for completing anything saved searches."))\r
+\r
+(defun notmuch-anything (&optional rehash)\r
+  (interactive (list current-prefix-arg))\r
+  (anything\r
+   :sources 'notmuch-anything-source-saved-searches\r
+   :preselect "inbox"\r
+   :buffer "*notmuch-saved-searches*"))\r
+\r
+(define-key notmuch-hello-mode-map "S" 'notmuch-anything)\r
+\r
+\r
+It is possible to include this directly to notmuch, wrapped to\r
+\r
+(eval-after-load 'notmuch\r
+   '(progn\r
+   code\r
+     ...))\r
+     \r
+?\r
+\r
+\r
+-- \r
+http://antono.info/\r
+http://twitter.com/antono\r
+http://github.com/antono\r