1 ; notmuch.el --- run notmuch within emacs
3 ; Copyright © Carl Worth
5 ; This file is part of Notmuch.
7 ; Notmuch is free software: you can redistribute it and/or modify it
8 ; under the terms of the GNU General Public License as published by
9 ; the Free Software Foundation, either version 3 of the License, or
10 ; (at your option) any later version.
12 ; Notmuch is distributed in the hope that it will be useful, but
13 ; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 ; General Public License for more details.
17 ; You should have received a copy of the GNU General Public License
18 ; along with Notmuch. If not, see <http://www.gnu.org/licenses/>.
20 ; Authors: Carl Worth <cworth@cworth.org>
22 ; Much of notmuch.el was written by looking at the implementation of
23 ; compile.el from the emacs distribution source which has the
24 ; following copyright and authorsip (and the identical license as
27 ; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
28 ; 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
29 ; Free Software Foundation, Inc.
31 ; Authors: Roland McGrath <roland@gnu.org>,
32 ; Daniel Pfeiffer <occitan@esperanto.org>
35 (defun notmuch-search-mode ()
36 "Major mode for handling the output of notmuch search"
38 (kill-all-local-variables)
39 (setq major-mode 'notmuch-search-mode
40 mode-name "notmuch-search")
41 (setq buffer-read-only t))
43 (defun notmuch-search (query)
44 "Run \"notmuch search\" with the given query string and display results."
45 (interactive "sNotmuch search:")
46 (compilation-start (concat "notmuch search " query) 'notmuch-search-mode))
49 "Run notmuch to display all mail with tag of 'inbox'"
52 (notmuch-search "tag:inbox"))