From: ichikawa Date: Fri, 16 Oct 1998 15:31:20 +0000 (+0000) Subject: Add message-save-drafts to save drafts in network code. X-Git-Tag: pgnus-ichikawa-199811302358~157 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=506876a403eb14752e5ad3048a5f5be1246f58b2;p=elisp%2Fgnus.git- Add message-save-drafts to save drafts in network code. --- 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)