Function: gnus-inews-add-send-actions

gnus-inews-add-send-actions is a byte-compiled function defined in gnus-msg.el.gz.

Signature

(gnus-inews-add-send-actions WINCONF BUFFER ARTICLE &optional CONFIG YANKED WINCONF-NAME)

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-msg.el.gz
(defun gnus-inews-add-send-actions (winconf buffer article
					    &optional config yanked
					    winconf-name)
  (add-hook 'message-sent-hook (if gnus-agent #'gnus-agent-possibly-do-gcc
				 #'gnus-inews-do-gcc)
	    nil t)
  (when gnus-agent
    (add-hook 'message-header-hook #'gnus-agent-possibly-save-gcc nil t))
  (setq message-post-method
	(let ((gn gnus-newsgroup-name))
	  (lambda (&optional arg) (gnus-post-method arg gn))))
  (message-add-action
   `(progn
      (setq gnus-current-window-configuration ',winconf-name)
      (when (gnus-buffer-live-p ,buffer)
	(set-window-configuration ,winconf)))
   'exit 'postpone 'kill)
  (let ((to-be-marked (cond
		       (yanked
			(mapcar
			 (lambda (x) (if (listp x) (car x) x)) yanked))
		       (article (if (listp article) article (list article)))
		       (t nil))))
    (message-add-action
     `(when (gnus-buffer-live-p ,buffer)
	(with-current-buffer ,buffer
	  ,(when to-be-marked
	     (if (eq config 'forward)
		 `(gnus-summary-mark-article-as-forwarded ',to-be-marked)
	       `(gnus-summary-mark-article-as-replied ',to-be-marked)))))
     'send)))