]> git.notmuchmail.org Git - notmuch/commitdiff
notmuch-mode: Add an actualy notmuch-search-mode as well
authorCarl Worth <cworth@cworth.org>
Fri, 30 Oct 2009 22:12:49 +0000 (15:12 -0700)
committerCarl Worth <cworth@cworth.org>
Fri, 30 Oct 2009 22:12:49 +0000 (15:12 -0700)
Doesn't really do anything so far other than mark the buffer read-
only. This does have the benefit of giving us our own name rather
than "Compilation" for the mode.

notmuch-mode.el

index eec920446371b518719469669efa534f204a3d9b..450d4565fa7ea5e5fc6fb197b2a01b66e04dc221 100644 (file)
@@ -1,7 +1,16 @@
 ; A mode for running notmuch within emacs
 
+;;;###autoload
+(defun notmuch-search-mode ()
+  "Major mode for handling the output of notmuch search"
+  (interactive)
+  (kill-all-local-variables)
+  (setq major-mode 'notmuch-search-mode
+       mode-name "notmuch-search")
+  (setq buffer-read-only t))
+
 (defun notmuch ()
   "Run notmuch to display all mail with tag of 'inbox'"
   (interactive)
   (require 'compile)
-  (compilation-start "notmuch search tag:inbox"))
+  (compilation-start "notmuch search tag:inbox" 'notmuch-search-mode))