- (file (make-temp-name (nnheader-concat gnus-uu-tmp-dir "forward")))
- buf subject from)
- (gnus-setup-message 'forward
- (setq gnus-uu-digest-from-subject nil)
- (gnus-uu-decode-save n file)
- (setq buf (switch-to-buffer
- (gnus-get-buffer-create " *gnus-uu-forward*")))
- (erase-buffer)
- (insert-file file)
- (delete-file file)
- (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) (gnus-point-at-eol))
- (insert subject))
- (goto-char (point-min))
- (when (re-search-forward "^From: ")
- (delete-region (point) (gnus-point-at-eol))
- (insert from))
- (message-forward post))
+ (file (mm-make-temp-file (nnheader-concat gnus-uu-tmp-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) (point-at-eol))
+ (insert subject))
+ (goto-char (point-min))
+ (when (re-search-forward "^From:")
+ (delete-region (point) (point-at-eol))
+ (insert " " from))
+ (let ((message-forward-decoded-p t))
+ (message-forward post t))))