Function: gnus-uu-digest-mail-forward

gnus-uu-digest-mail-forward is an autoloaded, interactive and byte-compiled function defined in gnus-uu.el.gz.

Signature

(gnus-uu-digest-mail-forward &optional N POST)

Documentation

Digest and forward all articles in this series.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-uu.el.gz
;; Digest and forward articles

(defun gnus-uu-digest-mail-forward (&optional n post)
  "Digest and forward all articles in this series."
  (interactive "P" gnus-article-mode gnus-summary-mode)
  (gnus-uu-initialize)
  (let ((gnus-uu-save-in-digest t)
	(file (make-temp-file (nnheader-concat gnus-uu-work-dir "forward")))
	(message-forward-as-mime message-forward-as-mime)
	(mail-parse-charset gnus-newsgroup-charset)
	(mail-parse-ignored-charsets gnus-newsgroup-ignored-charsets)
	gnus-uu-digest-buffer subject from)
    (if (and n (not (numberp n)))
	(setq message-forward-as-mime (not message-forward-as-mime)
	      n nil))
    (let ((gnus-article-reply (gnus-summary-work-articles n)))
      (when (and (not n)
		 (= (length gnus-article-reply) 1))
	;; The case where neither a number of articles nor a region is
	;; specified.
	(gnus-summary-top-thread)
	(setq gnus-article-reply (nreverse (gnus-uu-find-articles-matching))))
      (gnus-setup-message 'forward
	(setq gnus-uu-digest-from-subject nil)
	(setq gnus-uu-digest-buffer
	      (gnus-get-buffer-create " *gnus-uu-forward*"))
	;; Specify articles to be forwarded.  Note that they should be
	;; reversed; see `gnus-uu-get-list-of-articles'.
	(let ((gnus-newsgroup-processable (reverse gnus-article-reply)))
	  (gnus-uu-decode-save n file)
	  (setq gnus-article-reply gnus-newsgroup-processable))
	;; Restore the value of `gnus-newsgroup-processable' to which
	;; it should be set when it is not `let'-bound.
	(setq gnus-newsgroup-processable (reverse gnus-article-reply))
	(switch-to-buffer gnus-uu-digest-buffer)
	(let ((fs gnus-uu-digest-from-subject))
	  (when fs
	    (setq from (caar fs)
		  subject (gnus-simplify-subject-fuzzy (cdar fs))
		  fs (cdr fs))
	    (while (and fs (or from subject))
	      (when from
		(unless (string= from (caar fs))
		  (setq from nil)))
	      (when subject
		(unless (string= (gnus-simplify-subject-fuzzy (cdar fs))
				 subject)
		  (setq subject nil)))
	      (setq fs (cdr fs))))
	  (unless subject
	    (setq subject "Digested Articles"))
	  (unless from
	    (setq from
		  (if (gnus-news-group-p gnus-newsgroup-name)
		      gnus-newsgroup-name
		    "Various"))))
	(goto-char (point-min))
	(when (re-search-forward "^Subject: ")
          (delete-region (point) (line-end-position))
	  (insert subject))
	(goto-char (point-min))
	(when (re-search-forward "^From:")
          (delete-region (point) (line-end-position))
	  (insert " " from))
	(let ((message-forward-decoded-p t))
	  (message-forward post t))))
    (setq gnus-uu-digest-from-subject nil)))