Function: message-reply

message-reply is an autoloaded, interactive and byte-compiled function defined in message.el.gz.

Signature

(message-reply &optional TO-ADDRESS WIDE SWITCH-FUNCTION)

Documentation

Start editing a reply to the article in the current buffer.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/message.el.gz
;;;###autoload
(defun message-reply (&optional to-address wide switch-function)
  "Start editing a reply to the article in the current buffer."
  (interactive)
  (require 'gnus-sum)			; for gnus-list-identifiers
  (let ((cur (current-buffer))
	from subject date
	references message-id follow-to
	(message-this-is-mail t)
	gnus-warning)
    (save-restriction
      (message-narrow-to-head-1)
      ;; Allow customizations to have their say.
      (if (not wide)
	  ;; This is a regular reply.
	  (when (functionp message-reply-to-function)
	    (save-excursion
	      (setq follow-to (funcall message-reply-to-function))))
	;; This is a followup.
	(when (functionp message-wide-reply-to-function)
	  (save-excursion
	    (setq follow-to
		  (funcall message-wide-reply-to-function)))))
      (setq message-id (message-fetch-field "message-id" t)
	    references (message-fetch-field "references")
	    date (message-fetch-field "date")
	    from (or (message-fetch-field "from") "nobody")
	    subject (or (message-fetch-field "subject") "none"))

      ;; Strip list identifiers, "Re: ", and "was:"
      (setq subject (concat "Re: " (message-simplify-subject subject)))

      (when (and (setq gnus-warning (message-fetch-field "gnus-warning"))
		 (string-match "<[^>]+>" gnus-warning))
	(setq message-id (match-string 0 gnus-warning)))

      (unless follow-to
	(setq follow-to (message-get-reply-headers wide to-address))))

    (let ((headers
	   `((Subject . ,subject)
	     ,@follow-to)))
      (unless (message-mail-user-agent)
	(message-pop-to-buffer
	 (message-buffer-name
	  (if wide "wide reply" "reply") from
	  (if wide to-address nil))
	 switch-function))
      (setq message-reply-headers
	    (make-full-mail-header 0 (cdr (assq 'Subject headers))
                                   from date message-id references 0 0 ""))
      (message-setup headers cur))))