Function: rmail-summary-output

rmail-summary-output is an interactive and byte-compiled function defined in rmailsum.el.gz.

Signature

(rmail-summary-output &optional FILE-NAME N)

Documentation

Append this message to mail file FILE-NAME.

This works with both mbox format and Babyl format files, outputting in the appropriate format for each. The default file name comes from rmail-default-file, which is updated to the name you use in this command.

A prefix argument N says to output that many consecutive messages from those in the summary, starting with the current one. Deleted messages are skipped and don't count. When called from Lisp code, N may be omitted and defaults to 1.

This command always outputs the complete message header, even if the header display is currently pruned.

Key Bindings

Aliases

rmail-summary-output-to-rmail-file

Source Code

;; Defined in /usr/src/emacs/lisp/mail/rmailsum.el.gz
;; Summary output commands.

(defun rmail-summary-output (&optional file-name n)
  "Append this message to mail file FILE-NAME.
This works with both mbox format and Babyl format files,
outputting in the appropriate format for each.
The default file name comes from `rmail-default-file',
which is updated to the name you use in this command.

A prefix argument N says to output that many consecutive messages
from those in the summary, starting with the current one.
Deleted messages are skipped and don't count.
When called from Lisp code, N may be omitted and defaults to 1.

This command always outputs the complete message header,
even if the header display is currently pruned."
  (interactive
   (progn (require 'rmailout)
	  (list (rmail-output-read-file-name)
		(prefix-numeric-value current-prefix-arg))))
  (let ((i 0) prev-msg)
    (while
	(and (< i n)
	     (progn (rmail-summary-goto-msg)
		    (not (eq prev-msg
			     (setq prev-msg
				   (with-current-buffer rmail-buffer
				     rmail-current-message))))))
      (setq i (1+ i))
      (with-current-buffer rmail-buffer
	(let ((rmail-delete-after-output nil))
	  (rmail-output file-name 1)))
      (if rmail-delete-after-output
	  (rmail-summary-delete-forward nil)
	(if (< i n)
	    (rmail-summary-next-msg 1))))))