* mu4e-compose.el: (1) ensure newline after message-separator + (2) bury, don't kill sent buffers
(1) some people were reporting a missing newline after the message separator, which broke editing when there was not message signature. I haven't been able to reproduce with the current mu4e, with either emacs 23 or 24, but hopefully this helps (2) don't kill send buffers (which may not work), bury them instead (let message-mode handle this). To kill the buffers, set message-kill-buffer-on-exit to t.
This commit is contained in:
@ -231,15 +231,14 @@ and the body starts. Note, in `mu4e-compose-mode, we use
|
|||||||
separator is never written to file. Also see
|
separator is never written to file. Also see
|
||||||
`mu4e-remove-mail-header-separator'."
|
`mu4e-remove-mail-header-separator'."
|
||||||
(save-excursion
|
(save-excursion
|
||||||
|
(let ((sepa (propertize mail-header-separator 'intangible t)))
|
||||||
(goto-char (point-min))
|
(goto-char (point-min))
|
||||||
;; search for the first empty line
|
;; search for the first empty line
|
||||||
(if (search-forward-regexp (concat "^$"))
|
(if (search-forward-regexp "^$" nil t)
|
||||||
(replace-match
|
(replace-match sepa)
|
||||||
(concat (propertize mail-header-separator 'intangible t)))
|
(progn ;; no empty line? then prepend one
|
||||||
;; no empty line? then append one
|
|
||||||
(progn
|
|
||||||
(goto-char (point-max))
|
(goto-char (point-max))
|
||||||
(insert (concat "\n" mail-header-separator))))))
|
(insert (concat "\n" sepa)))))))
|
||||||
|
|
||||||
(defun mu4e~compose-remove-mail-header-separator ()
|
(defun mu4e~compose-remove-mail-header-separator ()
|
||||||
"Remove `mail-header-separator; we do this before saving a
|
"Remove `mail-header-separator; we do this before saving a
|
||||||
@ -554,15 +553,12 @@ Gnus' `message-mode'."
|
|||||||
|
|
||||||
(defun mu4e-sent-handler (docid path)
|
(defun mu4e-sent-handler (docid path)
|
||||||
"Handler function, called with DOCID and PATH for the just-sent
|
"Handler function, called with DOCID and PATH for the just-sent
|
||||||
message."
|
message. For Forwarded ('Passed') and Replied messages, try to set
|
||||||
;; for Forward ('Passed') and Replied messages, try to set the appropriate
|
the appropriate flag at the message forwarded or replied-to."
|
||||||
;; flag at the message forwarded or replied-to
|
|
||||||
(mu4e~compose-set-parent-flag path)
|
(mu4e~compose-set-parent-flag path)
|
||||||
(kill-buffer) ;; remove the draft
|
|
||||||
(when (file-exists-p path) ;; maybe the draft was not saved at all
|
(when (file-exists-p path) ;; maybe the draft was not saved at all
|
||||||
(mu4e~proc-remove docid)))
|
(mu4e~proc-remove docid)))
|
||||||
|
|
||||||
|
|
||||||
(defun mu4e~compose-set-parent-flag (path)
|
(defun mu4e~compose-set-parent-flag (path)
|
||||||
"Set the 'replied' \"R\" flag on messages we replied to, and the
|
"Set the 'replied' \"R\" flag on messages we replied to, and the
|
||||||
'passed' \"F\" flag on message we have forwarded.
|
'passed' \"F\" flag on message we have forwarded.
|
||||||
|
|||||||
Reference in New Issue
Block a user