Function: rmail-edit-mode
rmail-edit-mode is a byte-compiled function defined in
rmailedit.el.gz.
Signature
(rmail-edit-mode)
Documentation
Major mode for editing the contents of an Rmail message.
The editing commands are the same as in Text mode, together with
two commands to return to regular Rmail:
* M-x rmail-abort-edit (rmail-abort-edit) cancels any changes and returns to Rmail
* M-x rmail-cease-edit (rmail-cease-edit) makes them permanent.
This function runs the hooks text-mode-hook and rmail-edit-mode-hook.
C-M-i ispell-complete-word
C-c C-] rmail-abort-edit
C-c C-c rmail-cease-edit
Source Code
;; Defined in /usr/src/emacs/lisp/mail/rmailedit.el.gz
;; We can't straightforwardly make this derive from text-mode, because
;; we need to bind (rmail-buffer-swapped) around the text-mode call. :(
(defun rmail-edit-mode ()
"Major mode for editing the contents of an Rmail message.
The editing commands are the same as in Text mode, together with
two commands to return to regular Rmail:
* \\[rmail-abort-edit] cancels any changes and returns to Rmail
* \\[rmail-cease-edit] makes them permanent.
This function runs the hooks `text-mode-hook' and `rmail-edit-mode-hook'.
\\{rmail-edit-map}"
(if (rmail-summary-exists)
(with-current-buffer rmail-summary-buffer
(rmail-summary-disable)))
;; Prevent change-major-mode-hook from unswapping the buffers.
(let ((rmail-buffer-swapped nil))
(delay-mode-hooks (text-mode))
(use-local-map rmail-edit-map)
(setq major-mode 'rmail-edit-mode)
(setq mode-name "RMAIL Edit")
(setq mode-line-modified (default-value 'mode-line-modified))
;; Don't turn off auto-saving based on the size of the buffer
;; because that code does not understand buffer-swapping.
(setq-local auto-save-include-big-deletions t)
;; If someone uses C-x C-s, don't clobber the rmail file (bug#2625).
(add-hook 'write-region-annotate-functions
#'rmail-write-region-annotate nil t)
(run-mode-hooks 'rmail-edit-mode-hook)))