From: keiichi Date: Tue, 6 Oct 1998 08:16:34 +0000 (+0000) Subject: (message-parameter-alist): New variable. X-Git-Tag: nana-gnus-6_8-199811302358~13 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=8a9a1097418c70111466a01793e1a8da6ad0ecbd;p=elisp%2Fgnus.git- (message-parameter-alist): New variable. (message-startup-parameter-alist): New variable. (message-fetch-reply-field): Get reply buffer with `message-get-reply-buffer()'. (message-yank-original): Ditto. (message-eval-parameter): New function. (message-get-reply-buffer): Ditto. (message-get-original-reply-buffer): Ditto. (message-mode): New buffer local variable `message-parameter-alist'. (message-setup): Set up `message-reply-buffer' from `message-parameter-alist'. (message-mime-insert-article): Get `Original message buffer' with `message-get-original-reply-buffer' instead of `gnus-original-article-buffer'. Remove bogus header fields for forwarding message. --- diff --git a/lisp/message.el b/lisp/message.el index cd6ca1d..78c22a6 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -577,6 +577,8 @@ If stringp, use this; if non-nil, use no host name (user name only)." (defvar message-postpone-actions nil "A list of actions to be performed after postponing a message.") (defvar message-original-frame nil) +(defvar message-parameter-alist nil) +(defvar message-startup-parameter-alist nil) (define-widget 'message-header-lines 'text "All header lines must be LFD terminated." @@ -1069,11 +1071,12 @@ The cdr of ech entry is a function for applying the face to a region.") (defun message-fetch-reply-field (header) "Fetch FIELD from the message we're replying to." - (when (and message-reply-buffer - (buffer-name message-reply-buffer)) - (save-excursion - (set-buffer message-reply-buffer) - (message-fetch-field header)))) + (let ((buffer (message-get-reply-buffer))) + (when (and buffer + (buffer-name buffer)) + (save-excursion + (set-buffer buffer) + (message-fetch-field header))))) (defun message-set-work-buffer () (if (get-buffer " *message work*") @@ -1214,6 +1217,21 @@ Return the number of headers removed." (1+ max))))) (message-sort-headers-1)))) +(defun message-eval-parameter (parameter) + (condition-case () + (if (symbolp parameter) + (if (functionp parameter) + (funcall parameter) + (eval parameter)) + parameter) + (error nil))) + +(defun message-get-reply-buffer () + (message-eval-parameter message-reply-buffer)) + +(defun message-get-original-reply-buffer () + (message-eval-parameter + (cdr (assq 'original-buffer message-parameter-alist)))) ;;; @@ -1376,6 +1394,9 @@ C-c C-r message-caesar-buffer-body (rot13 the message body)." (setq message-sent-message-via nil) (make-local-variable 'message-checksum) (setq message-checksum nil) + (make-local-variable 'message-parameter-alist) + (setq message-parameter-alist + (copy-sequence message-startup-parameter-alist)) ;;(when (fboundp 'mail-hist-define-keys) ;; (mail-hist-define-keys)) (when (string-match "XEmacs\\|Lucid" emacs-version) @@ -1773,13 +1794,12 @@ This function uses `message-cite-function' to do the actual citing. Just \\[universal-argument] as argument means don't indent, insert no prefix, and don't delete any headers." (interactive "P") - (let ((modified (buffer-modified-p))) - (when (and message-reply-buffer + (let ((modified (buffer-modified-p)) + (buffer (message-get-reply-buffer))) + (when (and buffer message-cite-function) - (gnus-copy-article-buffer) - (setq message-reply-buffer gnus-article-copy) - (delete-windows-on message-reply-buffer t) - (insert-buffer message-reply-buffer) + (delete-windows-on buffer t) + (insert-buffer buffer) (funcall message-cite-function) (message-exchange-point-and-mark) (unless (bolp) @@ -3415,7 +3435,9 @@ Headers already prepared in the buffer are not modified." mc-modes-alist)) (when actions (setq message-send-actions actions)) - (setq message-reply-buffer replybuffer) + (setq message-reply-buffer + (or (cdr (assq 'reply-buffer message-parameter-alist)) + replybuffer)) (goto-char (point-min)) ;; Insert all the headers. (mail-header-format @@ -4287,10 +4309,17 @@ regexp varstr." (defun message-mime-insert-article (&optional message) (interactive) (let ((message-cite-function 'mime-edit-inserted-message-filter) - (message-reply-buffer gnus-original-article-buffer) + (message-reply-buffer (message-get-original-reply-buffer)) ) (message-yank-original nil) - )) + (save-excursion + (narrow-to-region (goto-char (mark)) + (if (search-forward "\n\n" nil t) + (1- (point)) + (point-max))) + (goto-char (point-min)) + (message-remove-header message-included-forward-headers t nil t) + (widen)))) (set-alist 'mime-edit-message-inserter-alist 'message-mode (function message-mime-insert-article))