From: teranisi Date: Sat, 9 Nov 2002 08:17:07 +0000 (+0000) Subject: * wl-vars.el (wl-draft-write-file-function): New user option. X-Git-Tag: elmo-mark-restart~89 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61178605d266a245d335730c002cd3ddce7b1145;p=elisp%2Fwanderlust.git * 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. --- diff --git a/wl/ChangeLog b/wl/ChangeLog index cd5104e..ee4ae21 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 01ac593..3f36c35 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) @@ -1736,7 +1736,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) @@ -1933,7 +1934,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))) @@ -1951,7 +1952,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 5417a84..92e57e1 100644 --- a/wl/wl-vars.el +++ b/wl/wl-vars.el @@ -380,6 +380,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."