;; message field fetchers
(defun gnus-registry-fetch-message-id-fast (article)
- "Fetch the Message-ID quickly, using the internal gnus-data-list function."
- (if (and (numberp article)
- (assoc article (gnus-data-list nil)))
- (mail-header-id (gnus-data-header (assoc article (gnus-data-list nil))))
- nil))
+ "Fetch the Message-ID quickly, using the internal `gnus-data-find' function."
+ (when-let* ((data (and (numberp article) (gnus-data-find article))))
+ (mail-header-id (gnus-data-header data))))
(defun gnus-registry-extract-addresses (text)
"Extract all the addresses in a normalized way from TEXT.
nil))
(defun gnus-registry-fetch-simplified-message-subject-fast (article)
- "Fetch the Subject quickly, using the internal gnus-data-list function."
- (if (and (numberp article)
- (assoc article (gnus-data-list nil)))
- (gnus-string-remove-all-properties
- (gnus-registry-simplify-subject
- (mail-header-subject (gnus-data-header
- (assoc article (gnus-data-list nil))))))
- nil))
+ "Fetch the Subject quickly, using the internal `gnus-data-find' function."
+ (when-let* ((data (and (numberp article) (gnus-data-find article))))
+ (gnus-string-remove-all-properties
+ (gnus-registry-simplify-subject
+ (mail-header-subject (gnus-data-header data))))))
(defun gnus-registry-fetch-sender-fast (article)
- (when-let* ((data (and (numberp article)
- (assoc article (gnus-data-list nil)))))
+ (when-let* ((data (and (numberp article) (gnus-data-find article))))
(mail-header-from (gnus-data-header data))))
(defun gnus-registry-fetch-recipients-fast (article)
- (when-let* ((data (and (numberp article)
- (assoc article (gnus-data-list nil))))
+ (when-let* ((data (and (numberp article) (gnus-data-find article)))
(extra (mail-header-extra (gnus-data-header data))))
(gnus-registry-sort-addresses
(or (cdr (assq 'Cc extra)) "")
(gnus-message 9 "Applying mark %s to %d articles"
mark (length articles))
(dolist (article articles)
- (gnus-summary-update-article
- article
- (assoc article (gnus-data-list nil))))))
+ (gnus-summary-update-article article (gnus-data-find article)))))
;; This is ugly code, but I don't know how to do it better.
(defun gnus-registry-install-shortcuts ()
"Add OFFSET to the POS of all data entries in DATA."
(setq gnus-newsgroup-data-reverse nil)
(while data
- (setcar (nthcdr 2 (car data)) (+ offset (nth 2 (car data))))
+ (cl-incf (gnus-data-pos (car data)) offset)
(setq data (cdr data))))
(defun gnus-summary-article-pseudo-p (article)
"Return whether ARTICLE is the first article in the buffer."
(if (not (setq article (or article (gnus-summary-article-number))))
nil
- (eq article (caar gnus-newsgroup-data))))
+ (eq article (gnus-data-number (car gnus-newsgroup-data)))))
(defun gnus-summary-last-article-p (&optional article)
"Return whether ARTICLE is the last article in the buffer."
(push thr roots))
(setq thread (cdr thread)))
;; We now have all (unique) roots.
- (if (= (length roots) 1)
- ;; All the loose roots are now one solid root.
- (setq thread (car roots))
- (setq thread (cons subject (gnus-sort-threads roots))))))
+ (setq thread (if (= (length roots) 1)
+ ;; All the loose roots are now one solid root.
+ (car roots)
+ (cons subject (gnus-sort-threads roots))))))
(let (threads)
;; We then insert this thread into the summary buffer.
(when line
(if gnus-show-threads
(gnus-summary-prepare-threads (gnus-cut-threads (list thread)))
(gnus-summary-prepare-unthreaded thread))
+ ;; FIXME: Why is this `nreverse' safe? Don't we need `reverse' instead?
(setq data (nreverse gnus-newsgroup-data))
(setq threads gnus-newsgroup-threads))
;; We splice the new data into the data structure.
(run-hook-with-args 'gnus-summary-article-delete-hook
action
(gnus-data-header
- (assoc article (gnus-data-list nil)))
+ (gnus-data-find-in article (gnus-data-list nil)))
gnus-newsgroup-name nil
select-method)))
(t
;; run the move/copy/crosspost/respool hook
(run-hook-with-args 'gnus-summary-article-move-hook
action
- (gnus-data-header
- (assoc article (gnus-data-list nil)))
+ (gnus-data-header (gnus-data-find article))
gnus-newsgroup-name
to-newsgroup
select-method))
(run-hook-with-args
'gnus-summary-article-expire-hook
'delete
- (gnus-data-header (assoc article (gnus-data-list nil)))
+ (gnus-data-header (gnus-data-find article))
gnus-newsgroup-name
(cond
((stringp nnmail-expiry-target) nnmail-expiry-target)
(unless (memq (car articles) not-deleted)
(gnus-summary-mark-article (car articles) gnus-canceled-mark)
(let* ((article (car articles))
- (ghead (gnus-data-header
- (assoc article (gnus-data-list nil)))))
+ (ghead (gnus-data-header (gnus-data-find article))))
(run-hook-with-args 'gnus-summary-article-delete-hook
'delete ghead gnus-newsgroup-name nil
nil)))
If ALL is a number, fetch this number of articles."
(interactive "P")
(prog1
- (let ((old (sort (mapcar #'car gnus-newsgroup-data) #'<))
+ (let ((old (sort (mapcar #'gnus-data-number gnus-newsgroup-data) #'<))
older len)
(setq older
;; Some nntp servers lie about their active range. When
(defun gnus-summary-insert-new-articles ()
"Insert all new articles in this group."
(interactive)
- (let ((old (sort (mapcar #'car gnus-newsgroup-data) #'<))
+ (let ((old (sort (mapcar #'gnus-data-number gnus-newsgroup-data) #'<))
(old-high gnus-newsgroup-highest)
(nnmail-fetched-sources (list t))
(new-active (gnus-activate-group gnus-newsgroup-name 'scan))
;; nil)))
(defun spam-fetch-field-fast (article field &optional prepared-data-header)
- "Fetch a FIELD for ARTICLE with the internal `gnus-data-list' function.
+ "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)."
(defun spam-fetch-article-header (article)
(with-current-buffer gnus-summary-buffer
(gnus-read-header article)
- (nth 3 (assq article gnus-newsgroup-data))))
+ (gnus-data-header (gnus-data-find article))))
;;}}}
;;{{{ Spam determination.