]> git.notmuchmail.org Git - notmuch/blob - doc/notmuch-emacs.rst
62c1b709538a3c95568dbc1a466a9017b59f7c35
[notmuch] / doc / notmuch-emacs.rst
1 =============
2 notmuch-emacs
3 =============
4
5 About this Manual
6 =================
7
8 This manual covers only the Emacs interface to Notmuch. For information
9 on the command line interface, see section “Description” in the Notmuch
10 Manual Pages. To save typing, we will sometimes use *notmuch* in this
11 manual to refer to the Emacs interface to Notmuch. When this distinction
12 is important, we’ll refer to the Emacs interface as
13 *notmuch-emacs*.
14
15 Notmuch-emacs is highly customizable via the the Emacs customization
16 framework (or just by setting the appropriate variables). We try to
17 point out relevant variables in this manual, but in order to avoid
18 duplication of information, you can usually find the most detailed
19 description in the variables' docstring.
20
21 notmuch-hello
22 =============
23
24 .. index::
25    single: notmuch-hello
26    single: notmuch
27
28 ``notmuch-hello`` is the main entry point for Notmuch. You can start it
29 with ``M-x notmuch`` or ``M-x notmuch-hello``. The startup screen looks
30 something like the following. There are some hints at the bottom of the
31 screen. There are three main parts to the notmuch-hello screen,
32 discussed below. The **bold** text indicates buttons you can click with
33 a mouse or by positioning the cursor and pressing ``<return>``
34
35 |   Welcome to **notmuch** You have 52 messages.
36 |
37 | Saved searches: **[edit]**
38 |
39 |         52 **inbox**           52 **unread**
40 |
41 | Search: ____________________________________
42 |
43 | All tags: **[show]**
44 |
45 |        Hit \`?' for context-sensitive help in any Notmuch screen.
46 |                     Customize Notmuch or this page.
47
48 You can change the overall appearance of the notmuch-hello screen by
49 customizing the variable :index:`notmuch-hello-sections`.
50
51
52
53 notmuch-hello key bindings
54 --------------------------
55
56 ``<tab>``
57     Move to the next widget (button or text entry field)
58
59 ``<backspace>``
60     Move to the previous widget.
61
62 ``<return>``
63     Activate the current widget.
64
65 ``=``
66     Refresh the buffer; mainly update the counts of messages for various
67     saved searches.
68
69 ``G``
70     Import mail, See :ref:`importing`
71
72 ``m``
73     Compose a message
74
75 ``s``
76     Search the notmuch database using :ref:`notmuch-search`
77
78 ``v``
79     Print notmuch version
80
81 ``q``
82     Quit
83
84 .. _saved-searches:
85
86 Saved Searches
87 --------------
88
89 Since notmuch is entirely search-based, it's often useful to organize
90 mail around common searches.  To facilitate this, the first section of
91 notmuch-hello presents a customizable set of saved searches.  Saved
92 searches can also be accessed from anywhere in notmuch by pressing
93 ``j`` to access :ref:`notmuch-jump`.
94
95 The saved searches default to various common searches such as
96 ``tag:inbox`` to access the inbox and ``tag:unread`` to access all
97 unread mail, but there are several options for customization:
98
99 :index:`notmuch-saved-searches`
100     The list of saved searches, including names, queries, and
101     additional per-query options.
102
103 :index:`notmuch-saved-searches-sort-function`
104     This variable controls how saved searches should be sorted. A value
105     of ``nil`` displays the saved searches in the order they are stored
106     in ‘notmuch-saved-searches’.
107
108 :index:`notmuch-column-control`
109     Controls the number of columns for displaying saved-searches/tags
110
111 Search Box
112 ----------
113
114 The search box lets the user enter a Notmuch query. See section
115 “Description” in Notmuch Query Syntax, for more info on Notmuch query
116 syntax. A history of recent searches is also displayed by default. The
117 latter is controlled by the variable :index:`notmuch-hello-recent-searches-max`.
118
119 Known Tags
120 ----------
121
122 One special kind of saved search provided by default is for each
123 individual tag defined in the database. This can be controlled via the
124 following variables.
125
126 :index:`notmuch-hello-tag-list-make-query`
127     Control how to construct a search (“virtual folder”) from a given
128     tag.
129
130 :index:`notmuch-hello-hide-tags`
131     Which tags not to display at all.
132
133 :index:`notmuch-column-control`
134     Controls the number of columns for displaying saved-searches/tags
135
136 .. _notmuch-search:
137
138 notmuch-search
139 ==============
140
141 ``notmuch-search-mode`` is used to display the results from executing
142 a query via ``notmuch-search``. The syntax for these queries is the
143 the same as :ref:`saved-searches`. For details of this syntax see
144 info:notmuch-search-terms
145
146 By default the output approximates that of the command line See section
147 “Description” in notmuch search command.
148
149 The main purpose of the ``notmuch-search-mode`` buffer is to act as a
150 menu of results that the user can explore further by pressing
151 ``<return>`` on the appropriate line.
152
153 ``n,C-n,<down>``
154     Move to next line
155
156 ``p,C-p,<up>``
157     Move to previous line
158
159 ``<return>``
160     Open thread on current line in :ref:`notmuch-show` mode
161
162 ``?``
163     Display full set of key bindings
164
165 The presentation of results can be controlled by the following
166 variables.
167
168 :index:`notmuch-search-result-format`
169     Control how each thread of messages is presented in the
170     ``notmuch-show-mode`` buffer
171
172 :index:`notmuch-search-oldest-first`
173     Display the oldest threads at the top of the buffer
174
175 .. _notmuch-show:
176
177 notmuch-show
178 ============
179
180 ``notmuch-show-mode`` is used to display a single thread of email from
181 your email archives.
182
183 By default, various components of email messages, (citations,
184 signatures, already-read messages), are hidden. You can make
185 these parts visible by clicking with the mouse button or by
186 pressing RET after positioning the cursor on a hidden part.
187
188 ``<space>``
189     Scroll the current message (if necessary),
190     advance to the next message, or advance to the next thread (if
191     already on the last message of a thread).
192
193 ``N``
194     Move to next message
195
196 ``P``
197     Move to previous message (or start of current message)
198
199 ``n``
200     Move to next matching message
201
202 ``p``
203     Move to previous matching message
204
205 ``+,-``
206     Add or remove arbitrary tags from the current message.
207
208 ``?``
209     Display full set of key bindings
210
211 notmuch-tree
212 ============
213
214 Global key bindings
215 ===================
216
217 Several features are accessible from anywhere in notmuch through the
218 following key bindings:
219
220 ``j``
221     Jump to saved searches using :ref:`notmuch-jump`.
222
223 .. _notmuch-jump:
224
225 notmuch-jump
226 ------------
227
228 Saved searches configured through :ref:`saved-searches` can
229 include a "shortcut key" that's accessible through notmuch-jump.
230 Pressing ``j`` anywhere in notmuch followed by the configured shortcut
231 key of a saved search will immediately jump to that saved search.  For
232 example, in the default configuration ``j i`` jumps immediately to the
233 inbox search.  When you press ``j``, notmuch-jump shows the saved
234 searches and their shortcut keys in the mini-buffer.
235
236 Configuration
237 =============
238
239 .. _importing:
240
241 Importing Mail
242 --------------
243
244 :index:`notmuch-poll`
245
246 :index:`notmuch-poll-script`
247
248 Init File
249 ---------
250
251 When Notmuch is loaded, it will read the ``notmuch-init-file``
252 (``~/.emacs.d/notmuch-config`` by default) file. This is normal Emacs Lisp
253 file and can be used to avoid cluttering your ``~/.emacs`` with Notmuch
254 stuff. If the file with ``.elc``, ``.elc.gz``, ``.el`` or ``.el.gz``
255 suffix exist it will be read instead (just one of these, chosen in this
256 order). Most often users create ``~/.emacs.d/notmuch-config.el`` and just
257 work with it. If Emacs was invoked with the ``-q`` or ``--no-init-file``
258 options, ``notmuch-init-file`` is not read.