Function: gnus-summary-reparent-children

gnus-summary-reparent-children is an interactive and byte-compiled function defined in gnus-sum.el.gz.

Signature

(gnus-summary-reparent-children PARENT CHILDREN)

Documentation

Make PARENT the parent of CHILDREN.

When called interactively, PARENT is the current article and CHILDREN are the process-marked articles.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/gnus-sum.el.gz
(defun gnus-summary-reparent-children (parent children)
  "Make PARENT the parent of CHILDREN.
When called interactively, PARENT is the current article and CHILDREN
are the process-marked articles."
  (interactive (list
		(gnus-summary-article-number)
		(gnus-summary-work-articles nil))
	       gnus-summary-mode)
  (dolist (child children)
    (save-window-excursion
      (let ((gnus-article-buffer " *reparent*"))
	(unless (not (eq parent child))
	  (error "An article may not be self-referential"))
	(let ((message-id (mail-header-id
			   (gnus-summary-article-header parent))))
	  (unless (and message-id (not (equal message-id "")))
	    (error "No message-id in desired parent"))
	  (gnus-with-article child
	    (save-restriction
	      (goto-char (point-min))
	      (message-narrow-to-head)
	      (if (re-search-forward "^References: " nil t)
		  (progn
		    (re-search-forward "^[^ \t]" nil t)
		    (forward-line -1)
		    (end-of-line)
		    (insert " " message-id))
		(insert "References: " message-id "\n"))))
	  (set-buffer gnus-summary-buffer)
	  (gnus-summary-unmark-all-processable)
	  (gnus-summary-update-article child)
	  (when (gnus-summary-goto-subject (cdr gnus-article-current) nil t)
	    (gnus-summary-update-secondary-mark (cdr gnus-article-current)))
	  (gnus-summary-rethread-current)
	  (gnus-message 3 "Article %d is now the child of article %d"
			child parent))))))