Mu4e: ensure that attachment isn't mixed with text

Ensure that mail-add-attachment is called on a blank line at the end of
the buffer.
This commit is contained in:
TEC 2020-12-16 04:23:23 +08:00
parent f7438325d9
commit 6c2d68ea17
No known key found for this signature in database
GPG key ID: 779591AFDB81F06C

View file

@ -247,7 +247,13 @@ When otherwise called, open a dired buffer."
(location (read-file-name "Attach: ")))
(if (not (file-directory-p location))
(pcase major-mode
('mu4e-compose-mode (mail-add-attachment location))
('mu4e-compose-mode
(save-excursion
(goto-char (point-max))
(unless (eq (current-column) 0)
(insert "\n\n")
(forward-line 2))
(mail-add-attachment location)))
('org-msg-edit-mode (org-msg-attach-attach location)))
(split-window-sensibly)
(with-current-buffer (dired location)