From 5f6c08ef2c52c7fe526cbe4f9a684438f6a72007 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Thu, 16 May 2019 21:50:16 -0400 Subject: * lisp/gnus/nnheader.el (mail-header-*): Define via cl-defstruct This also has the side effect that the accessors are now defined as proper functions rather than as macros, so they can be passed to `mapcar` etc.. * lisp/gnus/nnheader.el (mail-header-number, mail-header-subject) (mail-header-from, mail-header-date, mail-header-id) (mail-header-references, mail-header-chars, mail-header-lines) (mail-header-xref, mail-header-extra): Define via cl-defstruct. (mail-header-set-number, mail-header-set-subject) (mail-header-set-from, mail-header-set-date, mail-header-set-id) (mail-header-set-message-id, mail-header-set-references) (mail-header-set-chars, mail-header-set-lines, mail-header-set-xref) (mail-header-set-extra): Remove, use `setf` instead. All callers adjusted. * lisp/gnus/gnus-sum.el (gnus-select-newsgroup) (gnus-summary-pop-limit, gnus-summary-limit-mark-excluded-as-read) (gnus-summary-find-matching, gnus-find-matching-articles): * lisp/gnus/gnus-kill.el (gnus-apply-kill-file-internal, gnus-execute): * lisp/gnus/gnus-score.el (gnus-score-adaptive): Eta-reduce, now that mail-header-FIELD are functions. --- lisp/gnus/nnweb.el | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'lisp/gnus/nnweb.el') diff --git a/lisp/gnus/nnweb.el b/lisp/gnus/nnweb.el index 7b87502d0e0..b08b27dd1eb 100644 --- a/lisp/gnus/nnweb.el +++ b/lisp/gnus/nnweb.el @@ -461,22 +461,21 @@ Valid types include `google', `dejanews', and `gmane'.") (subject (mail-header-subject header)) (rfc2047-encoding-type 'mime)) (when (string-match " \\([^:]+\\)[:/]\\([0-9]+\\)" xref) - (mail-header-set-xref - header - (format "http://article.gmane.org/%s/%s/raw" - (match-string 1 xref) - (match-string 2 xref)))) + (setf (mail-header-xref header) + (format "http://article.gmane.org/%s/%s/raw" + (match-string 1 xref) + (match-string 2 xref)))) ;; Add host part to gmane-encrypted addresses (when (string-match "@$" from) - (mail-header-set-from header - (concat from "public.gmane.org"))) + (setf (mail-header-from header) + (concat from "public.gmane.org"))) - (mail-header-set-subject header - (rfc2047-encode-string subject)) + (setf (mail-header-subject header) + (rfc2047-encode-string subject)) (unless (nnweb-get-hashtb (mail-header-xref header)) - (mail-header-set-number header (cl-incf (cdr active))) + (setf (mail-header-number header) (cl-incf (cdr active))) (push (list (mail-header-number header) header) map) (nnweb-set-hashtb (cadar map) (car map)))))) (forward-line 1))) -- cgit v1.2.3