Function: message-cross-post-followup-to-header

message-cross-post-followup-to-header is an interactive and byte-compiled function defined in message.el.gz.

Signature

(message-cross-post-followup-to-header TARGET-GROUP)

Documentation

Mangles FollowUp-To and Newsgroups header to point to TARGET-GROUP.

With prefix-argument just set Follow-Up, don't cross-post.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/message.el.gz
(defun message-cross-post-followup-to-header (target-group)
  "Mangles FollowUp-To and Newsgroups header to point to TARGET-GROUP.
With prefix-argument just set Follow-Up, don't cross-post."
  (interactive
   (list				; Completion based on Gnus
    (replace-regexp-in-string
     "\\`.*:" ""
     (completing-read "Followup To: "
		      (if (boundp 'gnus-newsrc-alist)
			  gnus-newsrc-alist)
		      nil nil '("poster" . 0)
		      (if (boundp 'gnus-group-history)
			  'gnus-group-history))))
   message-mode)
  (message-remove-header "Follow[Uu]p-[Tt]o" t)
  (message-goto-newsgroups)
  (beginning-of-line)
  ;; if we already did a crosspost before, kill old target
  (if (and message-cross-post-old-target
	   (re-search-forward
	    (regexp-quote (concat "," message-cross-post-old-target))
	    nil t))
      (replace-match ""))
  ;; unless (followup is to poster or user explicitly asked not
  ;; to cross-post, or target-group is already in Newsgroups)
  ;; add target-group to Newsgroups line.
  (cond ((and (or
	       ;; def: cross-post, req:no
	       (and message-cross-post-default (not current-prefix-arg))
	       ;; def: no-cross-post, req:yes
	       (and (not message-cross-post-default) current-prefix-arg))
	      (not (string-match "poster" target-group))
	      (not (string-match (regexp-quote target-group)
				 (message-fetch-field "Newsgroups"))))
	 (end-of-line)
	 (insert (concat "," target-group))))
  (end-of-line) ; ensure Followup: comes after Newsgroups:
  ;; unless new followup would be identical to Newsgroups line
  ;; make a new Followup-To line
  (if (not (string-match (concat "^[ \t]*"
				 target-group
				 "[ \t]*$")
			 (message-fetch-field "Newsgroups")))
      (insert (concat "\nFollowup-To: " target-group)))
  (setq message-cross-post-old-target target-group))