Function: nnmail-split-fancy-with-parent

nnmail-split-fancy-with-parent is a byte-compiled function defined in nnmail.el.gz.

Signature

(nnmail-split-fancy-with-parent)

Documentation

Split this message into the same group as its parent.

This function can be used as an entry in nnmail-split-fancy(var)/nnmail-split-fancy(fun), for example like this: (: nnmail-split-fancy-with-parent) For a message to be split, it looks for the parent message in the References or In-Reply-To header and then looks in the message id cache file (given by the variable nnmail-message-id-cache-file) to see which group that message was put in. This group is returned.

See the Info node (gnus)Fancy Mail Splitting for more details.

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/nnmail.el.gz
;; Function for nnmail-split-fancy: look up all references in the
;; cache and if a match is found, return that group.
(defun nnmail-split-fancy-with-parent ()
  "Split this message into the same group as its parent.
This function can be used as an entry in `nnmail-split-fancy', for
example like this: (: nnmail-split-fancy-with-parent)
For a message to be split, it looks for the parent message in the
References or In-Reply-To header and then looks in the message id
cache file (given by the variable `nnmail-message-id-cache-file') to
see which group that message was put in.  This group is returned.

See the Info node `(gnus)Fancy Mail Splitting' for more details."
  (let* ((refstr (or (message-fetch-field "references")
		     (message-fetch-field "in-reply-to")))
	 (references nil)
	 (res nil)
	 (regexp (if (consp nnmail-split-fancy-with-parent-ignore-groups)
		     (mapconcat
		      (lambda (x) (format "\\(%s\\)" x))
		      nnmail-split-fancy-with-parent-ignore-groups
		      "\\|")
		   nnmail-split-fancy-with-parent-ignore-groups)))
    (when refstr
      (setq references (nreverse (gnus-split-references refstr)))
      (unless (gnus-buffer-live-p nnmail-cache-buffer)
	(nnmail-cache-open))
      (dolist (x references)
	(setq res (or (nnmail-cache-fetch-group x) res))
	(when (or (member res '("delayed" "drafts" "queue"))
		  (and regexp res (string-match regexp res)))
	  (setq res nil)))
      res)))