Function: spam-fetch-field-fast

spam-fetch-field-fast is a byte-compiled function defined in spam.el.gz.

Signature

(spam-fetch-field-fast ARTICLE FIELD &optional PREPARED-DATA-HEADER)

Documentation

Fetch a FIELD for ARTICLE with the internal gnus-data-find function.

When PREPARED-DATA-HEADER is given, don't look in the Gnus data. When FIELD is number, ARTICLE can be any number (since we want to find it out).

Source Code

;; Defined in /usr/src/emacs/lisp/gnus/spam.el.gz
;; disabled for now
;; (defun spam-get-article-as-filename (article)
;;   (let ((article-filename))
;;     (when (numberp article)
;;       (nnml-possibly-change-directory
;;        (gnus-group-real-name gnus-newsgroup-name))
;;       (setq article-filename (expand-file-name
;;                              (int-to-string article) nnml-current-directory)))
;;     (if (file-exists-p article-filename)
;;      article-filename
;;       nil)))

(defun spam-fetch-field-fast (article field &optional prepared-data-header)
  "Fetch a FIELD for ARTICLE with the internal `gnus-data-find' function.
When PREPARED-DATA-HEADER is given, don't look in the Gnus data.
When FIELD is `number', ARTICLE can be any number (since we want
to find it out)."
  (when (numberp article)
    (let* ((data-header (or prepared-data-header
                            (spam-fetch-article-header article))))
      (cond
       ((not (arrayp data-header))
        (gnus-message 6 "Article %d has a nil data header" article))
       ((equal field 'number)
	(mail-header-number data-header))
       ((equal field 'from)
	(mail-header-from data-header))
       ((equal field 'message-id)
	(mail-header-message-id data-header))
       ((equal field 'subject)
	(mail-header-subject data-header))
       ((equal field 'references)
	(mail-header-references data-header))
       ((equal field 'date)
	(mail-header-date data-header))
       ((equal field 'xref)
	(mail-header-xref data-header))
       ((equal field 'extra)
	(mail-header-extra data-header))
       (t
	(gnus-error
	 5
	 "spam-fetch-field-fast: unknown field %s requested"
	 field)
	nil)))))