From: keiichi Date: Thu, 19 Nov 1998 08:33:35 +0000 (+0000) Subject: (message-get-reply-buffer): Abolished. X-Git-Tag: keiichi-199811302358~14 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=12b226e267c187feaf97ae9db34ee5708d9ed68c;p=elisp%2Fgnus.git- (message-get-reply-buffer): Abolished. (message-get-original-reply-buffer): Abolished. (message-get-parameter): New inline function. (message-get-parameter-with-eval): New macro. (message-fetch-reply-field): Do not use `message-get-reply-buffer'. (message-yank-original): Ditto. (message-setup): Use `message-get-parameter'. (message-mime-insert-article): Use `message-get-parameter-with-eval' instead of`message-get-original-reply-buffer'. --- diff --git a/lisp/message.el b/lisp/message.el index 733dbcb..bd94eae 100644 --- a/lisp/message.el +++ b/lisp/message.el @@ -1035,6 +1035,22 @@ The cdr of ech entry is a function for applying the face to a region.") ;;; ;;; Utility functions. ;;; +(defun message-eval-parameter (parameter) + (condition-case () + (if (symbolp parameter) + (if (functionp parameter) + (funcall parameter) + (eval parameter)) + parameter) + (error nil))) + +(defsubst message-get-parameter (key &optional alist) + (unless alist + (setq alist message-parameter-alist)) + (cdr (assq key alist))) + +(defmacro message-get-parameter-with-eval (key &optional alist) + `(message-eval-parameter (message-get-parameter ,alist ,key))) (defmacro message-y-or-n-p (question show &rest text) "Ask QUESTION, displaying the rest of the arguments in a temp. buffer if SHOW" @@ -1111,7 +1127,7 @@ 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." - (let ((buffer (message-get-reply-buffer))) + (let ((buffer (message-eval-parameter message-reply-buffer))) (when (and buffer (buffer-name buffer)) (save-excursion @@ -1256,22 +1272,6 @@ Return the number of headers removed." (- max rank) (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)))) ;;; @@ -1836,7 +1836,7 @@ 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)) - (buffer (message-get-reply-buffer))) + (buffer (message-eval-parameter message-reply-buffer))) (when (and buffer message-cite-function) (delete-windows-on buffer t) @@ -3564,7 +3564,7 @@ Headers already prepared in the buffer are not modified." (when actions (setq message-send-actions actions)) (setq message-reply-buffer - (or (cdr (assq 'reply-buffer message-parameter-alist)) + (or (message-get-parameter 'reply-buffer) replybuffer)) (goto-char (point-min)) ;; Insert all the headers. @@ -4437,7 +4437,8 @@ regexp varstr." (defun message-mime-insert-article (&optional message) (interactive) (let ((message-cite-function 'mime-edit-inserted-message-filter) - (message-reply-buffer (message-get-original-reply-buffer)) + (message-reply-buffer + (message-get-parameter-with-eval 'original-buffer)) (start (point))) (message-yank-original nil) (save-excursion