X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-mua.el;h=6fe5f6d0152ad855dca18c7fe451c15431b2a13a;hb=2ca941163da06aed564dab1990fb333fd7457ec2;hp=05763928fae06e32487d0f27431fce925e3ccbc4;hpb=3cdf105e0f875a04762e4e2cf43baf9a690db994;p=notmuch diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el index 05763928..6fe5f6d0 100644 --- a/emacs/notmuch-mua.el +++ b/emacs/notmuch-mua.el @@ -38,7 +38,7 @@ (declare-function notmuch-draft-postpone "notmuch-draft" ()) (declare-function notmuch-draft-save "notmuch-draft" ()) -;; +;;; Options (defcustom notmuch-mua-send-hook nil "Hook run before sending messages." @@ -82,10 +82,11 @@ If this is `nil' then no `User-Agent:' will be generated." :group 'notmuch) (defcustom notmuch-mua-cite-function 'message-cite-original - "*Function for citing an original message. + "Function for citing an original message. + Predefined functions include `message-cite-original' and -`message-cite-original-without-signature'. -Note that these functions use `mail-citation-hook' if that is non-nil." +`message-cite-original-without-signature'. Note that these +functions use `mail-citation-hook' if that is non-nil." :type '(radio (function-item message-cite-original) (function-item message-cite-original-without-signature) (function-item sc-cite-original) @@ -119,7 +120,7 @@ to `notmuch-mua-send-hook'." :type 'regexp :group 'notmuch-send) -;; +;;; Various functions (defun notmuch-mua-attachment-check () "Signal an error if the message text indicates that an @@ -214,6 +215,8 @@ Typically this is added to `notmuch-mua-send-hook'." (funcall original-func header references) (unless (bolp) (insert "\n"))) +;;; Mua reply + (defun notmuch-mua-reply (query-string &optional sender reply-all) (let ((args '("reply" "--format=sexp" "--format-version=4")) (process-crypto notmuch-show-process-crypto) @@ -317,6 +320,8 @@ Typically this is added to `notmuch-mua-send-hook'." (message-goto-body) (set-buffer-modified-p nil)) +;;; Mode and keymap + (defvar notmuch-message-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd "C-c C-c") #'notmuch-mua-send-and-exit) @@ -332,6 +337,8 @@ Typically this is added to `notmuch-mua-send-hook'." (put 'notmuch-message-mode 'flyspell-mode-predicate 'mail-mode-flyspell-verify) +;;; New messages + (defun notmuch-mua-pop-to-buffer (name switch-function) "Pop to buffer NAME, and warn if it already exists and is modified. Like `message-pop-to-buffer' but enable `notmuch-message-mode' @@ -527,6 +534,8 @@ will be addressed to all recipients of the source message." (notmuch-mua-reply query-string sender reply-all) (deactivate-mark))) +;;; Checks + (defun notmuch-mua-check-no-misplaced-secure-tag () "Query user if there is a misplaced secure mml tag. @@ -538,11 +547,11 @@ tag, or the user confirms they mean it." (goto-char (point-max)) (or ;; We are always fine if there is no secure tag. - (not (search-backward "<#secure" nil 't)) + (not (search-backward "<#secure" nil t)) ;; There is a secure tag, so it must be at the start of the ;; body, with no secure tag earlier (i.e., in the headers). (and (= (point) body-start) - (not (search-backward "<#secure" nil 't))) + (not (search-backward "<#secure" nil t))) ;; The user confirms they means it. (yes-or-no-p "\ There is a <#secure> tag not at the start of the body. It is @@ -569,6 +578,8 @@ The <#secure> tag at the start of the body is not followed by a newline. It is likely that the message will be sent unsigned and unencrypted. Really send? ")))) +;;; Finishing commands + (defun notmuch-mua-send-common (arg &optional exit) (interactive "P") (run-hooks 'notmuch-mua-send-hook) @@ -582,7 +593,7 @@ unencrypted. Really send? ")))) (defun notmuch-mua-send-and-exit (&optional arg) (interactive "P") - (notmuch-mua-send-common arg 't)) + (notmuch-mua-send-common arg t)) (defun notmuch-mua-send (&optional arg) (interactive "P") @@ -592,7 +603,7 @@ unencrypted. Really send? ")))) (interactive) (message-kill-buffer)) -;; +;;; _ (define-mail-user-agent 'notmuch-user-agent 'notmuch-mua-mail 'notmuch-mua-send-and-exit @@ -602,8 +613,6 @@ unencrypted. Really send? ")))) ;; composing a message. (notmuch-mua-add-more-hidden-headers) -;; - (provide 'notmuch-mua) ;;; notmuch-mua.el ends here