From: keiichi Date: Fri, 23 Oct 1998 05:22:42 +0000 (+0000) Subject: (message-header-hook): Change default valiable to `nil' instead of X-Git-Tag: nana-gnus-6_9-flim-1_11-199811302358~12 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=f28ead0f81c0acfb07b2a1c007a38c9be341808b;p=elisp%2Fgnus.git- (message-header-hook): Change default valiable to `nil' instead of `'(eword-decode-header)'. Update doc string. (message-encode-header-function): New variable. (message-after-header-encode-hook): New variable. (message-send-mail): Funcall `message-encode-header-function' after run `message-header-hook'. And run hooks `message-after-header-encode-hook'. (message-send-news): Ditto. (message-do-fcc): Ditto. --- diff --git a/lisp/message.el b/lisp/message.el index b40ab91..3973cbf 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -488,8 +488,21 @@ the signature is inserted." :group 'message-various :type 'hook) -(defcustom message-header-hook '(eword-encode-header) - "Hook run in a message mode buffer narrowed to the headers." +(defcustom message-header-hook nil + "Hook run in a message mode before header encode. Buffer narrowed +to the headers." + :group 'message-various + :type 'hook) + +(defcustom message-encode-header-function + 'eword-encode-header + "A function called to after header encode." + :group 'message-various + :type 'function) + +(defcustom message-after-header-encode-hook nil + "Hook run in a message mode after header encoded. Buffer narrowed +to the headers." :group 'message-various :type 'hook) @@ -2119,7 +2132,10 @@ the user from the mailer." (if news nil message-deletable-headers))) (message-generate-headers message-required-mail-headers)) ;; Let the user do all of the above. - (run-hooks 'message-header-hook)) + (run-hooks 'message-header-hook) + (when (functionp message-encode-header-function) + (funcall message-encode-header-function)) + (run-hooks 'message-after-header-encode-hook)) (unwind-protect (save-excursion (set-buffer tembuf) @@ -2429,7 +2445,10 @@ to find out how to use this." ;; Insert some headers. (message-generate-headers message-required-news-headers) ;; Let the user do all of the above. - (run-hooks 'message-header-hook)) + (run-hooks 'message-header-hook) + (when (functionp message-encode-header-function) + (funcall message-encode-header-function)) + (run-hooks 'message-after-header-encode-hook)) (message-cleanup-headers) (if (not (message-check-news-syntax)) (progn @@ -2798,8 +2817,12 @@ to find out how to use this." (message-narrow-to-headers) (while (setq file (message-fetch-field "fcc")) (push file list) - (message-remove-header "fcc" nil t))) - (run-hooks 'message-header-hook 'message-before-do-fcc-hook) + (message-remove-header "fcc" nil t)) + (run-hooks 'message-header-hook) + (when (functionp message-encode-header-function) + (funcall message-encode-header-function)) + (run-hooks 'message-after-header-encode-hook)) + (run-hooks 'message-before-do-fcc-hook) (goto-char (point-min)) (re-search-forward (concat "^" (regexp-quote mail-header-separator) "$")) (replace-match "" t t)