]> git.notmuchmail.org Git - notmuch/blob - emacs/notmuch-mua.el
Merge branch 'release'
[notmuch] / emacs / notmuch-mua.el
1 ;;; notmuch-mua.el --- emacs style mail-user-agent
2 ;;
3 ;; Copyright © David Edmondson
4 ;;
5 ;; This file is part of Notmuch.
6 ;;
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.
11 ;;
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.
16 ;;
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with Notmuch.  If not, see <https://www.gnu.org/licenses/>.
19 ;;
20 ;; Authors: David Edmondson <dme@dme.org>
21
22 ;;; Code:
23
24 (require 'message)
25 (require 'mm-view)
26 (require 'format-spec)
27
28 (require 'notmuch-lib)
29 (require 'notmuch-address)
30 (require 'notmuch-draft)
31
32 (eval-when-compile (require 'cl))
33
34 (declare-function notmuch-show-insert-body "notmuch-show" (msg body depth))
35 (declare-function notmuch-fcc-header-setup "notmuch-maildir-fcc" ())
36 (declare-function notmuch-maildir-message-do-fcc "notmuch-maildir-fcc" ())
37 (declare-function notmuch-draft-postpone "notmuch-draft" ())
38 (declare-function notmuch-draft-save "notmuch-draft" ())
39
40 ;;
41
42 (defcustom notmuch-mua-send-hook '(notmuch-mua-message-send-hook)
43   "Hook run before sending messages."
44   :type 'hook
45   :group 'notmuch-send
46   :group 'notmuch-hooks)
47
48 (defcustom notmuch-mua-compose-in 'current-window
49   (concat
50    "Where to create the mail buffer used to compose a new message.
51 Possible values are `current-window' (default), `new-window' and
52 `new-frame'. If set to `current-window', the mail buffer will be
53 displayed in the current window, so the old buffer will be
54 restored when the mail buffer is killed. If set to `new-window'
55 or `new-frame', the mail buffer will be displayed in a new
56 window/frame that will be destroyed when the buffer is killed.
57 You may want to customize `message-kill-buffer-on-exit'
58 accordingly."
59    (when (< emacs-major-version 24)
60            " Due to a known bug in Emacs 23, you should not set
61 this to `new-window' if `message-kill-buffer-on-exit' is
62 disabled: this would result in an incorrect behavior."))
63   :group 'notmuch-send
64   :type '(choice (const :tag "Compose in the current window" current-window)
65                  (const :tag "Compose mail in a new window"  new-window)
66                  (const :tag "Compose mail in a new frame"   new-frame)))
67
68 (defcustom notmuch-mua-user-agent-function nil
69   "Function used to generate a `User-Agent:' string. If this is
70 `nil' then no `User-Agent:' will be generated."
71   :type '(choice (const :tag "No user agent string" nil)
72                  (const :tag "Full" notmuch-mua-user-agent-full)
73                  (const :tag "Notmuch" notmuch-mua-user-agent-notmuch)
74                  (const :tag "Emacs" notmuch-mua-user-agent-emacs)
75                  (function :tag "Custom user agent function"
76                            :value notmuch-mua-user-agent-full))
77   :group 'notmuch-send)
78
79 (defcustom notmuch-mua-hidden-headers nil
80   "Headers that are added to the `message-mode' hidden headers
81 list."
82   :type '(repeat string)
83   :group 'notmuch-send)
84
85 (defgroup notmuch-reply nil
86   "Replying to messages in notmuch"
87   :group 'notmuch)
88
89 (defcustom notmuch-mua-cite-function 'message-cite-original
90   "*Function for citing an original message.
91 Predefined functions include `message-cite-original' and
92 `message-cite-original-without-signature'.
93 Note that these functions use `mail-citation-hook' if that is non-nil."
94   :type '(radio (function-item message-cite-original)
95                 (function-item message-cite-original-without-signature)
96                 (function-item sc-cite-original)
97                 (function :tag "Other"))
98   :link '(custom-manual "(message)Insertion Variables")
99   :group 'notmuch-reply)
100
101 (defcustom notmuch-mua-reply-insert-header-p-function
102   'notmuch-show-reply-insert-header-p-never
103   "Function to decide which parts get a header when replying.
104
105 This function specifies which parts of a mime message with
106 mutiple parts get a header."
107   :type '(radio (const :tag "No part headers"
108                                notmuch-show-reply-insert-header-p-never)
109                 (const :tag "All except multipart/* and hidden parts"
110                                notmuch-show-reply-insert-header-p-trimmed)
111                 (const :tag "Only for included text parts"
112                                notmuch-show-reply-insert-header-p-minimal)
113                 (const :tag "Exactly as in show view"
114                                notmuch-show-insert-header-p)
115                 (function :tag "Other"))
116   :group 'notmuch-reply)
117
118 ;;
119
120 (defun notmuch-mua-get-switch-function ()
121   "Get a switch function according to `notmuch-mua-compose-in'."
122   (cond ((eq notmuch-mua-compose-in 'current-window)
123          'switch-to-buffer)
124         ((eq notmuch-mua-compose-in 'new-window)
125          'switch-to-buffer-other-window)
126         ((eq notmuch-mua-compose-in 'new-frame)
127          'switch-to-buffer-other-frame)
128         (t (error "Invalid value for `notmuch-mua-compose-in'"))))
129
130 (defun notmuch-mua-maybe-set-window-dedicated ()
131   "Set the selected window as dedicated according to
132 `notmuch-mua-compose-in'."
133   (when (or (eq notmuch-mua-compose-in 'new-frame)
134             (eq notmuch-mua-compose-in 'new-window))
135     (set-window-dedicated-p (selected-window) t)))
136
137 (defun notmuch-mua-user-agent-full ()
138   "Generate a `User-Agent:' string suitable for notmuch."
139   (concat (notmuch-mua-user-agent-notmuch)
140           " "
141           (notmuch-mua-user-agent-emacs)))
142
143 (defun notmuch-mua-user-agent-notmuch ()
144   "Generate a `User-Agent:' string suitable for notmuch."
145   (let ((notmuch-version (if (string= notmuch-emacs-version "unknown")
146                              (notmuch-cli-version)
147                            notmuch-emacs-version)))
148     (concat "Notmuch/" notmuch-version " (https://notmuchmail.org)")))
149
150 (defun notmuch-mua-user-agent-emacs ()
151   "Generate a `User-Agent:' string suitable for notmuch."
152   (concat "Emacs/" emacs-version " (" system-configuration ")"))
153
154 (defun notmuch-mua-add-more-hidden-headers ()
155   "Add some headers to the list that are hidden by default."
156   (mapc (lambda (header)
157           (when (not (member header message-hidden-headers))
158             (push header message-hidden-headers)))
159         notmuch-mua-hidden-headers))
160
161 (defun notmuch-mua-reply-crypto (parts)
162   "Add mml sign-encrypt flag if any part of original message is encrypted."
163   (loop for part in parts
164         if (notmuch-match-content-type (plist-get part :content-type) "multipart/encrypted")
165           do (mml-secure-message-sign-encrypt)
166         else if (notmuch-match-content-type (plist-get part :content-type) "multipart/*")
167           do (notmuch-mua-reply-crypto (plist-get part :content))))
168
169 ;; There is a bug in emacs 23's message.el that results in a newline
170 ;; not being inserted after the References header, so the next header
171 ;; is concatenated to the end of it. This function fixes the problem,
172 ;; while guarding against the possibility that some current or future
173 ;; version of emacs has the bug fixed.
174 (defun notmuch-mua-insert-references (original-func header references)
175   (funcall original-func header references)
176   (unless (bolp) (insert "\n")))
177
178 (defun notmuch-mua-reply (query-string &optional sender reply-all)
179   (let ((args '("reply" "--format=sexp" "--format-version=1"))
180         (process-crypto notmuch-show-process-crypto)
181         reply
182         original)
183     (when process-crypto
184       (setq args (append args '("--decrypt"))))
185
186     (if reply-all
187         (setq args (append args '("--reply-to=all")))
188       (setq args (append args '("--reply-to=sender"))))
189     (setq args (append args (list query-string)))
190
191     ;; Get the reply object as SEXP, and parse it into an elisp object.
192     (setq reply (apply #'notmuch-call-notmuch-sexp args))
193
194     ;; Extract the original message to simplify the following code.
195     (setq original (plist-get reply :original))
196
197     ;; Extract the headers of both the reply and the original message.
198     (let* ((original-headers (plist-get original :headers))
199            (reply-headers (plist-get reply :reply-headers)))
200
201       ;; If sender is non-nil, set the From: header to its value.
202       (when sender
203         (plist-put reply-headers :From sender))
204       (let
205           ;; Overlay the composition window on that being used to read
206           ;; the original message.
207           ((same-window-regexps '("\\*mail .*")))
208
209         ;; We modify message-header-format-alist to get around a bug in message.el.
210         ;; See the comment above on notmuch-mua-insert-references.
211         (let ((message-header-format-alist
212                (loop for pair in message-header-format-alist
213                      if (eq (car pair) 'References)
214                      collect (cons 'References
215                                    (apply-partially
216                                     'notmuch-mua-insert-references
217                                     (cdr pair)))
218                      else
219                      collect pair)))
220           (notmuch-mua-mail (plist-get reply-headers :To)
221                             (plist-get reply-headers :Subject)
222                             (notmuch-headers-plist-to-alist reply-headers)
223                             nil (notmuch-mua-get-switch-function))))
224
225       ;; Insert the message body - but put it in front of the signature
226       ;; if one is present, and after any other content
227       ;; message*setup-hooks may have added to the message body already.
228       (save-restriction
229         (message-goto-body)
230         (narrow-to-region (point) (point-max))
231         (goto-char (point-max))
232         (if (re-search-backward message-signature-separator nil t)
233             (if message-signature-insert-empty-line
234                 (forward-line -1))
235           (goto-char (point-max))))
236
237       (let ((from (plist-get original-headers :From))
238             (date (plist-get original-headers :Date))
239             (start (point)))
240
241         ;; notmuch-mua-cite-function constructs a citation line based
242         ;; on the From and Date headers of the original message, which
243         ;; are assumed to be in the buffer.
244         (insert "From: " from "\n")
245         (insert "Date: " date "\n\n")
246
247         (insert (with-temp-buffer
248                   (let
249                       ;; Don't attempt to clean up messages, excerpt
250                       ;; citations, etc. in the original message before
251                       ;; quoting.
252                       ((notmuch-show-insert-text/plain-hook nil)
253                        ;; Don't omit long parts.
254                        (notmuch-show-max-text-part-size 0)
255                        ;; Insert headers for parts as appropriate for replying.
256                        (notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function)
257                        ;; Ensure that any encrypted parts are
258                        ;; decrypted during the generation of the reply
259                        ;; text.
260                        (notmuch-show-process-crypto process-crypto)
261                        ;; Don't indent multipart sub-parts.
262                        (notmuch-show-indent-multipart nil))
263                     ;; We don't want sigstatus buttons (an information leak and usually wrong anyway).
264                     (letf (((symbol-function 'notmuch-crypto-insert-sigstatus-button) #'ignore)
265                            ((symbol-function 'notmuch-crypto-insert-encstatus-button) #'ignore))
266                           (notmuch-show-insert-body original (plist-get original :body) 0)
267                           (buffer-substring-no-properties (point-min) (point-max))))))
268
269         (set-mark (point))
270         (goto-char start)
271         ;; Quote the original message according to the user's configured style.
272         (funcall notmuch-mua-cite-function)))
273
274     ;; Crypto processing based crypto content of the original message
275     (when process-crypto
276       (notmuch-mua-reply-crypto (plist-get original :body))))
277
278   ;; Push mark right before signature, if any.
279   (message-goto-signature)
280   (unless (eobp)
281     (end-of-line -1))
282   (push-mark)
283
284   (message-goto-body)
285   (set-buffer-modified-p nil))
286
287 (define-derived-mode notmuch-message-mode message-mode "Message[Notmuch]"
288   "Notmuch message composition mode. Mostly like `message-mode'"
289   (notmuch-address-setup))
290
291 (put 'notmuch-message-mode 'flyspell-mode-predicate 'mail-mode-flyspell-verify)
292
293 (define-key notmuch-message-mode-map (kbd "C-c C-c") #'notmuch-mua-send-and-exit)
294 (define-key notmuch-message-mode-map (kbd "C-c C-s") #'notmuch-mua-send)
295 (define-key notmuch-message-mode-map (kbd "C-c C-p") #'notmuch-draft-postpone)
296 (define-key notmuch-message-mode-map (kbd "C-x C-s") #'notmuch-draft-save)
297
298 (defun notmuch-mua-pop-to-buffer (name switch-function)
299   "Pop to buffer NAME, and warn if it already exists and is
300 modified. This function is notmuch addaptation of
301 `message-pop-to-buffer'."
302   (let ((buffer (get-buffer name)))
303     (if (and buffer
304              (buffer-name buffer))
305         (let ((window (get-buffer-window buffer 0)))
306           (if window
307               ;; Raise the frame already displaying the message buffer.
308               (progn
309                 (gnus-select-frame-set-input-focus (window-frame window))
310                 (select-window window))
311             (funcall switch-function buffer)
312             (set-buffer buffer))
313           (when (and (buffer-modified-p)
314                      (not (prog1
315                               (y-or-n-p
316                                "Message already being composed; erase? ")
317                             (message nil))))
318             (error "Message being composed")))
319       (funcall switch-function name)
320       (set-buffer name))
321     (erase-buffer)
322     (notmuch-message-mode)))
323
324 (defun notmuch-mua-mail (&optional to subject other-headers continue
325                                    switch-function yank-action send-actions
326                                    return-action &rest ignored)
327   "Invoke the notmuch mail composition window."
328   (interactive)
329
330   (when notmuch-mua-user-agent-function
331     (let ((user-agent (funcall notmuch-mua-user-agent-function)))
332       (when (not (string= "" user-agent))
333         (push (cons 'User-Agent user-agent) other-headers))))
334
335   (unless (assq 'From other-headers)
336     (push (cons 'From (message-make-from
337                        (notmuch-user-name) (notmuch-user-primary-email))) other-headers))
338
339   (notmuch-mua-pop-to-buffer (message-buffer-name "mail" to)
340                              (or switch-function (notmuch-mua-get-switch-function)))
341   (let ((headers
342          (append
343           ;; The following is copied from `message-mail'
344           `((To . ,(or to "")) (Subject . ,(or subject "")))
345           ;; C-h f compose-mail says that headers should be specified as
346           ;; (string . value); however all the rest of message expects
347           ;; headers to be symbols, not strings (eg message-header-format-alist).
348           ;; https://lists.gnu.org/archive/html/emacs-devel/2011-01/msg00337.html
349           ;; We need to convert any string input, eg from rmail-start-mail.
350           (dolist (h other-headers other-headers)
351             (if (stringp (car h)) (setcar h (intern (capitalize (car h))))))))
352         (args (list yank-action send-actions))
353         ;; Cause `message-setup-1' to do things relevant for mail,
354         ;; such as observe `message-default-mail-headers'.
355         (message-this-is-mail t))
356     ;; message-setup-1 in Emacs 23 does not accept return-action
357     ;; argument. Pass it only if it is supplied by the caller. This
358     ;; will never be the case when we're called by `compose-mail' in
359     ;; Emacs 23.
360     (when return-action (nconc args '(return-action)))
361     (apply 'message-setup-1 headers args))
362   (notmuch-fcc-header-setup)
363   (message-sort-headers)
364   (message-hide-headers)
365   (set-buffer-modified-p nil)
366   (notmuch-mua-maybe-set-window-dedicated)
367
368   (message-goto-to))
369
370 (defcustom notmuch-identities nil
371   "Identities that can be used as the From: address when composing a new message.
372
373 If this variable is left unset, then a list will be constructed from the
374 name and addresses configured in the notmuch configuration file."
375   :type '(repeat string)
376   :group 'notmuch-send)
377
378 (defcustom notmuch-always-prompt-for-sender nil
379   "Always prompt for the From: address when composing or forwarding a message.
380
381 This is not taken into account when replying to a message, because in that case
382 the From: header is already filled in by notmuch."
383   :type 'boolean
384   :group 'notmuch-send)
385
386 (defvar notmuch-mua-sender-history nil)
387
388 ;; Workaround: Running `ido-completing-read' in emacs 23.1, 23.2 and 23.3
389 ;; without some explicit initialization fill freeze the operation.
390 ;; Hence, we advice `ido-completing-read' to ensure required initialization
391 ;; is done.
392 (if (and (= emacs-major-version 23) (< emacs-minor-version 4))
393     (defadvice ido-completing-read (before notmuch-ido-mode-init activate)
394       (ido-init-completion-maps)
395       (add-hook 'minibuffer-setup-hook 'ido-minibuffer-setup)
396       (add-hook 'choose-completion-string-functions
397                 'ido-choose-completion-string)
398       (ad-disable-advice 'ido-completing-read 'before 'notmuch-ido-mode-init)
399       (ad-activate 'ido-completing-read)))
400
401 (defun notmuch-mua-prompt-for-sender ()
402   "Prompt for a sender from the user's configured identities."
403   (if notmuch-identities
404       (ido-completing-read "Send mail from: " notmuch-identities
405                            nil nil nil 'notmuch-mua-sender-history
406                            (car notmuch-identities))
407     (let* ((name (notmuch-user-name))
408            (addrs (cons (notmuch-user-primary-email)
409                         (notmuch-user-other-email)))
410            (address
411             (ido-completing-read (concat "Sender address for " name ": ") addrs
412                                  nil nil nil 'notmuch-mua-sender-history
413                                  (car addrs))))
414       (message-make-from name address))))
415
416 (put 'notmuch-mua-new-mail 'notmuch-prefix-doc "... and prompt for sender")
417 (defun notmuch-mua-new-mail (&optional prompt-for-sender)
418   "Compose new mail.
419
420 If PROMPT-FOR-SENDER is non-nil, the user will be prompted for
421 the From: address first."
422   (interactive "P")
423   (let ((other-headers
424          (when (or prompt-for-sender notmuch-always-prompt-for-sender)
425            (list (cons 'From (notmuch-mua-prompt-for-sender))))))
426     (notmuch-mua-mail nil nil other-headers nil (notmuch-mua-get-switch-function))))
427
428 (defun notmuch-mua-new-forward-messages (messages &optional prompt-for-sender)
429   "Compose a new message forwarding MESSAGES.
430
431 If PROMPT-FOR-SENDER is non-nil, the user will be prompteed for
432 the From: address."
433   (let* ((other-headers
434           (when (or prompt-for-sender notmuch-always-prompt-for-sender)
435             (list (cons 'From (notmuch-mua-prompt-for-sender)))))
436          forward-subject) ;; Comes from the first message and is
437                           ;; applied later.
438
439     ;; Generate the template for the outgoing message.
440     (notmuch-mua-mail nil "" other-headers nil (notmuch-mua-get-switch-function))
441
442     (save-excursion
443       ;; Insert all of the forwarded messages.
444       (mapc (lambda (id)
445               (let ((temp-buffer (get-buffer-create
446                                   (concat "*notmuch-fwd-raw-" id "*"))))
447                 ;; Get the raw version of this message in the buffer.
448                 (with-current-buffer temp-buffer
449                   (erase-buffer)
450                   (let ((coding-system-for-read 'no-conversion))
451                     (call-process notmuch-command nil t nil "show" "--format=raw" id))
452                   ;; Because we process the messages in reverse order,
453                   ;; always generate a forwarded subject, then use the
454                   ;; last (i.e. first) one.
455                   (setq forward-subject (message-make-forward-subject)))
456                 ;; Make a copy ready to be forwarded in the
457                 ;; composition buffer.
458                 (message-forward-make-body temp-buffer)
459                 ;; Kill the temporary buffer.
460                 (kill-buffer temp-buffer)))
461             ;; `message-forward-make-body' always puts the message at
462             ;; the top, so do them in reverse order.
463             (reverse messages))
464
465       ;; Add in the appropriate subject.
466       (save-restriction
467         (message-narrow-to-headers)
468         (message-remove-header "Subject")
469         (message-add-header (concat "Subject: " forward-subject)))
470
471       ;; `message-forward-make-body' shows the User-agent header.  Hide
472       ;; it again.
473       (message-hide-headers)
474       (set-buffer-modified-p nil))))
475
476 (defun notmuch-mua-new-reply (query-string &optional prompt-for-sender reply-all)
477   "Compose a reply to the message identified by QUERY-STRING.
478
479 If PROMPT-FOR-SENDER is non-nil, the user will be prompted for
480 the From: address first.  If REPLY-ALL is non-nil, the message
481 will be addressed to all recipients of the source message."
482
483 ;; In current emacs (24.3) select-active-regions is set to t by
484 ;; default. The reply insertion code sets the region to the quoted
485 ;; message to make it easy to delete (kill-region or C-w). These two
486 ;; things combine to put the quoted message in the primary selection.
487 ;;
488 ;; This is not what the user wanted and is a privacy risk (accidental
489 ;; pasting of the quoted message). We can avoid some of the problems
490 ;; by let-binding select-active-regions to nil. This fixes if the
491 ;; primary selection was previously in a non-emacs window but not if
492 ;; it was in an emacs window. To avoid the problem in the latter case
493 ;; we deactivate mark.
494
495   (let ((sender
496          (when prompt-for-sender
497            (notmuch-mua-prompt-for-sender)))
498         (select-active-regions nil))
499     (notmuch-mua-reply query-string sender reply-all)
500     (deactivate-mark)))
501
502 (defun notmuch-mua-check-no-misplaced-secure-tag ()
503   "Query user if there is a misplaced secure mml tag.
504
505 Emacs message-send will (probably) ignore a secure mml tag unless
506 it is at the start of the body. Returns t if there is no such
507 tag, or the user confirms they mean it."
508   (save-excursion
509     (let ((body-start (progn (message-goto-body) (point))))
510       (goto-char (point-max))
511       (or
512        ;; We are always fine if there is no secure tag.
513        (not (search-backward "<#secure" nil 't))
514        ;; There is a secure tag, so it must be at the start of the
515        ;; body, with no secure tag earlier (i.e., in the headers).
516        (and (= (point) body-start)
517             (not (search-backward "<#secure" nil 't)))
518        ;; The user confirms they means it.
519        (yes-or-no-p "\
520 There is a <#secure> tag not at the start of the body. It is
521 likely that the message will be sent unsigned and unencrypted.
522 Really send? ")))))
523
524 (defun notmuch-mua-check-secure-tag-has-newline ()
525   "Query if the secure mml tag has a newline following it.
526
527 Emacs message-send will (probably) ignore a correctly placed
528 secure mml tag unless it is followed by a newline. Returns t if
529 any secure tag is followed by a newline, or the user confirms
530 they mean it."
531   (save-excursion
532     (message-goto-body)
533     (or
534      ;; There is no (correctly placed) secure tag.
535      (not (looking-at "<#secure"))
536      ;; The secure tag is followed by a newline.
537      (looking-at "<#secure[^\n>]*>\n")
538      ;; The user confirms they means it.
539      (yes-or-no-p "\
540 The <#secure> tag at the start of the body is not followed by a
541 newline. It is likely that the message will be sent unsigned and
542 unencrypted.  Really send? "))))
543
544 (defun notmuch-mua-send-common (arg &optional exit)
545   (interactive "P")
546   (when (and (notmuch-mua-check-no-misplaced-secure-tag)
547              (notmuch-mua-check-secure-tag-has-newline))
548     (letf (((symbol-function 'message-do-fcc) #'notmuch-maildir-message-do-fcc))
549           (if exit
550               (message-send-and-exit arg)
551             (message-send arg)))))
552
553 (defun notmuch-mua-send-and-exit (&optional arg)
554   (interactive "P")
555   (notmuch-mua-send-common arg 't))
556
557 (defun notmuch-mua-send (&optional arg)
558   (interactive "P")
559   (notmuch-mua-send-common arg))
560
561 (defun notmuch-mua-kill-buffer ()
562   (interactive)
563   (message-kill-buffer))
564
565 (defun notmuch-mua-message-send-hook ()
566   "The default function used for `notmuch-mua-send-hook', this
567 simply runs the corresponding `message-mode' hook functions."
568   (run-hooks 'message-send-hook))
569
570 ;;
571
572 (define-mail-user-agent 'notmuch-user-agent
573   'notmuch-mua-mail 'notmuch-mua-send-and-exit
574   'notmuch-mua-kill-buffer 'notmuch-mua-send-hook)
575
576 ;; Add some more headers to the list that `message-mode' hides when
577 ;; composing a message.
578 (notmuch-mua-add-more-hidden-headers)
579
580 ;;
581
582 (provide 'notmuch-mua)
583
584 ;;; notmuch-mua.el ends here