From: keiichi Date: Fri, 13 Nov 1998 06:32:01 +0000 (+0000) Subject: (message-parameter-alist): New variable. X-Git-Tag: gnus-6_8-199811302358~32 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=52438976142b20a16349321c9ca9dba925ac9b40;p=elisp%2Fgnus.git- (message-parameter-alist): New variable. (message-startup-parameter-alist): New variable. (message-eval-parameter): New function. (message-get-reply-buffer): New function. (message-get-original-reply-buffer): New function. (message-mode): Make new local variable `message-parameter-alist'. (message-fetch-reply-field): Use `message-get-reply-buffer'. (message-yank-original): Ditto. (message-setup): Get message reply buffer from `message-parameter-alist'. (message-mime-insert-article): Use `message-get-original-reply-buffer'. --- diff --git a/lisp/message.el b/lisp/message.el index e09f367..bbc718b 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -603,6 +603,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." @@ -1098,11 +1100,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*") @@ -1243,6 +1246,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)))) ;;; @@ -1407,6 +1425,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) @@ -1804,13 +1825,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) @@ -3523,7 +3543,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 @@ -4404,8 +4426,8 @@ 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)) + (start (point))) (message-yank-original nil) ))