[PATCH] emacs: Sort saved searches

Antono Vasiljev self at antono.info
Sun Sep 4 19:22:17 PDT 2011


On Sun, 04 Sep 2011 21:21:44 +0300, Jani Nikula <jani at nikula.org> wrote:

> Hmm. Let's look at this from another perspective: do you know if there's
> a reasonable way to make ordering of the customized saved searches
> easier? It's not exactly user friendly to move items up and down in the
> list. Or to sort them.
> 
> On the other hand, the tags are sorted. Saved searches are not. Should
> it be possible to display tags in user defined order...?
> 
> I know I can twist this the way I want and carry my own modifications,
> but I'd like to make notmuch user friendly for people who don't know
> elisp.


Note exactrly on Your topic, but my solution for the problem is

anything-notmuch:

;; Notmuch Anything Source
;; anything-sources
(defvar notmuch-anything-source-saved-searches
  '((name . "Notmuch Mail - Saved Searches")
    (candidates . notmuch-saved-searches)
    (action  ("Search with notmuch" . notmuch-search))
    (candidate-number-limit . 100)
    ;; (requires-pattern . 2)
    "Source for completing anything saved searches."))

(defun notmuch-anything (&optional rehash)
  (interactive (list current-prefix-arg))
  (anything
   :sources 'notmuch-anything-source-saved-searches
   :preselect "inbox"
   :buffer "*notmuch-saved-searches*"))

(define-key notmuch-hello-mode-map "S" 'notmuch-anything)


It is possible to include this directly to notmuch, wrapped to

(eval-after-load 'notmuch
   '(progn
   code
     ...))
     
?


-- 
http://antono.info/
http://twitter.com/antono
http://github.com/antono


More information about the notmuch mailing list