[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master c502cdd 3/3: Don't add Content-Type when ceasing an rmail edit
From: |
Lars Ingebrigtsen |
Subject: |
master c502cdd 3/3: Don't add Content-Type when ceasing an rmail edit |
Date: |
Tue, 19 Jan 2021 23:09:07 -0500 (EST) |
branch: master
commit c502cdd2b71f396b202e22103cd8aa5b0796fdab
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Don't add Content-Type when ceasing an rmail edit
* lisp/mail/rmailedit.el (rmail-cease-edit): Take an optional
parameter to avoid altering the message (bug#13327).
(rmail-abort-edit): Use it.
---
lisp/mail/rmailedit.el | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lisp/mail/rmailedit.el b/lisp/mail/rmailedit.el
index 2680ed7..c3b351d 100644
--- a/lisp/mail/rmailedit.el
+++ b/lisp/mail/rmailedit.el
@@ -145,8 +145,9 @@ This function runs the hooks `text-mode-hook' and
`rmail-edit-mode-hook'.
(declare-function rmail-summary-enable "rmailsum" ())
(declare-function rmail-summary-update-line "rmailsum" (n))
-(defun rmail-cease-edit ()
- "Finish editing message; switch back to Rmail proper."
+(defun rmail-cease-edit (&optional abort)
+ "Finish editing message; switch back to Rmail proper.
+If ABORT, this is the result of aborting an edit."
(interactive)
(if (rmail-summary-exists)
(with-current-buffer rmail-summary-buffer
@@ -271,6 +272,8 @@ This function runs the hooks `text-mode-hook' and
`rmail-edit-mode-hook'.
;; No match for rmail-mime-charset-pattern, but there was some
;; other Content-Type. We should not insert another. (Bug#4624)
(content-type)
+ ;; Don't insert anything if aborting.
+ (abort)
((null old-coding)
;; If there was no charset= spec, insert one.
(backward-char 1)
@@ -352,7 +355,7 @@ This function runs the hooks `text-mode-hook' and
`rmail-edit-mode-hook'.
(widen)
(delete-region (point-min) (point-max))
(insert rmail-old-text)
- (rmail-cease-edit)
+ (rmail-cease-edit t)
(rmail-highlight-headers))
(defun rmail-edit-headers-alist (&optional widen markers)