From 506876a403eb14752e5ad3048a5f5be1246f58b2 Mon Sep 17 00:00:00 2001 From: ichikawa Date: Fri, 16 Oct 1998 15:31:20 +0000 Subject: [PATCH] Add message-save-drafts to save drafts in network code. --- ChangeLog | 3 +++ lisp/message.el | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/ChangeLog b/ChangeLog index 37a018e..ba063a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,9 @@ * lisp/pop3-fma.el (pop3-fma-init-message-hook): Change message-send-hook to mime-edit-translate-hook. + * lisp/message.el (message-save-drafts): New function to save + drafts in network code. + 1998-10-16 Katsumi Yamaoka * lisp/gnus-msg.el (gnus-message-setup-hook): Replace the default diff --git a/lisp/message.el b/lisp/message.el index 337963d..9b43fd9 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -1407,6 +1407,7 @@ Point is left at the beginning of the narrowed-to region." (define-key message-mode-map "\t" 'message-tab) + (define-key message-mode-map "\C-x\C-s" 'message-save-drafts) (define-key message-mode-map "\C-xk" 'message-kill-buffer)) (easy-menu-define @@ -4546,6 +4547,21 @@ regexp varstr." (mm-insert-rfc822-headers charset encoding)) (mm-encode-body))))))) +(defvar message-save-buffer " *encoding") +(defun message-save-drafts () + (interactive) + (if (not (get-buffer message-save-buffer)) + (get-buffer-create message-save-buffer)) + (let ((filename buffer-file-name) + (buffer (current-buffer))) + (set-buffer message-save-buffer) + (erase-buffer) + (insert-buffer buffer) + (mime-edit-translate-buffer) + (write-region (point-min) (point-max) filename) + (set-buffer buffer) + (set-buffer-modified-p nil))) + (run-hooks 'message-load-hook) (provide 'message) -- 1.7.10.4