Function: gnus-summary-attach-article

gnus-summary-attach-article is an interactive and byte-compiled function defined in gnus-msg.el.gz.

Signature

(gnus-summary-attach-article N)

Documentation

Attach the current article(s) to an outgoing Message buffer.

If any current in-progress Message buffers exist, the articles can be attached to them. If not, a new Message buffer is created.

This command uses the process/prefix convention, so if you process-mark several articles, they will all be attached.

Probably introduced at or before Emacs version 27.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-msg.el.gz
(defun gnus-summary-attach-article (n)
  "Attach the current article(s) to an outgoing Message buffer.
If any current in-progress Message buffers exist, the articles
can be attached to them.  If not, a new Message buffer is
created.

This command uses the process/prefix convention, so if you
process-mark several articles, they will all be attached."
  (interactive "P" gnus-summary-mode)
  (let ((buffers (message-buffers))
	destination)
    ;; Set up the destination mail composition buffer.
    (if (and buffers
	     (y-or-n-p "Attach files to existing mail composition buffer? "))
	(setq destination
	      (if (= (length buffers) 1)
		  (get-buffer (car buffers))
		(gnus-completing-read "Attach to buffer"
                                      buffers t nil nil (car buffers))))
      (gnus-summary-mail-other-window)
      (setq destination (current-buffer)))
    (gnus-summary-expand-window)
    (gnus-summary-iterate n
      (gnus-summary-select-article)
      (with-current-buffer destination
	;; Attach at the end of the buffer.
	(save-excursion
	  (goto-char (point-max))
	  (message-forward-make-body-mime gnus-original-article-buffer))))
    (gnus-configure-windows 'message t)))