2021-09-19 08:57:44 +02:00
|
|
|
|
;;; mu4e-compose.el -- part of mu4e -*- lexical-binding: t -*-
|
2020-02-11 12:23:40 +01:00
|
|
|
|
|
2022-01-23 09:29:45 +01:00
|
|
|
|
;; Copyright (C) 2011-2022 Dirk-Jan C. Binnema
|
2011-09-18 13:39:36 +02:00
|
|
|
|
|
|
|
|
|
;; Author: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
|
|
|
|
;; Maintainer: Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
|
|
|
|
|
|
|
|
|
|
;; This file is not part of GNU Emacs.
|
2020-02-11 12:23:40 +01:00
|
|
|
|
|
2021-05-29 23:36:13 +02:00
|
|
|
|
;; mu4e is free software: you can redistribute it and/or modify
|
2011-09-18 13:39:36 +02:00
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
2021-05-29 23:36:13 +02:00
|
|
|
|
;; mu4e is distributed in the hope that it will be useful,
|
2011-09-18 13:39:36 +02:00
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2021-05-29 23:36:13 +02:00
|
|
|
|
;; along with mu4e. If not, see <http://www.gnu.org/licenses/>.
|
2011-09-18 13:39:36 +02:00
|
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
|
|
;; In this file, various functions to compose/send messages, piggybacking on
|
2011-10-10 07:38:14 +02:00
|
|
|
|
;; gnus' message mode
|
2011-09-18 13:39:36 +02:00
|
|
|
|
|
2012-10-29 11:27:32 +01:00
|
|
|
|
;; Magic / Rupe Goldberg
|
|
|
|
|
|
|
|
|
|
;; 1) When we reply/forward a message, we get it from the backend, ie:
|
|
|
|
|
;; we send to the backend (mu4e-compose):
|
|
|
|
|
;; compose type:reply docid:30935
|
|
|
|
|
;; backend responds with:
|
|
|
|
|
;; (:compose reply :original ( .... <original message> ))
|
|
|
|
|
|
|
|
|
|
;; 2) When we compose a message, message and headers are separated by
|
|
|
|
|
;; `mail-header-separator', ie. '--text follows this line--. We use
|
|
|
|
|
;; before-save-hook and after-save-hook to remove/re-add this special line, so
|
|
|
|
|
;; it stays in the buffer, but never hits the disk.
|
|
|
|
|
;; see:
|
|
|
|
|
;; mu4e~compose-insert-mail-header-separator
|
|
|
|
|
;; mu4e~compose-remove-mail-header-separator
|
|
|
|
|
;;
|
|
|
|
|
;; (maybe we can get away with remove it only just before sending? what does
|
|
|
|
|
;; gnus do?)
|
|
|
|
|
|
|
|
|
|
;; 3) When sending a message, we want to do a few things:
|
|
|
|
|
;; a) move the message from drafts to the sent folder (maybe; depends on
|
|
|
|
|
;; `mu4e-sent-messages-behavior')
|
|
|
|
|
;; b) if it's a reply, mark the replied-to message as "R", i.e. replied
|
2017-03-18 09:24:51 +01:00
|
|
|
|
;; if it's a forward, mark the forwarded message as "P", i.e.
|
|
|
|
|
;; passed (forwarded)
|
2012-10-29 11:27:32 +01:00
|
|
|
|
;; c) kill all buffers looking at the sent message
|
|
|
|
|
|
|
|
|
|
;; a) is dealt with by message-mode, but we need to tell it where to move the
|
|
|
|
|
;; sent message. We do this by adding an Fcc: header with the target folder,
|
2013-02-21 19:47:03 +01:00
|
|
|
|
;; see `mu4e~compose-setup-fcc-maybe'. Since message-mode does not natively
|
2012-10-29 11:27:32 +01:00
|
|
|
|
;; understand maildirs, we also need to tell it what to do, so we also set
|
|
|
|
|
;; `message-fcc-handler-function' there. Finally, we add the the message in
|
|
|
|
|
;; the sent-folder to the database.
|
|
|
|
|
;;
|
|
|
|
|
;; b) this is handled in `mu4e~compose-set-parent-flag'
|
|
|
|
|
;;
|
|
|
|
|
;; c) this is handled in our handler for the `sent'-message from the backend
|
|
|
|
|
;; (`mu4e-sent-handler')
|
|
|
|
|
|
2011-09-18 13:39:36 +02:00
|
|
|
|
;;; Code:
|
2020-02-11 15:10:35 +01:00
|
|
|
|
|
2019-08-19 12:41:33 +02:00
|
|
|
|
(require 'cl-lib)
|
2011-09-18 13:39:36 +02:00
|
|
|
|
(require 'message)
|
|
|
|
|
(require 'mail-parse)
|
2011-12-29 00:25:52 +01:00
|
|
|
|
(require 'smtpmail)
|
2011-09-18 13:39:36 +02:00
|
|
|
|
|
2021-08-29 18:53:53 +02:00
|
|
|
|
(require 'mu4e-server)
|
2012-05-01 21:45:54 +02:00
|
|
|
|
(require 'mu4e-actions)
|
2012-09-26 16:28:30 +02:00
|
|
|
|
(require 'mu4e-message)
|
2012-10-31 19:33:46 +01:00
|
|
|
|
(require 'mu4e-draft)
|
2017-03-18 09:24:51 +01:00
|
|
|
|
(require 'mu4e-context)
|
|
|
|
|
|
2021-08-29 16:30:10 +02:00
|
|
|
|
|
|
|
|
|
;;; Configuration
|
|
|
|
|
;; see mu4e-drafts.el
|
|
|
|
|
|
2020-02-18 22:39:30 +01:00
|
|
|
|
;;; Attachments
|
2017-01-13 16:30:25 +01:00
|
|
|
|
(defun mu4e-compose-attach-message (msg)
|
|
|
|
|
"Insert message MSG as an attachment."
|
|
|
|
|
(let ((path (plist-get msg :path)))
|
|
|
|
|
(unless (file-exists-p path)
|
|
|
|
|
(mu4e-warn "Message file not found"))
|
|
|
|
|
(mml-attach-file
|
2020-02-11 12:00:46 +01:00
|
|
|
|
path
|
|
|
|
|
"message/rfc822"
|
|
|
|
|
(or (plist-get msg :subject) "No subject")
|
|
|
|
|
"attachment")))
|
2017-01-13 16:30:25 +01:00
|
|
|
|
|
2012-09-25 08:37:37 +02:00
|
|
|
|
(defun mu4e-compose-attach-captured-message ()
|
2012-11-10 14:01:17 +01:00
|
|
|
|
"Insert the last captured message file as an attachment.
|
|
|
|
|
Messages are captured with `mu4e-action-capture-message'."
|
2016-07-11 23:25:05 +02:00
|
|
|
|
(interactive)
|
2012-04-26 17:08:42 +02:00
|
|
|
|
(unless mu4e-captured-message
|
2012-09-06 09:33:53 +02:00
|
|
|
|
(mu4e-warn "No message has been captured"))
|
2017-01-13 16:30:25 +01:00
|
|
|
|
(mu4e-compose-attach-message mu4e-captured-message))
|
|
|
|
|
|
2020-02-18 22:39:30 +01:00
|
|
|
|
;;; Misc
|
2012-04-30 16:34:51 +02:00
|
|
|
|
|
2012-04-26 17:08:42 +02:00
|
|
|
|
;; 'fcc' refers to saving a copy of a sent message to a certain folder. that's
|
2021-09-19 08:57:44 +02:00
|
|
|
|
|
2012-04-26 17:08:42 +02:00
|
|
|
|
;; what these 'Sent mail' folders are for!
|
|
|
|
|
;;
|
|
|
|
|
;; We let message mode take care of this by adding a field
|
2012-07-22 23:55:12 +02:00
|
|
|
|
|
2012-04-26 17:08:42 +02:00
|
|
|
|
;; Fcc: <full-path-to-message-in-target-folder>
|
2012-07-22 23:55:12 +02:00
|
|
|
|
|
|
|
|
|
;; in the "message-send-hook" (ie., just before sending). message mode will
|
|
|
|
|
;; then take care of the saving when the message is actually sent.
|
2012-04-26 17:08:42 +02:00
|
|
|
|
;;
|
|
|
|
|
;; note, where and if you make this copy depends on the value of
|
|
|
|
|
;; `mu4e-sent-messages-behavior'.
|
|
|
|
|
|
2012-10-31 19:33:46 +01:00
|
|
|
|
(defun mu4e~compose-setup-fcc-maybe ()
|
2012-11-10 14:01:17 +01:00
|
|
|
|
"Maybe setup Fcc, based on `mu4e-sent-messages-behavior'.
|
|
|
|
|
If needed, set the Fcc header, and register the handler function."
|
2013-04-21 11:40:57 +02:00
|
|
|
|
(let* ((sent-behavior
|
2020-02-11 12:00:46 +01:00
|
|
|
|
;; Note; we cannot simply use functionp here, since at least
|
|
|
|
|
;; delete is a function, too...
|
|
|
|
|
(if (member mu4e-sent-messages-behavior '(delete trash sent))
|
|
|
|
|
mu4e-sent-messages-behavior
|
|
|
|
|
(if (functionp mu4e-sent-messages-behavior)
|
|
|
|
|
(funcall mu4e-sent-messages-behavior)
|
|
|
|
|
mu4e-sent-messages-behavior)))
|
|
|
|
|
(mdir
|
2022-01-23 09:29:45 +01:00
|
|
|
|
(pcase sent-behavior
|
|
|
|
|
('delete nil)
|
|
|
|
|
('trash (mu4e-get-trash-folder mu4e-compose-parent-message))
|
|
|
|
|
('sent (mu4e-get-sent-folder mu4e-compose-parent-message))
|
|
|
|
|
(_ (mu4e-error
|
|
|
|
|
"Unsupported value %S for `mu4e-sent-messages-behavior'"
|
|
|
|
|
mu4e-sent-messages-behavior))))
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(fccfile (and mdir
|
|
|
|
|
(concat (mu4e-root-maildir) mdir "/cur/"
|
|
|
|
|
(mu4e~draft-message-filename-construct "S")))))
|
2012-04-26 17:08:42 +02:00
|
|
|
|
;; if there's an fcc header, add it to the file
|
2013-04-23 18:51:45 +02:00
|
|
|
|
(when fccfile
|
|
|
|
|
(message-add-header (concat "Fcc: " fccfile "\n"))
|
|
|
|
|
;; sadly, we cannot define as 'buffer-local'... this will screw up gnus
|
2016-07-11 23:25:05 +02:00
|
|
|
|
;; etc. if you run it after mu4e so, (hack hack) we reset it to the old
|
|
|
|
|
;; handler after we've done our thing.
|
2012-04-26 17:08:42 +02:00
|
|
|
|
(setq message-fcc-handler-function
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(let ((maildir mdir)
|
|
|
|
|
(old-handler message-fcc-handler-function))
|
|
|
|
|
(lambda (file)
|
2021-09-19 08:57:44 +02:00
|
|
|
|
(setq message-fcc-handler-function old-handler)
|
|
|
|
|
;; reset the fcc handler
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(let ((mdir-path (concat (mu4e-root-maildir) maildir)))
|
2021-09-19 08:57:44 +02:00
|
|
|
|
;; Create the full maildir structure for the sent folder if it
|
|
|
|
|
;; doesn't exist. `mu4e--server-mkdir` runs asynchronously but
|
|
|
|
|
;; no matter whether it runs before or after `write-file`, the
|
|
|
|
|
;; sent maildir ends up in the correct state.
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(unless (file-exists-p mdir-path)
|
2021-08-29 18:53:53 +02:00
|
|
|
|
(mu4e--server-mkdir mdir-path)))
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(write-file file) ;; writing maildirs files is easy
|
2021-08-29 18:53:53 +02:00
|
|
|
|
(mu4e--server-add file))))))) ;; update the database
|
2012-04-26 17:08:42 +02:00
|
|
|
|
|
2013-06-08 16:54:35 +02:00
|
|
|
|
(defvar mu4e-compose-hidden-headers
|
2013-05-26 11:35:14 +02:00
|
|
|
|
`("^References:" "^Face:" "^X-Face:"
|
2020-02-11 12:00:46 +01:00
|
|
|
|
"^X-Draft-From:" "^User-agent:")
|
2013-05-26 11:35:14 +02:00
|
|
|
|
"Hidden headers when composing.")
|
|
|
|
|
|
2013-06-08 16:54:35 +02:00
|
|
|
|
(defun mu4e~compose-hide-headers ()
|
|
|
|
|
"Hide the headers as per `mu4e-compose-hidden-headers'."
|
|
|
|
|
(let ((message-hidden-headers mu4e-compose-hidden-headers))
|
|
|
|
|
(message-hide-headers)))
|
|
|
|
|
|
2013-05-26 11:35:14 +02:00
|
|
|
|
(defconst mu4e~compose-address-fields-regexp
|
|
|
|
|
"^\\(To\\|B?Cc\\|Reply-To\\|From\\):")
|
|
|
|
|
|
2012-04-26 17:08:42 +02:00
|
|
|
|
(defun mu4e~compose-register-message-save-hooks ()
|
2019-05-25 16:38:58 +02:00
|
|
|
|
"Just before saving, we remove the `mail-header-separator'.
|
|
|
|
|
Just after saving we restore it; thus, the separator should never
|
2019-10-20 15:13:32 +02:00
|
|
|
|
appear on disk. Also update the Date and ensure we have a
|
|
|
|
|
Message-ID."
|
2012-04-26 17:08:42 +02:00
|
|
|
|
(add-hook 'before-save-hook
|
2020-11-13 11:38:50 +01:00
|
|
|
|
#'mu4e~compose-before-save-hook-fn
|
|
|
|
|
nil t)
|
2012-04-26 17:08:42 +02:00
|
|
|
|
(add-hook 'after-save-hook
|
2020-11-13 11:38:50 +01:00
|
|
|
|
#'mu4e~compose-after-save-hook-fn
|
|
|
|
|
nil t))
|
|
|
|
|
|
2021-11-07 10:43:17 +01:00
|
|
|
|
(defvar-local mu4e~compose-undo nil
|
|
|
|
|
"Remember the undo-state.")
|
|
|
|
|
|
2020-11-13 11:38:50 +01:00
|
|
|
|
(defun mu4e~compose-before-save-hook-fn ()
|
2020-12-05 10:40:54 +01:00
|
|
|
|
"Add the message-id if necessary and update the date."
|
2021-11-07 10:43:17 +01:00
|
|
|
|
(setq mu4e~compose-undo buffer-undo-list)
|
2020-11-13 11:38:50 +01:00
|
|
|
|
(save-excursion
|
2020-12-05 10:40:54 +01:00
|
|
|
|
(save-restriction
|
|
|
|
|
(message-narrow-to-headers)
|
|
|
|
|
(unless (message-fetch-field "Message-ID")
|
2021-08-19 09:56:56 +02:00
|
|
|
|
(message-generate-headers '(Message-ID)))
|
|
|
|
|
(message-generate-headers '(Date)))
|
2020-11-13 11:38:50 +01:00
|
|
|
|
(save-match-data
|
|
|
|
|
(mu4e~draft-remove-mail-header-separator))))
|
|
|
|
|
|
|
|
|
|
(defun mu4e~compose-after-save-hook-fn ()
|
|
|
|
|
(save-match-data
|
|
|
|
|
(mu4e~compose-set-friendly-buffer-name)
|
|
|
|
|
(mu4e~draft-insert-mail-header-separator)
|
|
|
|
|
;; hide some headers again
|
|
|
|
|
(widen)
|
|
|
|
|
(mu4e~compose-hide-headers)
|
|
|
|
|
(set-buffer-modified-p nil)
|
|
|
|
|
(mu4e-message "Saved (%d lines)" (count-lines (point-min) (point-max)))
|
|
|
|
|
;; update the file on disk -- ie., without the separator
|
2021-11-07 10:43:17 +01:00
|
|
|
|
(mu4e--server-add (buffer-file-name)))
|
|
|
|
|
(setq buffer-undo-list mu4e~compose-undo))
|
2020-11-13 11:38:50 +01:00
|
|
|
|
|
2014-11-30 15:29:10 +01:00
|
|
|
|
|
2020-02-11 15:10:35 +01:00
|
|
|
|
;;; address completion
|
|
|
|
|
|
|
|
|
|
;; inspired by org-contacts.el and
|
2014-11-30 15:29:10 +01:00
|
|
|
|
;; https://github.com/nordlow/elisp/blob/master/mine/completion-styles-cycle.el
|
2020-02-11 15:10:35 +01:00
|
|
|
|
|
2015-12-29 17:53:57 +01:00
|
|
|
|
(defun mu4e~compose-complete-handler (str pred action)
|
2019-05-25 16:38:58 +02:00
|
|
|
|
"Complete address STR with predication PRED for ACTION."
|
2015-12-29 17:53:57 +01:00
|
|
|
|
(cond
|
2020-02-11 12:00:46 +01:00
|
|
|
|
((eq action nil)
|
2022-05-09 20:22:17 +02:00
|
|
|
|
(try-completion str mu4e--contacts-set pred))
|
2020-02-11 12:00:46 +01:00
|
|
|
|
((eq action t)
|
2022-05-09 20:22:17 +02:00
|
|
|
|
(all-completions str mu4e--contacts-set pred))
|
2020-02-11 12:00:46 +01:00
|
|
|
|
((eq action 'metadata)
|
|
|
|
|
;; our contacts are already sorted - just need to tell the
|
|
|
|
|
;; completion machinery not to try to undo that...
|
|
|
|
|
'(metadata
|
|
|
|
|
(display-sort-function . identity)
|
|
|
|
|
(cycle-sort-function . identity)))))
|
2012-06-24 15:34:01 +02:00
|
|
|
|
|
2014-11-30 15:29:10 +01:00
|
|
|
|
(defun mu4e~compose-complete-contact (&optional start)
|
|
|
|
|
"Complete the text at START with a contact.
|
2022-05-27 20:00:37 +02:00
|
|
|
|
Ie. either \"name <email>\" or \"email\")."
|
2014-11-30 15:29:10 +01:00
|
|
|
|
(interactive)
|
|
|
|
|
(let ((mail-abbrev-mode-regexp mu4e~compose-address-fields-regexp)
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(eoh ;; end-of-headers
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(search-forward-regexp mail-header-separator nil t))))
|
2014-11-30 15:29:10 +01:00
|
|
|
|
;; try to complete only when we're in the headers area,
|
|
|
|
|
;; looking at an address field.
|
|
|
|
|
(when (and eoh (> eoh (point)) (mail-abbrev-in-expansion-header-p))
|
|
|
|
|
(let* ((end (point))
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(start
|
|
|
|
|
(or start
|
|
|
|
|
(save-excursion
|
|
|
|
|
(re-search-backward "\\(\\`\\|[\n:,]\\)[ \t]*")
|
|
|
|
|
(goto-char (match-end 0))
|
|
|
|
|
(point)))))
|
|
|
|
|
(list start end 'mu4e~compose-complete-handler)))))
|
2015-12-29 17:53:57 +01:00
|
|
|
|
|
2012-06-22 08:45:06 +02:00
|
|
|
|
(defun mu4e~compose-setup-completion ()
|
2014-11-30 15:29:10 +01:00
|
|
|
|
"Set up auto-completion of addresses."
|
|
|
|
|
(set (make-local-variable 'completion-ignore-case) t)
|
|
|
|
|
(set (make-local-variable 'completion-cycle-threshold) 7)
|
2015-12-30 16:42:08 +01:00
|
|
|
|
(add-to-list (make-local-variable 'completion-styles) 'substring)
|
2014-11-30 15:29:10 +01:00
|
|
|
|
(add-hook 'completion-at-point-functions
|
2020-02-11 12:00:46 +01:00
|
|
|
|
'mu4e~compose-complete-contact nil t))
|
2014-11-30 15:29:10 +01:00
|
|
|
|
|
2015-11-22 11:17:36 +01:00
|
|
|
|
(defun mu4e~remove-refs-maybe ()
|
2019-05-25 16:38:58 +02:00
|
|
|
|
"Remove References: if In-Reply-To: is missing.
|
|
|
|
|
This allows the user to effectively start a new message-thread by
|
|
|
|
|
removing the In-Reply-To header."
|
2015-11-22 11:17:36 +01:00
|
|
|
|
(unless (message-fetch-field "in-reply-to")
|
|
|
|
|
(message-remove-header "References")))
|
|
|
|
|
|
2020-02-18 22:39:30 +01:00
|
|
|
|
;;; Compose Mode
|
2020-02-11 15:10:35 +01:00
|
|
|
|
|
2014-11-30 15:29:10 +01:00
|
|
|
|
(defvar mu4e-compose-mode-map nil
|
|
|
|
|
"Keymap for \"*mu4e-compose*\" buffers.")
|
|
|
|
|
(unless mu4e-compose-mode-map
|
|
|
|
|
(setq mu4e-compose-mode-map
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(let ((map (make-sparse-keymap)))
|
|
|
|
|
(define-key map (kbd "C-S-u") 'mu4e-update-mail-and-index)
|
|
|
|
|
(define-key map (kbd "C-c C-u") 'mu4e-update-mail-and-index)
|
|
|
|
|
(define-key map (kbd "C-c C-k") 'mu4e-message-kill-buffer)
|
2021-11-07 11:46:15 +01:00
|
|
|
|
(define-key map (kbd "C-c ;") 'mu4e-compose-context-switch)
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(define-key map (kbd "M-q") 'mu4e-fill-paragraph)
|
|
|
|
|
map)))
|
2012-07-22 23:55:12 +02:00
|
|
|
|
|
2016-05-07 02:41:04 +02:00
|
|
|
|
(defun mu4e-fill-paragraph (&optional region)
|
2019-05-25 16:38:58 +02:00
|
|
|
|
"Re-layout either the whole message or REGION.
|
|
|
|
|
If variable `use-hard-newlines', takes a multi-line paragraph and
|
|
|
|
|
makes it into a single line of text. Assume paragraphs are
|
|
|
|
|
separated by blank lines. If variable `use-hard-newlines' is not
|
|
|
|
|
set, this simply executes `fill-paragraph'."
|
2016-05-07 02:41:04 +02:00
|
|
|
|
;; Inspired by https://www.emacswiki.org/emacs/UnfillParagraph
|
|
|
|
|
(interactive (progn (barf-if-buffer-read-only) '(t)))
|
2021-03-11 18:40:32 +01:00
|
|
|
|
(ignore-errors
|
|
|
|
|
(if mu4e-compose-format-flowed
|
|
|
|
|
(let ((fill-column (point-max))
|
|
|
|
|
(use-hard-newlines nil)); rfill "across" hard newlines
|
|
|
|
|
(when (use-region-p)
|
|
|
|
|
(delete-trailing-whitespace (region-beginning) (region-end)))
|
|
|
|
|
(fill-paragraph nil region))
|
|
|
|
|
(when (use-region-p)
|
|
|
|
|
(delete-trailing-whitespace (region-beginning) (region-end)))
|
|
|
|
|
(fill-paragraph nil region))))
|
2016-05-07 02:41:04 +02:00
|
|
|
|
|
2016-05-06 15:53:34 +02:00
|
|
|
|
(defun mu4e-toggle-use-hard-newlines ()
|
|
|
|
|
(interactive)
|
|
|
|
|
(setq use-hard-newlines (not use-hard-newlines))
|
|
|
|
|
(if use-hard-newlines
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(turn-off-auto-fill)
|
2016-05-06 15:53:34 +02:00
|
|
|
|
(turn-on-auto-fill)))
|
|
|
|
|
|
2016-07-09 22:42:58 +02:00
|
|
|
|
(defun mu4e~compose-remap-faces ()
|
2019-05-25 16:38:58 +02:00
|
|
|
|
"Remap `message-mode' faces to mu4e ones.
|
|
|
|
|
Our parent `message-mode' uses font-locking for the compose
|
2016-07-09 22:42:58 +02:00
|
|
|
|
buffers; lets remap its faces so it uses the ones for mu4e."
|
|
|
|
|
;; normal headers
|
2022-08-27 04:29:56 +02:00
|
|
|
|
(face-remap-add-relative 'message-header-name 'mu4e-header-field-face)
|
|
|
|
|
(face-remap-add-relative 'message-header-other 'mu4e-header-value-face)
|
2016-07-09 22:42:58 +02:00
|
|
|
|
;; special headers
|
2022-08-27 04:29:56 +02:00
|
|
|
|
(face-remap-add-relative 'message-header-from 'mu4e-contact-face)
|
|
|
|
|
(face-remap-add-relative 'message-header-to 'mu4e-contact-face)
|
|
|
|
|
(face-remap-add-relative 'message-header-cc 'mu4e-contact-face)
|
|
|
|
|
(face-remap-add-relative 'message-header-bcc 'mu4e-contact-face)
|
2022-08-27 04:51:16 +02:00
|
|
|
|
(face-remap-add-relative 'message-header-subject 'mu4e-special-header-value-face))
|
2016-07-09 22:42:58 +02:00
|
|
|
|
|
2012-04-23 19:35:14 +02:00
|
|
|
|
(define-derived-mode mu4e-compose-mode message-mode "mu4e:compose"
|
2012-04-11 21:31:52 +02:00
|
|
|
|
"Major mode for the mu4e message composition, derived from `message-mode'.
|
2012-03-28 00:47:52 +02:00
|
|
|
|
\\{message-mode-map}."
|
2013-06-16 22:06:38 +02:00
|
|
|
|
(progn
|
2012-04-23 19:35:14 +02:00
|
|
|
|
(use-local-map mu4e-compose-mode-map)
|
2021-08-28 13:56:31 +02:00
|
|
|
|
|
|
|
|
|
(mu4e-context-minor-mode)
|
|
|
|
|
(define-key mu4e-context-minor-mode-map (kbd ";") nil)
|
|
|
|
|
(define-key mu4e-context-minor-mode-map (kbd "C-c C-;")
|
|
|
|
|
#'mu4e-compose-context-switch)
|
2021-08-30 21:02:49 +02:00
|
|
|
|
|
2014-10-12 09:36:33 +02:00
|
|
|
|
(set (make-local-variable 'message-signature) mu4e-compose-signature)
|
|
|
|
|
;; set this to allow mu4e to work when gnus-agent is unplugged in gnus
|
|
|
|
|
(set (make-local-variable 'message-send-mail-real-function) nil)
|
2017-01-02 14:56:40 +01:00
|
|
|
|
;; Set to nil to enable `electric-quote-local-mode' to work:
|
2021-03-10 19:49:40 +01:00
|
|
|
|
(make-local-variable 'comment-use-syntax)
|
|
|
|
|
(setq comment-use-syntax nil)
|
2016-07-09 22:42:58 +02:00
|
|
|
|
;; message-mode has font-locking, but uses its own faces. Let's
|
|
|
|
|
;; use the mu4e-specific ones instead
|
|
|
|
|
(mu4e~compose-remap-faces)
|
2012-04-26 17:08:42 +02:00
|
|
|
|
(mu4e~compose-register-message-save-hooks)
|
2012-06-24 15:34:01 +02:00
|
|
|
|
;; offer completion for e-mail addresses
|
2014-11-30 15:29:10 +01:00
|
|
|
|
(when mu4e-compose-complete-addresses
|
2022-05-09 20:22:17 +02:00
|
|
|
|
(unless mu4e--contacts-set
|
2021-08-29 16:30:10 +02:00
|
|
|
|
;; work-around for https://github.com/djcb/mu/issues/1016
|
|
|
|
|
(mu4e--request-contacts-maybe))
|
2012-06-22 08:45:06 +02:00
|
|
|
|
(mu4e~compose-setup-completion))
|
2019-01-29 10:35:06 +01:00
|
|
|
|
(if mu4e-compose-format-flowed
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(progn
|
|
|
|
|
(turn-off-auto-fill)
|
|
|
|
|
(setq truncate-lines nil
|
|
|
|
|
word-wrap t
|
|
|
|
|
mml-enable-flowed t
|
|
|
|
|
use-hard-newlines t)
|
|
|
|
|
(visual-line-mode t))
|
2019-01-29 10:35:06 +01:00
|
|
|
|
(setq mml-enable-flowed nil))
|
2016-05-06 11:12:23 +02:00
|
|
|
|
|
2020-04-06 19:47:29 +02:00
|
|
|
|
;; set the attachment dir to something more reasonable than the draft
|
|
|
|
|
;; directory.
|
|
|
|
|
(setq default-directory (mu4e~get-attachment-dir))
|
|
|
|
|
|
2017-01-06 02:11:34 +01:00
|
|
|
|
(let ((keymap (lookup-key message-mode-map [menu-bar text])))
|
|
|
|
|
(when keymap
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(define-key-after
|
|
|
|
|
keymap
|
|
|
|
|
[mu4e-hard-newlines]
|
|
|
|
|
'(menu-item "Format=flowed" mu4e-toggle-use-hard-newlines
|
|
|
|
|
:button (:toggle . use-hard-newlines)
|
|
|
|
|
:help "Toggle format=flowed"
|
|
|
|
|
:visible (eq major-mode 'mu4e-compose-mode)
|
|
|
|
|
:enable mu4e-compose-format-flowed)
|
|
|
|
|
'sep)
|
|
|
|
|
|
|
|
|
|
(define-key-after
|
|
|
|
|
keymap
|
|
|
|
|
[mu4e-electric-quote-mode]
|
|
|
|
|
'(menu-item "Electric quote" electric-quote-local-mode
|
|
|
|
|
:button (:toggle . electric-quote-mode)
|
|
|
|
|
:help "Toggle Electric quote mode"
|
|
|
|
|
:visible (and (eq major-mode 'mu4e-compose-mode)
|
|
|
|
|
(functionp 'electric-quote-local-mode)))
|
|
|
|
|
'mu4e-hard-newlines)))
|
2016-07-03 22:29:05 +02:00
|
|
|
|
|
|
|
|
|
(when (lookup-key mml-mode-map [menu-bar Attachments])
|
|
|
|
|
(define-key-after
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(lookup-key mml-mode-map [menu-bar Attachments])
|
|
|
|
|
[mu4e-compose-attach-captured-message]
|
|
|
|
|
'(menu-item "Attach captured message"
|
|
|
|
|
mu4e-compose-attach-captured-message
|
|
|
|
|
:help "Attach message captured in Headers View (with 'a c')"
|
|
|
|
|
:visible (eq major-mode 'mu4e-compose-mode))
|
|
|
|
|
(quote Attach\ External...)))
|
2016-05-10 21:55:54 +02:00
|
|
|
|
|
2012-05-23 16:04:26 +02:00
|
|
|
|
;; setup the fcc-stuff, if needed
|
|
|
|
|
(add-hook 'message-send-hook
|
2020-11-13 11:38:50 +01:00
|
|
|
|
#'mu4e~setup-fcc-message-sent-hook-fn
|
|
|
|
|
nil t)
|
2012-05-23 16:04:26 +02:00
|
|
|
|
;; when the message has been sent.
|
|
|
|
|
(add-hook 'message-sent-hook
|
2020-11-13 11:38:50 +01:00
|
|
|
|
#'mu4e~set-sent-handler-message-sent-hook-fn
|
|
|
|
|
nil t))
|
2012-10-29 11:27:32 +01:00
|
|
|
|
;; mark these two hooks as permanent-local, so they'll survive mode-changes
|
2013-06-08 16:54:35 +02:00
|
|
|
|
;; (put 'mu4e~compose-save-before-sending 'permanent-local-hook t)
|
2012-10-29 11:27:32 +01:00
|
|
|
|
(put 'mu4e~compose-mark-after-sending 'permanent-local-hook t))
|
2012-03-28 00:47:52 +02:00
|
|
|
|
|
2020-11-13 11:38:50 +01:00
|
|
|
|
(defun mu4e~setup-fcc-message-sent-hook-fn ()
|
|
|
|
|
;; mu4e~compose-save-before-sending
|
|
|
|
|
;; when in-reply-to was removed, remove references as well.
|
|
|
|
|
(when (eq mu4e-compose-type 'reply)
|
|
|
|
|
(mu4e~remove-refs-maybe))
|
|
|
|
|
(when use-hard-newlines
|
|
|
|
|
(mu4e-send-harden-newlines))
|
|
|
|
|
;; for safety, always save the draft before sending
|
|
|
|
|
(set-buffer-modified-p t)
|
|
|
|
|
(save-buffer)
|
|
|
|
|
(mu4e~compose-setup-fcc-maybe)
|
|
|
|
|
(widen))
|
|
|
|
|
|
|
|
|
|
(defun mu4e~set-sent-handler-message-sent-hook-fn ()
|
|
|
|
|
;; mu4e~compose-mark-after-sending
|
|
|
|
|
(setq mu4e-sent-func 'mu4e-sent-handler)
|
2021-08-29 18:53:53 +02:00
|
|
|
|
(mu4e--server-sent (buffer-file-name)))
|
2020-11-13 11:38:50 +01:00
|
|
|
|
|
2016-05-06 11:12:23 +02:00
|
|
|
|
(defun mu4e-send-harden-newlines ()
|
|
|
|
|
"Set the hard property to all newlines."
|
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(while (search-forward "\n" nil t)
|
|
|
|
|
(put-text-property (1- (point)) (point) 'hard t))))
|
|
|
|
|
|
2012-04-23 19:35:14 +02:00
|
|
|
|
(defconst mu4e~compose-buffer-max-name-length 30
|
2012-04-01 20:36:13 +02:00
|
|
|
|
"Maximum length of the mu4e-send-buffer-name.")
|
|
|
|
|
|
2012-04-23 19:35:14 +02:00
|
|
|
|
(defun mu4e~compose-set-friendly-buffer-name (&optional compose-type)
|
2019-05-25 16:38:58 +02:00
|
|
|
|
"Set some user-friendly buffer name based on the COMPOSE-TYPE."
|
2012-04-01 20:36:13 +02:00
|
|
|
|
(let* ((subj (message-field-value "subject"))
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(subj (unless (and subj (string-match "^[:blank:]*$" subj)) subj))
|
|
|
|
|
(str (or subj
|
2022-01-23 09:29:45 +01:00
|
|
|
|
(pcase compose-type
|
|
|
|
|
('reply "*reply*")
|
|
|
|
|
('forward "*forward*")
|
|
|
|
|
(_ "*draft*")))))
|
2012-04-01 20:36:13 +02:00
|
|
|
|
(rename-buffer (generate-new-buffer-name
|
2021-09-19 08:57:44 +02:00
|
|
|
|
(truncate-string-to-width
|
|
|
|
|
str mu4e~compose-buffer-max-name-length)
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(buffer-name)))))
|
2013-06-16 22:06:38 +02:00
|
|
|
|
|
2020-05-27 21:53:41 +02:00
|
|
|
|
(defun mu4e-compose-crypto-message (parent compose-type)
|
2019-05-25 16:38:58 +02:00
|
|
|
|
"Possibly encrypt or sign a message based on PARENT and COMPOSE-TYPE.
|
2020-05-27 21:53:41 +02:00
|
|
|
|
See `mu4e-compose-crypto-policy' for more details."
|
|
|
|
|
(let* ((encrypted-p
|
|
|
|
|
(and parent (memq 'encrypted (mu4e-message-field parent :flags))))
|
|
|
|
|
(encrypt
|
|
|
|
|
(or (memq 'encrypt-all-messages mu4e-compose-crypto-policy)
|
|
|
|
|
;; new messages
|
|
|
|
|
(and (memq 'encrypt-new-messages mu4e-compose-crypto-policy)
|
|
|
|
|
(eq compose-type 'new))
|
|
|
|
|
;; forwarded messages
|
|
|
|
|
(and (eq compose-type 'forward)
|
|
|
|
|
(memq 'encrypt-forwarded-messages mu4e-compose-crypto-policy))
|
|
|
|
|
;; edited messages
|
|
|
|
|
(and (eq compose-type 'edit)
|
|
|
|
|
(memq 'encrypt-edited-messages mu4e-compose-crypto-policy))
|
|
|
|
|
;; all replies
|
|
|
|
|
(and (eq compose-type 'reply)
|
|
|
|
|
(memq 'encrypt-all-replies mu4e-compose-crypto-policy))
|
|
|
|
|
;; plain replies
|
|
|
|
|
(and (eq compose-type 'reply) (not encrypted-p)
|
|
|
|
|
(memq 'encrypt-plain-replies mu4e-compose-crypto-policy))
|
|
|
|
|
;; encrypted replies
|
|
|
|
|
(and (eq compose-type 'reply) encrypted-p
|
2021-09-19 08:57:44 +02:00
|
|
|
|
(memq 'encrypt-encrypted-replies
|
|
|
|
|
mu4e-compose-crypto-policy))))
|
2020-05-27 21:53:41 +02:00
|
|
|
|
(sign
|
|
|
|
|
(or (memq 'sign-all-messages mu4e-compose-crypto-policy)
|
|
|
|
|
;; new messages
|
|
|
|
|
(and (eq compose-type 'new)
|
|
|
|
|
(memq 'sign-new-messages mu4e-compose-crypto-policy))
|
|
|
|
|
;; forwarded messages
|
|
|
|
|
(and (eq compose-type 'forward)
|
|
|
|
|
(memq 'sign-forwarded-messages mu4e-compose-crypto-policy))
|
|
|
|
|
;; edited messages
|
|
|
|
|
(and (eq compose-type 'edit)
|
|
|
|
|
(memq 'sign-edited-messages mu4e-compose-crypto-policy))
|
|
|
|
|
;; all replies
|
|
|
|
|
(and (eq compose-type 'reply)
|
|
|
|
|
(memq 'sign-all-replies mu4e-compose-crypto-policy))
|
|
|
|
|
;; plain replies
|
|
|
|
|
(and (eq compose-type 'reply) (not encrypted-p)
|
|
|
|
|
(memq 'sign-plain-replies mu4e-compose-crypto-policy))
|
|
|
|
|
;; encrypted replies
|
|
|
|
|
(and (eq compose-type 'reply) encrypted-p
|
|
|
|
|
(memq 'sign-encrypted-replies mu4e-compose-crypto-policy)))))
|
|
|
|
|
(cond ((and sign encrypt)
|
|
|
|
|
(mml-secure-message-sign-encrypt))
|
|
|
|
|
(sign (mml-secure-message-sign))
|
2020-03-09 10:30:59 +01:00
|
|
|
|
(encrypt (mml-secure-message-encrypt)))))
|
2017-08-27 04:47:36 +02:00
|
|
|
|
|
2021-04-03 23:23:21 +02:00
|
|
|
|
(cl-defun mu4e~compose-handler (compose-type &optional original-msg includes
|
|
|
|
|
switch-function)
|
2012-04-16 19:54:58 +02:00
|
|
|
|
"Create a new draft message, or open an existing one.
|
2011-10-02 20:35:03 +02:00
|
|
|
|
|
|
|
|
|
COMPOSE-TYPE determines the kind of message to compose and is a
|
2016-02-16 07:13:03 +01:00
|
|
|
|
symbol, either `reply', `forward', `edit', `resend' `new'. `edit'
|
|
|
|
|
is for editing existing (draft) messages. When COMPOSE-TYPE is
|
|
|
|
|
`reply' or `forward', MSG should be a message plist. If
|
|
|
|
|
COMPOSE-TYPE is `new', ORIGINAL-MSG should be nil.
|
2011-10-02 20:35:03 +02:00
|
|
|
|
|
2012-01-14 11:55:50 +01:00
|
|
|
|
Optionally (when forwarding, replying) ORIGINAL-MSG is the original
|
|
|
|
|
message we will forward / reply to.
|
|
|
|
|
|
2017-01-13 16:30:25 +01:00
|
|
|
|
Optionally (when inline forwarding) INCLUDES contains a list of
|
2021-04-05 22:35:58 +02:00
|
|
|
|
(:file-name <filename> :mime-type <mime-type>
|
|
|
|
|
:description <description> :disposition <disposition>)
|
|
|
|
|
or
|
|
|
|
|
(:buffer-name <filename> :mime-type <mime-type>
|
|
|
|
|
:description <description> :disposition <disposition>)
|
2020-05-12 23:56:55 +02:00
|
|
|
|
for the attachments to include; file-name refers to
|
2012-01-14 11:55:50 +01:00
|
|
|
|
a file which our backend has conveniently saved for us (as a
|
2021-04-05 22:35:58 +02:00
|
|
|
|
tempfile). The properties :mime-type, :description and :disposition
|
|
|
|
|
are optional."
|
2012-10-29 11:27:32 +01:00
|
|
|
|
|
2012-10-01 15:43:47 +02:00
|
|
|
|
;; Run the hooks defined for `mu4e-compose-pre-hook'. If compose-type is
|
|
|
|
|
;; `reply', `forward' or `edit', `mu4e-compose-parent-message' points to the
|
|
|
|
|
;; message being forwarded or replied to, otherwise it is nil.
|
2012-10-01 20:18:06 +02:00
|
|
|
|
(set (make-local-variable 'mu4e-compose-parent-message) original-msg)
|
|
|
|
|
(put 'mu4e-compose-parent-message 'permanent-local t)
|
2020-02-11 12:00:46 +01:00
|
|
|
|
;; remember the compose-type
|
2016-09-06 17:29:05 +02:00
|
|
|
|
(set (make-local-variable 'mu4e-compose-type) compose-type)
|
|
|
|
|
(put 'mu4e-compose-type 'permanent-local t)
|
2015-12-23 21:01:51 +01:00
|
|
|
|
;; maybe switch the context
|
2021-08-28 13:56:31 +02:00
|
|
|
|
(mu4e--context-autoswitch mu4e-compose-parent-message
|
|
|
|
|
mu4e-compose-context-policy)
|
2012-10-29 11:27:32 +01:00
|
|
|
|
(run-hooks 'mu4e-compose-pre-hook)
|
2021-09-19 08:57:44 +02:00
|
|
|
|
;; this opens (or re-opens) a message with all the basic headers set.
|
2016-06-09 07:22:56 +02:00
|
|
|
|
(let ((winconf (current-window-configuration)))
|
|
|
|
|
(condition-case nil
|
2021-04-03 23:23:21 +02:00
|
|
|
|
(mu4e-draft-open compose-type original-msg switch-function)
|
2016-06-09 07:22:56 +02:00
|
|
|
|
(quit (set-window-configuration winconf)
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(mu4e-message "Operation aborted")
|
|
|
|
|
(cl-return-from mu4e~compose-handler))))
|
2012-09-27 09:03:58 +02:00
|
|
|
|
;; insert mail-header-separator, which is needed by message mode to separate
|
|
|
|
|
;; headers and body. will be removed before saving to disk
|
2012-10-31 19:33:46 +01:00
|
|
|
|
(mu4e~draft-insert-mail-header-separator)
|
2020-05-27 21:53:41 +02:00
|
|
|
|
|
2016-07-11 23:25:05 +02:00
|
|
|
|
;; maybe encrypt/sign replies
|
2021-10-21 21:04:58 +02:00
|
|
|
|
(mu4e-compose-crypto-message original-msg compose-type)
|
2020-05-27 21:53:41 +02:00
|
|
|
|
|
2017-01-13 16:30:25 +01:00
|
|
|
|
;; include files -- e.g. when inline forwarding a message with
|
|
|
|
|
;; attachments, we take those from the original.
|
2012-09-27 09:03:58 +02:00
|
|
|
|
(save-excursion
|
|
|
|
|
(goto-char (point-max)) ;; put attachments at the end
|
2017-01-13 16:30:25 +01:00
|
|
|
|
|
|
|
|
|
(if (and (eq compose-type 'forward) mu4e-compose-forward-as-attachment)
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(mu4e-compose-attach-message original-msg)
|
2017-01-13 16:30:25 +01:00
|
|
|
|
(dolist (att includes)
|
2021-04-05 22:35:58 +02:00
|
|
|
|
(let ((file-name (plist-get att :file-name))
|
|
|
|
|
(mime (plist-get att :mime-type))
|
|
|
|
|
(description (plist-get att :description))
|
|
|
|
|
(disposition (plist-get att :disposition)))
|
|
|
|
|
(if file-name
|
|
|
|
|
(mml-attach-file file-name mime description disposition)
|
|
|
|
|
(mml-attach-buffer (plist-get att :buffer-name)
|
|
|
|
|
mime description disposition))))))
|
2018-12-12 20:35:46 +01:00
|
|
|
|
|
2012-09-27 09:03:58 +02:00
|
|
|
|
(mu4e~compose-set-friendly-buffer-name compose-type)
|
2016-06-08 18:25:52 +02:00
|
|
|
|
|
2012-12-15 11:01:50 +01:00
|
|
|
|
;; bind to `mu4e-compose-parent-message' of compose buffer
|
|
|
|
|
(set (make-local-variable 'mu4e-compose-parent-message) original-msg)
|
|
|
|
|
(put 'mu4e-compose-parent-message 'permanent-local t)
|
2020-03-16 21:41:39 +01:00
|
|
|
|
;; set mu4e-compose-type once more for this buffer,
|
|
|
|
|
(set (make-local-variable 'mu4e-compose-type) compose-type)
|
|
|
|
|
(put 'mu4e-compose-type 'permanent-local t)
|
2016-06-08 18:25:52 +02:00
|
|
|
|
|
2016-07-11 23:25:05 +02:00
|
|
|
|
;; hide some headers
|
2013-06-08 16:54:35 +02:00
|
|
|
|
(mu4e~compose-hide-headers)
|
2012-09-25 06:10:41 +02:00
|
|
|
|
;; switch on the mode
|
2016-02-20 11:25:21 +01:00
|
|
|
|
(mu4e-compose-mode)
|
2022-06-30 21:09:15 +02:00
|
|
|
|
|
|
|
|
|
;; now jump to some useful positions, and start writing that mail!
|
|
|
|
|
(if (member compose-type '(new forward))
|
|
|
|
|
(message-goto-to)
|
|
|
|
|
;; otherwise, it depends...
|
|
|
|
|
(pcase message-cite-reply-position
|
|
|
|
|
((or 'above 'traditional) (message-goto-body))
|
|
|
|
|
(_ (when (message-goto-signature) (forward-line -2)))))
|
|
|
|
|
|
2020-02-26 20:11:06 +01:00
|
|
|
|
;; don't allow undoing anything before this.
|
|
|
|
|
(setq buffer-undo-list nil)
|
2016-11-05 09:18:23 +01:00
|
|
|
|
|
2016-02-20 11:25:21 +01:00
|
|
|
|
(when mu4e-compose-in-new-frame
|
2016-02-21 15:33:55 +01:00
|
|
|
|
;; make sure to close the frame when we're done with the message these are
|
|
|
|
|
;; all buffer-local;
|
2016-02-20 11:25:21 +01:00
|
|
|
|
(push 'delete-frame message-exit-actions)
|
2018-12-12 20:35:46 +01:00
|
|
|
|
(push 'delete-frame message-postpone-actions))
|
|
|
|
|
|
|
|
|
|
;; buffer is not user-modified yet
|
|
|
|
|
(set-buffer-modified-p nil))
|
2014-10-15 01:42:57 +02:00
|
|
|
|
|
2017-05-18 03:42:52 +02:00
|
|
|
|
(defun mu4e~switch-back-to-mu4e-buffer ()
|
|
|
|
|
"Try to go back to some previous buffer, in the order view->headers->main."
|
|
|
|
|
(unless (eq mu4e-split-view 'single-window)
|
|
|
|
|
(if (buffer-live-p (mu4e-get-view-buffer))
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(switch-to-buffer (mu4e-get-view-buffer))
|
2017-05-18 03:42:52 +02:00
|
|
|
|
(if (buffer-live-p (mu4e-get-headers-buffer))
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(switch-to-buffer (mu4e-get-headers-buffer))
|
|
|
|
|
;; if all else fails, back to the main view
|
|
|
|
|
(when (fboundp 'mu4e) (mu4e))))))
|
2017-05-18 03:42:52 +02:00
|
|
|
|
|
2021-02-20 13:04:08 +01:00
|
|
|
|
(defun mu4e-compose-context-switch (&optional force name)
|
|
|
|
|
"Change the context for the current draft message.
|
|
|
|
|
|
2021-11-10 20:37:31 +01:00
|
|
|
|
With NAME, switch to the context with NAME, and with FORCE non-nil,
|
|
|
|
|
switch even if the switch is to the same context.
|
|
|
|
|
|
|
|
|
|
Like `mu4e-context-switch' but with some changes after switching:
|
|
|
|
|
1. Update the From and Organization headers as per the new context
|
|
|
|
|
2. Update the message-signature as per the new context.
|
|
|
|
|
|
|
|
|
|
Unlike some earlier version of this function, does _not_ update
|
|
|
|
|
the draft folder for the messages, as that would require changing
|
|
|
|
|
the file under our feet, which is a bit fragile."
|
2021-02-20 13:04:08 +01:00
|
|
|
|
(interactive "P")
|
2021-11-10 20:37:31 +01:00
|
|
|
|
|
|
|
|
|
(unless (derived-mode-p 'mu4e-compose-mode)
|
|
|
|
|
(mu4e-error "Only available in mu4e compose buffers"))
|
|
|
|
|
|
|
|
|
|
(let ((old-context (mu4e-context-current)))
|
|
|
|
|
(unless (and name (not force) (eq old-context name))
|
|
|
|
|
(unless (and (not force)
|
|
|
|
|
(eq old-context (mu4e-context-switch nil name)))
|
|
|
|
|
(save-excursion
|
|
|
|
|
;; Change From / Organization if needed.
|
|
|
|
|
(message-replace-header "Organization"
|
|
|
|
|
(or (message-make-organization) "")
|
|
|
|
|
'("Subject")) ;; keep in same place
|
|
|
|
|
(message-replace-header "From"
|
|
|
|
|
(or (mu4e~draft-from-construct) ""))
|
|
|
|
|
;; Update signature.
|
|
|
|
|
(when (message-goto-signature) ;; delete old signature.
|
|
|
|
|
(if message-signature-insert-empty-line
|
|
|
|
|
(forward-line -2) (forward-line -1))
|
|
|
|
|
(delete-region (point) (point-max)))
|
|
|
|
|
(if (and mu4e-compose-signature-auto-include mu4e-compose-signature)
|
|
|
|
|
(let ((message-signature mu4e-compose-signature))
|
|
|
|
|
(save-excursion (message-insert-signature)))))))))
|
2021-02-20 13:04:08 +01:00
|
|
|
|
|
2012-03-27 20:15:47 +02:00
|
|
|
|
(defun mu4e-sent-handler (docid path)
|
2019-05-25 16:38:58 +02:00
|
|
|
|
"Handler called with DOCID and PATH for the just-sent message.
|
|
|
|
|
For Forwarded ('Passed') and Replied messages, try to set the
|
|
|
|
|
appropriate flag at the message forwarded or replied-to."
|
2012-04-26 17:08:42 +02:00
|
|
|
|
(mu4e~compose-set-parent-flag path)
|
|
|
|
|
(when (file-exists-p path) ;; maybe the draft was not saved at all
|
2021-08-29 18:53:53 +02:00
|
|
|
|
(mu4e--server-remove docid))
|
2012-06-14 08:57:47 +02:00
|
|
|
|
;; kill any remaining buffers for the draft file, or they will hang around...
|
|
|
|
|
;; this seems a bit hamfisted...
|
2020-11-16 08:25:14 +01:00
|
|
|
|
(when message-kill-buffer-on-exit
|
|
|
|
|
(dolist (buf (buffer-list))
|
|
|
|
|
(and (buffer-file-name buf)
|
|
|
|
|
(string= (buffer-file-name buf) path)
|
|
|
|
|
(kill-buffer buf))))
|
2017-05-18 03:42:52 +02:00
|
|
|
|
(mu4e~switch-back-to-mu4e-buffer)
|
2012-06-14 08:57:47 +02:00
|
|
|
|
(mu4e-message "Message sent"))
|
2012-03-28 17:58:43 +02:00
|
|
|
|
|
2016-02-01 21:33:18 +01:00
|
|
|
|
(defun mu4e-message-kill-buffer ()
|
|
|
|
|
"Wrapper around `message-kill-buffer'.
|
|
|
|
|
It restores mu4e window layout after killing the compose-buffer."
|
|
|
|
|
(interactive)
|
|
|
|
|
(let ((current-buffer (current-buffer)))
|
|
|
|
|
(message-kill-buffer)
|
|
|
|
|
;; Compose buffer killed
|
|
|
|
|
(when (not (equal current-buffer (current-buffer)))
|
|
|
|
|
;; Restore mu4e
|
|
|
|
|
(if mu4e-compose-in-new-frame
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(delete-frame)
|
|
|
|
|
(mu4e~switch-back-to-mu4e-buffer)))))
|
2016-02-01 21:33:18 +01:00
|
|
|
|
|
2012-04-26 17:08:42 +02:00
|
|
|
|
(defun mu4e~compose-set-parent-flag (path)
|
2022-05-27 20:00:37 +02:00
|
|
|
|
"Set flags for replied-to and forwarded for the message at PATH.
|
|
|
|
|
That is, set the `replied' \"R\" flag on messages we replied to,
|
|
|
|
|
and the `passed' \"F\" flag on message we have forwarded.
|
|
|
|
|
|
|
|
|
|
If a message has an \"In-Reply-To\" header, it is considered a
|
|
|
|
|
reply to the message with the corresponding message id.
|
|
|
|
|
Otherwise, if it does not have an \"In-Reply-To\" header, but
|
|
|
|
|
does have a \"References:\" header, it is considered to be a
|
|
|
|
|
forward message for the message corresponding with the /last/
|
|
|
|
|
message-id in the references header.
|
|
|
|
|
|
|
|
|
|
If the message has been determined to be either a forwarded
|
2011-10-02 20:35:03 +02:00
|
|
|
|
message or a reply, we instruct the server to update that message
|
2022-05-27 20:00:37 +02:00
|
|
|
|
with resp. the \"P\" (passed) flag for a forwarded message, or
|
|
|
|
|
the \"R\" flag for a replied message. The original messages are
|
|
|
|
|
also marked as Seen.
|
2012-03-28 17:58:43 +02:00
|
|
|
|
|
2022-05-27 20:00:37 +02:00
|
|
|
|
Function assumes that it is executed in the context of the
|
|
|
|
|
message buffer."
|
2012-04-26 17:08:42 +02:00
|
|
|
|
(let ((buf (find-file-noselect path)))
|
|
|
|
|
(when buf
|
|
|
|
|
(with-current-buffer buf
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(message-narrow-to-headers-or-head)
|
|
|
|
|
(let ((in-reply-to (message-fetch-field "in-reply-to"))
|
|
|
|
|
(forwarded-from)
|
|
|
|
|
(references (message-fetch-field "references")))
|
|
|
|
|
(unless in-reply-to
|
|
|
|
|
(when references
|
|
|
|
|
(with-temp-buffer ;; inspired by `message-shorten-references'.
|
|
|
|
|
(insert references)
|
|
|
|
|
(goto-char (point-min))
|
|
|
|
|
(let ((refs))
|
|
|
|
|
(while (re-search-forward "<[^ <]+@[^ <]+>" nil t)
|
|
|
|
|
(push (match-string 0) refs))
|
|
|
|
|
;; the last will be the first
|
2022-01-23 09:29:45 +01:00
|
|
|
|
(setq forwarded-from (car refs))))))
|
2020-02-11 12:00:46 +01:00
|
|
|
|
;; remove the <>
|
|
|
|
|
(when (and in-reply-to (string-match "<\\(.*\\)>" in-reply-to))
|
2021-08-29 18:53:53 +02:00
|
|
|
|
(mu4e--server-move (match-string 1 in-reply-to) nil "+R-N"))
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(when (and forwarded-from (string-match "<\\(.*\\)>" forwarded-from))
|
2021-08-29 18:53:53 +02:00
|
|
|
|
(mu4e--server-move (match-string 1 forwarded-from) nil "+P-N")))))))
|
2012-10-29 11:27:32 +01:00
|
|
|
|
|
2012-05-01 21:45:54 +02:00
|
|
|
|
(defun mu4e-compose (compose-type)
|
2019-05-25 16:38:58 +02:00
|
|
|
|
"Start composing a message of COMPOSE-TYPE.
|
|
|
|
|
COMPOSE-TYPE is a symbol, one of `reply', `forward', `edit',
|
|
|
|
|
`resend' `new'. All but `new' take the message at point as input.
|
|
|
|
|
Symbol `edit' is only allowed for draft messages."
|
2012-09-26 16:28:30 +02:00
|
|
|
|
(let ((msg (mu4e-message-at-point 'noerror)))
|
|
|
|
|
;; some sanity checks
|
|
|
|
|
(unless (or msg (eq compose-type 'new))
|
|
|
|
|
(mu4e-warn "No message at point"))
|
2016-02-16 07:13:03 +01:00
|
|
|
|
(unless (member compose-type '(reply forward edit resend new))
|
2012-09-28 16:10:34 +02:00
|
|
|
|
(mu4e-error "Invalid compose type '%S'" compose-type))
|
2012-09-26 16:28:30 +02:00
|
|
|
|
(when (and (eq compose-type 'edit)
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(not (member 'draft (mu4e-message-field msg :flags))))
|
2012-09-26 16:28:30 +02:00
|
|
|
|
(mu4e-warn "Editing is only allowed for draft messages"))
|
2012-10-29 11:27:32 +01:00
|
|
|
|
|
2012-10-01 15:43:47 +02:00
|
|
|
|
;; 'new is special, since it takes no existing message as arg; therefore, we
|
|
|
|
|
;; don't need to involve the backend, and call the handler *directly*
|
2012-09-26 16:28:30 +02:00
|
|
|
|
(if (eq compose-type 'new)
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(mu4e~compose-handler 'new)
|
2012-09-26 16:28:30 +02:00
|
|
|
|
;; otherwise, we need the doc-id
|
2014-10-15 01:42:57 +02:00
|
|
|
|
(let* ((docid (mu4e-message-field msg :docid))
|
2020-02-11 12:00:46 +01:00
|
|
|
|
;; decrypt (or not), based on `mu4e-decryption-policy'.
|
|
|
|
|
(decrypt
|
|
|
|
|
(and (member 'encrypted (mu4e-message-field msg :flags))
|
|
|
|
|
(if (eq mu4e-decryption-policy 'ask)
|
|
|
|
|
(yes-or-no-p (mu4e-format "Decrypt message?"))
|
|
|
|
|
mu4e-decryption-policy))))
|
|
|
|
|
;; if there's a visible view window, select that before starting
|
|
|
|
|
;; composing a new message, so that one will be replaced by the compose
|
|
|
|
|
;; window. The 10-or-so line headers buffer is not a good place to write
|
|
|
|
|
;; it...
|
|
|
|
|
(unless (eq mu4e-split-view 'single-window)
|
|
|
|
|
(let ((viewwin (get-buffer-window (mu4e-get-view-buffer))))
|
|
|
|
|
(when (window-live-p viewwin)
|
|
|
|
|
(select-window viewwin))))
|
|
|
|
|
;; talk to the backend
|
2021-08-29 18:53:53 +02:00
|
|
|
|
(mu4e--server-compose compose-type decrypt docid)))))
|
2012-05-01 21:45:54 +02:00
|
|
|
|
|
|
|
|
|
(defun mu4e-compose-reply ()
|
|
|
|
|
"Compose a reply for the message at point in the headers buffer."
|
|
|
|
|
(interactive)
|
|
|
|
|
(mu4e-compose 'reply))
|
|
|
|
|
|
|
|
|
|
(defun mu4e-compose-forward ()
|
|
|
|
|
"Forward the message at point in the headers buffer."
|
|
|
|
|
(interactive)
|
|
|
|
|
(mu4e-compose 'forward))
|
|
|
|
|
|
|
|
|
|
(defun mu4e-compose-edit ()
|
2012-11-10 14:01:17 +01:00
|
|
|
|
"Edit the draft message at point in the headers buffer.
|
|
|
|
|
This is only possible if the message at point is, in fact, a
|
|
|
|
|
draft message."
|
2012-05-01 21:45:54 +02:00
|
|
|
|
(interactive)
|
|
|
|
|
(mu4e-compose 'edit))
|
|
|
|
|
|
2016-02-16 07:13:03 +01:00
|
|
|
|
(defun mu4e-compose-resend ()
|
|
|
|
|
"Resend the message at point in the headers buffer."
|
|
|
|
|
(interactive)
|
|
|
|
|
(mu4e-compose 'resend))
|
|
|
|
|
|
2012-05-01 21:45:54 +02:00
|
|
|
|
(defun mu4e-compose-new ()
|
|
|
|
|
"Start writing a new message."
|
|
|
|
|
(interactive)
|
|
|
|
|
(mu4e-compose 'new))
|
|
|
|
|
|
2012-04-19 07:30:42 +02:00
|
|
|
|
|
2020-02-18 22:39:30 +01:00
|
|
|
|
;;; Compose Mail
|
2012-04-19 07:30:42 +02:00
|
|
|
|
;; mu4e-compose-func and mu4e-send-func are wrappers so we can set ourselves
|
|
|
|
|
;; as default emacs mailer (define-mail-user-agent etc.)
|
|
|
|
|
|
2021-08-29 16:30:10 +02:00
|
|
|
|
(declare-function mu4e "mu4e")
|
|
|
|
|
|
2012-11-14 12:55:15 +01:00
|
|
|
|
;;;###autoload
|
2020-02-06 19:28:24 +01:00
|
|
|
|
(defun mu4e~compose-mail (&optional to subject other-headers _continue
|
2021-09-19 08:57:44 +02:00
|
|
|
|
switch-function yank-action
|
|
|
|
|
_send-actions _return-action)
|
2019-05-25 16:38:58 +02:00
|
|
|
|
"This is mu4e's implementation of `compose-mail'.
|
|
|
|
|
Quoting its docstring:
|
2022-05-27 20:00:37 +02:00
|
|
|
|
|
|
|
|
|
Start composing a mail message to send. This uses the user's
|
|
|
|
|
chosen mail composition package as selected with the variable
|
|
|
|
|
`mail-user-agent'. The optional arguments TO and SUBJECT specify
|
|
|
|
|
recipients and the initial Subject field, respectively.
|
2019-05-25 16:38:58 +02:00
|
|
|
|
|
|
|
|
|
OTHER-HEADERS is an alist specifying additional
|
|
|
|
|
header fields. Elements look like (HEADER . VALUE) where both
|
|
|
|
|
HEADER and VALUE are strings.
|
|
|
|
|
|
|
|
|
|
CONTINUE, if non-nil, says to continue editing a message already
|
|
|
|
|
being composed. Interactively, CONTINUE is the prefix argument.
|
|
|
|
|
|
|
|
|
|
SWITCH-FUNCTION, if non-nil, is a function to use to
|
|
|
|
|
switch to and display the buffer used for mail composition.
|
|
|
|
|
|
2022-05-27 20:00:37 +02:00
|
|
|
|
YANK-ACTION, if non-nil, is an action to perform, if and when
|
|
|
|
|
necessary, to insert the raw text of the message being replied
|
|
|
|
|
to. It has the form (FUNCTION . ARGS). The user agent will apply
|
2019-05-25 16:38:58 +02:00
|
|
|
|
FUNCTION to ARGS, to insert the raw text of the original message.
|
2022-05-27 20:00:37 +02:00
|
|
|
|
\(The user agent will also run `mail-citation-hook', *after* the
|
2019-05-25 16:38:58 +02:00
|
|
|
|
original text has been inserted in this way.)
|
|
|
|
|
|
|
|
|
|
SEND-ACTIONS is a list of actions to call when the message is sent.
|
|
|
|
|
Each action has the form (FUNCTION . ARGS).
|
|
|
|
|
|
|
|
|
|
RETURN-ACTION, if non-nil, is an action for returning to the
|
|
|
|
|
caller. It has the form (FUNCTION . ARGS). The function is
|
|
|
|
|
called after the mail has been sent or put aside, and the mail
|
|
|
|
|
buffer buried."
|
2022-05-27 20:00:37 +02:00
|
|
|
|
|
|
|
|
|
(unless (mu4e-running-p)
|
2021-08-29 16:30:10 +02:00
|
|
|
|
(mu4e))
|
2020-05-27 16:28:49 +02:00
|
|
|
|
|
2021-09-19 08:57:44 +02:00
|
|
|
|
;; create a new draft message 'resetting' (as below) is not actually needed in
|
|
|
|
|
;; this case, but let's prepare for the re-edit case as well
|
2021-04-03 23:23:21 +02:00
|
|
|
|
(mu4e~compose-handler 'new nil nil switch-function)
|
2012-05-10 16:09:57 +02:00
|
|
|
|
|
2012-04-25 07:30:10 +02:00
|
|
|
|
(when (message-goto-to) ;; reset to-address, if needed
|
|
|
|
|
(message-delete-line))
|
2012-04-26 17:08:42 +02:00
|
|
|
|
(message-add-header (concat "To: " to "\n"))
|
|
|
|
|
|
2012-04-25 07:30:10 +02:00
|
|
|
|
(when (message-goto-subject) ;; reset subject, if needed
|
|
|
|
|
(message-delete-line))
|
2012-04-26 17:08:42 +02:00
|
|
|
|
(message-add-header (concat "Subject: " subject "\n"))
|
|
|
|
|
|
2012-05-10 16:09:57 +02:00
|
|
|
|
;; add any other headers specified
|
2022-06-14 22:12:41 +02:00
|
|
|
|
(seq-each (lambda(hdr)
|
|
|
|
|
(let ((field (capitalize(car hdr))) (value (cdr hdr)))
|
|
|
|
|
;; fix in-reply without <>
|
|
|
|
|
(when (and (string= field "In-Reply-To")
|
|
|
|
|
(string-match-p "\\`[^ @]+@[^ @]+\\'" value)
|
|
|
|
|
(not (string-match-p "\\`<.*>\\'" value)))
|
|
|
|
|
(setq value (concat "<" value ">")))
|
|
|
|
|
(message-add-header (concat (capitalize field) ": " value "\n"))))
|
|
|
|
|
other-headers)
|
2012-04-25 07:30:10 +02:00
|
|
|
|
|
2012-04-19 17:54:31 +02:00
|
|
|
|
;; yank message
|
2012-04-19 07:30:42 +02:00
|
|
|
|
(if (bufferp yank-action)
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(list 'insert-buffer yank-action)
|
2012-04-25 07:30:10 +02:00
|
|
|
|
yank-action)
|
|
|
|
|
|
|
|
|
|
;; try to put the user at some reasonable spot...
|
|
|
|
|
(if (not to)
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(message-goto-to)
|
2012-04-25 07:30:10 +02:00
|
|
|
|
(if (not subject)
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(message-goto-subject)
|
2012-04-25 07:30:10 +02:00
|
|
|
|
(message-goto-body))))
|
2012-04-19 07:30:42 +02:00
|
|
|
|
|
2012-04-19 17:54:31 +02:00
|
|
|
|
;; happily, we can re-use most things from message mode
|
2012-11-14 12:55:15 +01:00
|
|
|
|
;;;###autoload
|
2012-04-19 07:30:42 +02:00
|
|
|
|
(define-mail-user-agent 'mu4e-user-agent
|
2020-05-27 16:28:49 +02:00
|
|
|
|
'mu4e~compose-mail
|
2012-04-19 07:30:42 +02:00
|
|
|
|
'message-send-and-exit
|
|
|
|
|
'message-kill-buffer
|
|
|
|
|
'message-send-hook)
|
2012-11-14 12:39:37 +01:00
|
|
|
|
;; Without this `mail-user-agent' cannot be set to `mu4e-user-agent'
|
|
|
|
|
;; through customize, as the custom type expects a function. Not
|
|
|
|
|
;; sure whether this function is actually ever used; if it is then
|
|
|
|
|
;; returning the symbol is probably the correct thing to do, as other
|
|
|
|
|
;; such functions suggest.
|
|
|
|
|
(defun mu4e-user-agent ()
|
2017-04-08 14:21:06 +02:00
|
|
|
|
"Return the `mu4e-user-agent' symbol."
|
2012-11-14 12:39:37 +01:00
|
|
|
|
'mu4e-user-agent)
|
2012-04-19 07:30:42 +02:00
|
|
|
|
|
2020-02-18 22:39:30 +01:00
|
|
|
|
;;; Go to bottom / top
|
2014-01-09 18:07:48 +01:00
|
|
|
|
|
2019-12-05 21:36:38 +01:00
|
|
|
|
(defun mu4e-compose-goto-top (&optional arg)
|
2014-01-09 18:07:48 +01:00
|
|
|
|
"Go to the beginning of the message or buffer.
|
|
|
|
|
Go to the beginning of the message or, if already there, go to the
|
2019-12-05 21:36:38 +01:00
|
|
|
|
beginning of the buffer.
|
|
|
|
|
|
|
|
|
|
Push mark at previous position, unless either a \\[universal-argument] prefix
|
|
|
|
|
is supplied, or Transient Mark mode is enabled and the mark is active."
|
|
|
|
|
(interactive "P")
|
|
|
|
|
(or arg
|
|
|
|
|
(region-active-p)
|
|
|
|
|
(push-mark))
|
2014-01-09 18:07:48 +01:00
|
|
|
|
(let ((old-position (point)))
|
|
|
|
|
(message-goto-body)
|
|
|
|
|
(when (equal (point) old-position)
|
2014-11-30 15:29:10 +01:00
|
|
|
|
(goto-char (point-min)))))
|
2014-01-09 18:07:48 +01:00
|
|
|
|
|
|
|
|
|
(define-key mu4e-compose-mode-map
|
|
|
|
|
(vector 'remap 'beginning-of-buffer) 'mu4e-compose-goto-top)
|
|
|
|
|
|
2019-12-05 21:36:38 +01:00
|
|
|
|
(defun mu4e-compose-goto-bottom (&optional arg)
|
2014-01-09 18:07:48 +01:00
|
|
|
|
"Go to the end of the message or buffer.
|
|
|
|
|
Go to the end of the message (before signature) or, if already there, go to the
|
2019-12-05 21:36:38 +01:00
|
|
|
|
end of the buffer.
|
|
|
|
|
|
|
|
|
|
Push mark at previous position, unless either a \\[universal-argument] prefix
|
|
|
|
|
is supplied, or Transient Mark mode is enabled and the mark is active."
|
|
|
|
|
(interactive "P")
|
|
|
|
|
(or arg
|
|
|
|
|
(region-active-p)
|
|
|
|
|
(push-mark))
|
2014-01-09 18:07:48 +01:00
|
|
|
|
(let ((old-position (point))
|
2020-02-11 12:00:46 +01:00
|
|
|
|
(message-position (save-excursion (message-goto-body) (point))))
|
2014-11-30 15:29:10 +01:00
|
|
|
|
(goto-char (point-max))
|
2014-01-09 18:18:36 +01:00
|
|
|
|
(when (re-search-backward message-signature-separator message-position t)
|
2014-11-30 15:29:10 +01:00
|
|
|
|
(forward-line -1))
|
2014-01-09 18:07:48 +01:00
|
|
|
|
(when (equal (point) old-position)
|
2014-11-30 15:29:10 +01:00
|
|
|
|
(goto-char (point-max)))))
|
2014-01-09 18:07:48 +01:00
|
|
|
|
|
|
|
|
|
(define-key mu4e-compose-mode-map
|
|
|
|
|
(vector 'remap 'end-of-buffer) 'mu4e-compose-goto-bottom)
|
|
|
|
|
|
2020-02-11 13:26:45 +01:00
|
|
|
|
;;; _
|
2012-05-25 15:51:23 +02:00
|
|
|
|
(provide 'mu4e-compose)
|
2019-05-25 16:38:58 +02:00
|
|
|
|
;;; mu4e-compose.el ends here
|