]> git.notmuchmail.org Git - notmuch/commitdiff
notmuch.el: Add notmuch-search command as well as notmuch
authorCarl Worth <cworth@cworth.org>
Sat, 31 Oct 2009 00:18:19 +0000 (17:18 -0700)
committerCarl Worth <cworth@cworth.org>
Sat, 31 Oct 2009 00:18:19 +0000 (17:18 -0700)
This allows for entering a query string interactively.

notmuch.el

index 3e4a30828ba8fee05b7c851beed85d4a29c55a86..84152fbccfebb14d55511a50d8fa759873c32d08 100644 (file)
        mode-name "notmuch-search")
   (setq buffer-read-only t))
 
+(defun notmuch-search (query)
+  "Run \"notmuch search\" with the given query string and display results."
+  (interactive "sNotmuch search:")
+  (compilation-start (concat "notmuch search " query) 'notmuch-search-mode))
+
 (defun notmuch ()
   "Run notmuch to display all mail with tag of 'inbox'"
   (interactive)
   (require 'compile)
-  (compilation-start "notmuch search tag:inbox" 'notmuch-search-mode))
+  (notmuch-search "tag:inbox"))