Function: nndiary-save-mail

nndiary-save-mail is a byte-compiled function defined in nndiary.el.gz.

Signature

(nndiary-save-mail GROUP-ART)

Documentation

Called narrowed to an article.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nndiary.el.gz
(defun nndiary-save-mail (group-art)
  "Called narrowed to an article."
  (let (chars headers)
    (setq chars (nnmail-insert-lines))
    (nnmail-insert-xref group-art)
    (run-hooks 'nnmail-prepare-save-mail-hook)
    (run-hooks 'nndiary-prepare-save-mail-hook)
    (goto-char (point-min))
    (while (looking-at "From ")
      (replace-match "X-From-Line: ")
      (forward-line 1))
    ;; We save the article in all the groups it belongs in.
    (let ((ga group-art)
	  first)
      (while ga
	(nndiary-possibly-create-directory (caar ga))
	(let ((file (concat (nnmail-group-pathname
			     (caar ga) nndiary-directory)
			    (int-to-string (cdar ga)))))
	  (if first
	      ;; It was already saved, so we just make a hard link.
	      (funcall nnmail-crosspost-link-function first file t)
	    ;; Save the article.
	    (nnmail-write-region (point-min) (point-max) file nil
				 (if (nnheader-be-verbose 5) nil 'nomesg))
	    (setq first file)))
	(setq ga (cdr ga))))
    ;; Generate a nov line for this article.  We generate the nov
    ;; line after saving, because nov generation destroys the
    ;; header.
    (setq headers (nndiary-parse-head chars))
    ;; Output the nov line to all nov databases that should have it.
    (let ((ga group-art))
      (while ga
	(nndiary-add-nov (caar ga) (cdar ga) headers)
	(setq ga (cdr ga))))
    group-art))