From 5584ca5921097b6c86cd011cecb5d8a33ac081b6 Mon Sep 17 00:00:00 2001 From: teranisi Date: Sat, 9 Nov 2002 08:16:23 +0000 Subject: [PATCH] * wl-vars.el (wl-draft-write-file-function): New user option. * wl-draft.el (wl-draft-prepare-edit): Use it for local-write-file-hooks. (wl-draft-reedit): Ditto; use exact match for text/plain tag. --- wl/ChangeLog | 6 ++++++ wl/wl-draft.el | 10 ++++++---- wl/wl-vars.el | 5 +++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index 3d7b579..2d1ada3 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,5 +1,11 @@ 2002-11-09 Yuuichi Teranishi + * wl-vars.el (wl-draft-write-file-function): New user option. + + * wl-draft.el (wl-draft-prepare-edit): Use it for + local-write-file-hooks. + (wl-draft-reedit): Ditto; use exact match for text/plain tag. + * wl-draft.el (wl-draft-create-buffer): Cosmetic fix. (wl-draft-insert-mail-header-separator): Return the body beginning point. diff --git a/wl/wl-draft.el b/wl/wl-draft.el index 3cb26af..b80d533 100644 --- a/wl/wl-draft.el +++ b/wl/wl-draft.el @@ -81,7 +81,7 @@ This variable is local in each draft buffer. You can refer its value in `wl-draft-config-alist'. e.g. -(setq wl-draft-config-alist +\(setq wl-draft-config-alist '(((string-match \".*@domain1$\" wl-draft-parent-folder) (\"From\" . \"user@domain1\")) ((string-match \".*@domain2$\" wl-draft-parent-folder) @@ -1718,7 +1718,8 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed" (error "wl-draft-create-header must be use in wl-draft-mode.")) (let (change-major-mode-hook) (wl-draft-editor-mode) - (add-hook 'local-write-file-hooks 'wl-draft-save) + (when wl-draft-write-file-function + (add-hook 'local-write-file-hooks wl-draft-write-file-function)) (wl-draft-overload-functions) (wl-highlight-headers 'for-draft) (wl-draft-save) @@ -1914,7 +1915,7 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed" (wl-draft-decode-message-in-buffer)) (goto-char (wl-draft-insert-mail-header-separator)) ;; If the first part is text/plain, the mime-edit tag is useless. - (if (looking-at "^--\\[\\[text/plain\\]\\]") + (if (looking-at "^--\\[\\[text/plain\\]\\]$") (delete-region (point-at-bol)(1+ (point-at-eol)))) (if (not (string-match (regexp-quote wl-draft-folder) (buffer-name))) @@ -1932,7 +1933,8 @@ If KILL-WHEN-DONE is non-nil, current draft buffer is killed" (goto-char (point-min)) (wl-draft-overload-functions) (wl-draft-editor-mode) - (add-hook 'local-write-file-hooks 'wl-draft-save) + (when wl-draft-write-file-function + (add-hook 'local-write-file-hooks wl-draft-write-file-function)) (wl-highlight-headers 'for-draft) (run-hooks 'wl-draft-reedit-hook) (goto-char (point-max)) diff --git a/wl/wl-vars.el b/wl/wl-vars.el index 4eb5153..99a25e6 100644 --- a/wl/wl-vars.el +++ b/wl/wl-vars.el @@ -379,6 +379,11 @@ If file exists and `wl-auto-insert-x-face' is non-nil." :type 'file :group 'wl-draft) +(defvar wl-draft-write-file-function 'wl-draft-save + "Save function for draft message." + :type 'function + :group 'wl-draft) + (defcustom wl-subscribed-mailing-list nil "*Subscribed mailing list. You had better set this variable if you set 'wl-insert-mail-followup-to' as t." -- 1.7.10.4