diff options
Diffstat (limited to 'lisp/gnus')
-rw-r--r-- | lisp/gnus/gnus-art.el | 5 | ||||
-rw-r--r-- | lisp/gnus/gnus-cite.el | 4 | ||||
-rw-r--r-- | lisp/gnus/gnus-group.el | 38 | ||||
-rw-r--r-- | lisp/gnus/gnus-range.el | 17 | ||||
-rw-r--r-- | lisp/gnus/gnus-registry.el | 6 | ||||
-rw-r--r-- | lisp/gnus/gnus-score.el | 4 | ||||
-rw-r--r-- | lisp/gnus/gnus-sum.el | 11 | ||||
-rw-r--r-- | lisp/gnus/gnus-uu.el | 4 | ||||
-rw-r--r-- | lisp/gnus/mm-partial.el | 16 | ||||
-rw-r--r-- | lisp/gnus/nndiary.el | 2 | ||||
-rw-r--r-- | lisp/gnus/nnimap.el | 10 | ||||
-rw-r--r-- | lisp/gnus/nnselect.el | 68 | ||||
-rw-r--r-- | lisp/gnus/nnvirtual.el | 6 | ||||
-rw-r--r-- | lisp/gnus/spam-stat.el | 2 | ||||
-rw-r--r-- | lisp/gnus/spam.el | 14 |
15 files changed, 97 insertions, 110 deletions
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el index c1071c1c68c..d989a4d5bb5 100644 --- a/lisp/gnus/gnus-art.el +++ b/lisp/gnus/gnus-art.el @@ -6648,9 +6648,10 @@ not have a face in `gnus-article-boring-faces'." (catch 'only-boring (while (re-search-forward "\\b\\w\\w" nil t) (forward-char -1) - (when (not (gnus-intersection + (when (not (seq-intersection (gnus-faces-at (point)) - (symbol-value 'gnus-article-boring-faces))) + (symbol-value 'gnus-article-boring-faces) + #'eq)) (throw 'only-boring nil))) (throw 'only-boring t)))))) diff --git a/lisp/gnus/gnus-cite.el b/lisp/gnus/gnus-cite.el index 1f564f192b0..4249b50b9ff 100644 --- a/lisp/gnus/gnus-cite.el +++ b/lisp/gnus/gnus-cite.el @@ -839,7 +839,7 @@ See also the documentation for `gnus-article-highlight-citation'." (setq current (car loop) loop (cdr loop)) (setcdr current - (gnus-set-difference (cdr current) numbers))))))))) + (seq-difference (cdr current) numbers #'eq))))))))) (defun gnus-cite-parse-attributions () (let (al-alist) @@ -999,7 +999,7 @@ See also the documentation for `gnus-article-highlight-citation'." loop (cdr loop)) (if (eq current best) () - (setcdr current (gnus-set-difference (cdr current) numbers)) + (setcdr current (seq-difference (cdr current) numbers #'eq)) (when (null (cdr current)) (setq gnus-cite-loose-prefix-alist (delq current gnus-cite-loose-prefix-alist) diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el index 909391b6b0c..423b180408a 100644 --- a/lisp/gnus/gnus-group.el +++ b/lisp/gnus/gnus-group.el @@ -4697,20 +4697,20 @@ This command may read the active file." (gnus-cache-open)) (funcall gnus-group-prepare-function (or level gnus-level-subscribed) - #'(lambda (info) - (let ((marks (gnus-info-marks info))) - (assq 'cache marks))) + (lambda (info) + (let ((marks (gnus-info-marks info))) + (assq 'cache marks))) lowest - #'(lambda (group) - (or (gethash group - gnus-cache-active-hashtb) - ;; Cache active file might use "." - ;; instead of ":". - (gethash - (mapconcat #'identity - (split-string group ":") - ".") - gnus-cache-active-hashtb)))) + (lambda (group) + (or (gethash group + gnus-cache-active-hashtb) + ;; Cache active file might use "." + ;; instead of ":". + (gethash + (mapconcat #'identity + (split-string group ":") + ".") + gnus-cache-active-hashtb)))) (goto-char (point-min)) (gnus-group-position-point)) @@ -4728,9 +4728,9 @@ This command may read the active file." (gnus-cache-open)) (funcall gnus-group-prepare-function (or level gnus-level-subscribed) - #'(lambda (info) - (let ((marks (gnus-info-marks info))) - (assq 'dormant marks))) + (lambda (info) + (let ((marks (gnus-info-marks info))) + (assq 'dormant marks))) lowest 'ignore) (goto-char (point-min)) @@ -4750,9 +4750,9 @@ This command may read the active file." (gnus-cache-open)) (funcall gnus-group-prepare-function (or level gnus-level-subscribed) - #'(lambda (info) - (let ((marks (gnus-info-marks info))) - (assq 'tick marks))) + (lambda (info) + (let ((marks (gnus-info-marks info))) + (assq 'tick marks))) lowest 'ignore) (goto-char (point-min)) diff --git a/lisp/gnus/gnus-range.el b/lisp/gnus/gnus-range.el index 6cc60cb49b3..7d12ae9fdcc 100644 --- a/lisp/gnus/gnus-range.el +++ b/lisp/gnus/gnus-range.el @@ -42,13 +42,8 @@ If RANGE is a single range, return (RANGE). Otherwise, return RANGE." (defun gnus-set-difference (list1 list2) "Return a list of elements of LIST1 that do not appear in LIST2." - (let ((hash2 (make-hash-table :test 'eq)) - (result nil)) - (dolist (elt list2) (puthash elt t hash2)) - (dolist (elt list1) - (unless (gethash elt hash2) - (setq result (cons elt result)))) - (nreverse result))) + (declare (obsolete seq-difference "28.1")) + (seq-difference list1 list2 #'eq)) (defun gnus-range-nconcat (&rest ranges) "Return a range comprising all the RANGES, which are pre-sorted. @@ -179,12 +174,8 @@ Both lists have to be sorted over <." ;;;###autoload (defun gnus-intersection (list1 list2) - (let ((result nil)) - (while list2 - (when (memq (car list2) list1) - (setq result (cons (car list2) result))) - (setq list2 (cdr list2))) - result)) + (declare (obsolete seq-intersection "28.1")) + (nreverse (seq-intersection list1 list2 #'eq))) ;;;###autoload (defun gnus-sorted-intersection (list1 list2) diff --git a/lisp/gnus/gnus-registry.el b/lisp/gnus/gnus-registry.el index e3b9c196186..6ac646fbeac 100644 --- a/lisp/gnus/gnus-registry.el +++ b/lisp/gnus/gnus-registry.el @@ -1290,9 +1290,9 @@ from your existing entries." (registry-reindex db) (cl-loop for k being the hash-keys of (oref db data) using (hash-value v) - do (let ((newv (delq nil (mapcar #'(lambda (entry) - (unless (member (car entry) extra) - entry)) + do (let ((newv (delq nil (mapcar (lambda (entry) + (unless (member (car entry) extra) + entry)) v)))) (registry-delete db (list k) nil) (gnus-registry-insert db k newv))) diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el index ce64dcef041..f40da9e9c4c 100644 --- a/lisp/gnus/gnus-score.el +++ b/lisp/gnus/gnus-score.el @@ -1182,8 +1182,8 @@ If FORMAT, also format the current score file." (when (consp rule) ;; the rule exists (setq rule (if (symbolp (car rule)) (format "(%S)" (car rule)) - (mapconcat #'(lambda (obj) - (regexp-quote (format "%S" obj))) + (mapconcat (lambda (obj) + (regexp-quote (format "%S" obj))) rule sep))) (goto-char (point-min)) diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index c30f9a5f350..eeb5ac851ae 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el @@ -5676,9 +5676,9 @@ or a straight list of headers." (or dependencies (with-current-buffer gnus-summary-buffer gnus-newsgroup-dependencies)))) - (delq nil (mapcar #'(lambda (header) - (gnus-dependencies-add-header - header dependencies force-new)) + (delq nil (mapcar (lambda (header) + (gnus-dependencies-add-header + header dependencies force-new)) gnus-headers-retrieved-by))))) (gnus-message 7 "Fetching headers for %s...done" gnus-newsgroup-name))) @@ -8569,8 +8569,9 @@ If UNREPLIED (the prefix), limit to unreplied articles." (interactive "P" gnus-summary-mode) (if unreplied (gnus-summary-limit - (gnus-set-difference gnus-newsgroup-articles - gnus-newsgroup-replied)) + (seq-difference gnus-newsgroup-articles + gnus-newsgroup-replied + #'eq)) (gnus-summary-limit gnus-newsgroup-replied)) (gnus-summary-position-point)) diff --git a/lisp/gnus/gnus-uu.el b/lisp/gnus/gnus-uu.el index bd9a1a33ec3..ceb2ebcdcb1 100644 --- a/lisp/gnus/gnus-uu.el +++ b/lisp/gnus/gnus-uu.el @@ -578,8 +578,8 @@ didn't work, and overwrite existing files. Otherwise, ask each time." (defun gnus-new-processable (unmarkp articles) (if unmarkp - (gnus-intersection gnus-newsgroup-processable articles) - (gnus-set-difference articles gnus-newsgroup-processable))) + (nreverse (seq-intersection gnus-newsgroup-processable articles #'eq)) + (seq-difference articles gnus-newsgroup-processable #'eq))) (defun gnus-uu-mark-by-regexp (regexp &optional unmark) "Set the process mark on articles whose subjects match REGEXP. diff --git a/lisp/gnus/mm-partial.el b/lisp/gnus/mm-partial.el index 0c25c8f8bcd..0c628055acb 100644 --- a/lisp/gnus/mm-partial.el +++ b/lisp/gnus/mm-partial.el @@ -72,14 +72,14 @@ If NO-DISPLAY is nil, display it. Otherwise, do nothing after replacing." id (with-current-buffer gnus-summary-buffer (gnus-summary-article-number)))) - #'(lambda (a b) - (let ((anumber (string-to-number - (cdr (assq 'number - (cdr (mm-handle-type a)))))) - (bnumber (string-to-number - (cdr (assq 'number - (cdr (mm-handle-type b))))))) - (< anumber bnumber))))) + (lambda (a b) + (let ((anumber (string-to-number + (cdr (assq 'number + (cdr (mm-handle-type a)))))) + (bnumber (string-to-number + (cdr (assq 'number + (cdr (mm-handle-type b))))))) + (< anumber bnumber))))) (setq gnus-article-mime-handles (mm-merge-handles gnus-article-mime-handles phandles)) (with-current-buffer (generate-new-buffer " *mm*") diff --git a/lisp/gnus/nndiary.el b/lisp/gnus/nndiary.el index 15003fabcd2..adf4427523f 100644 --- a/lisp/gnus/nndiary.el +++ b/lisp/gnus/nndiary.el @@ -558,7 +558,7 @@ all. This may very well take some time.") (nnmail-activate 'nndiary) ;; Articles not listed in active-articles are already gone, ;; so don't try to expire them. - (setq articles (gnus-intersection articles active-articles)) + (setq articles (nreverse (seq-intersection articles active-articles #'eq))) (while articles (setq article (nndiary-article-to-file (setq number (pop articles)))) (if (and (nndiary-deletable-article-p group number) diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index f06959f65d9..8990b2bebeb 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -1614,13 +1614,15 @@ If LIMIT, first try to limit the search to the N last articles." (setq start-article 1)) (let* ((unread (gnus-compress-sequence - (gnus-set-difference - (gnus-set-difference + (seq-difference + (seq-difference existing (gnus-sorted-union (cdr (assoc '%Seen flags)) - (cdr (assoc '%Deleted flags)))) - (cdr (assoc '%Flagged flags))))) + (cdr (assoc '%Deleted flags))) + #'eq) + (cdr (assoc '%Flagged flags)) + #'eq))) (read (gnus-range-difference (cons start-article high) unread))) (when (> start-article 1) diff --git a/lisp/gnus/nnselect.el b/lisp/gnus/nnselect.el index 1daa8aa673b..e314e1d8d10 100644 --- a/lisp/gnus/nnselect.el +++ b/lisp/gnus/nnselect.el @@ -100,8 +100,8 @@ (setq selection (vconcat (cl-map 'vector - #'(lambda (art) - (vector artgroup art artrsv)) + (lambda (art) + (vector artgroup art artrsv)) (gnus-uncompress-sequence artseq)) selection))) selection))) @@ -211,12 +211,12 @@ as `(keyfunc member)' and the corresponding element is just #'nnselect-article-group #'nnselect-article-number)) ((eq ,type 'tuple) (nnselect-categorize ,articles - #'(lambda (elem) - (nnselect-article-group (car elem))) - #'(lambda (elem) - (cons (nnselect-article-number - (car elem)) - (cdr elem))))) + (lambda (elem) + (nnselect-article-group (car elem))) + (lambda (elem) + (cons (nnselect-article-number + (car elem)) + (cdr elem))))) (t (nnselect-categorize ,articles #'nnselect-article-group @@ -464,8 +464,8 @@ If this variable is nil, or if the provided function returns nil, (error "Group %s does not support article expiration" artgroup)) (unless (gnus-check-server (gnus-find-method-for-group artgroup)) (error "Couldn't open server for group %s" artgroup)) - (push (mapcar #'(lambda (art) - (car (rassq art artids))) + (push (mapcar (lambda (art) + (car (rassq art artids))) (let ((nnimap-expunge 'immediately)) (gnus-request-expire-articles artlist artgroup force))) @@ -549,8 +549,8 @@ If this variable is nil, or if the provided function returns nil, (gnus-add-to-range (gnus-info-read info) (delq nil (mapcar - #'(lambda (art) - (unless (memq (cdr art) unread) (car art))) + (lambda (art) + (unless (memq (cdr art) unread) (car art))) artids)))) (pcase-dolist (`(,type . ,mark-list) marks) (let ((mark-type (gnus-article-mark-to-type type)) new) @@ -560,19 +560,19 @@ If this variable is nil, or if the provided function returns nil, (cond ((eq mark-type 'tuple) (mapcar - #'(lambda (id) - (let (mark) - (when - (setq mark (assq (cdr id) mark-list)) - (cons (car id) (cdr mark))))) + (lambda (id) + (let (mark) + (when + (setq mark (assq (cdr id) mark-list)) + (cons (car id) (cdr mark))))) artids)) (t (setq mark-list (gnus-uncompress-range mark-list)) (mapcar - #'(lambda (id) - (when (memq (cdr id) mark-list) - (car id))) artids))))) + (lambda (id) + (when (memq (cdr id) mark-list) + (car id))) artids))))) (let ((previous (alist-get type newmarks))) (if previous (nconc previous new) @@ -607,8 +607,8 @@ If this variable is nil, or if the provided function returns nil, (let ((thread (gnus-id-to-thread (mail-header-id header)))) (when thread - (cl-some #'(lambda (x) - (when (and x (> x 0)) x)) + (cl-some (lambda (x) + (when (and x (> x 0)) x)) (gnus-articles-in-thread thread))))))))) ;; Check if search-based thread referral is permitted, and ;; available. @@ -642,15 +642,15 @@ If this variable is nil, or if the provided function returns nil, old-arts seq headers) (mapc - #'(lambda (article) - (if - (setq seq - (cl-position article - gnus-newsgroup-selection :test 'equal)) - (push (1+ seq) old-arts) - (setq gnus-newsgroup-selection - (vconcat gnus-newsgroup-selection (vector article))) - (cl-incf last))) + (lambda (article) + (if + (setq seq + (cl-position article + gnus-newsgroup-selection :test 'equal)) + (push (1+ seq) old-arts) + (setq gnus-newsgroup-selection + (vconcat gnus-newsgroup-selection (vector article))) + (cl-incf last))) new-nnselect-artlist) (setq headers (gnus-fetch-headers @@ -671,9 +671,9 @@ If this variable is nil, or if the provided function returns nil, (when (setq new-marks (delq nil (mapcar - #'(lambda (art) - (when (memq (cdr art) marked) - (car art))) + (lambda (art) + (when (memq (cdr art) marked) + (car art))) artids))) (nconc (symbol-value diff --git a/lisp/gnus/nnvirtual.el b/lisp/gnus/nnvirtual.el index b3b701e4126..03a0ff296f2 100644 --- a/lisp/gnus/nnvirtual.el +++ b/lisp/gnus/nnvirtual.el @@ -362,9 +362,9 @@ It is computed from the marks of individual component groups.") (dolist (group nnvirtual-component-groups) (setq unexpired (nconc unexpired (mapcar - #'(lambda (article) - (nnvirtual-reverse-map-article - group article)) + (lambda (article) + (nnvirtual-reverse-map-article + group article)) (gnus-uncompress-range (gnus-group-expire-articles-1 group)))))) (sort (delq nil unexpired) #'<))) diff --git a/lisp/gnus/spam-stat.el b/lisp/gnus/spam-stat.el index 3e804ecb4bb..ab9be0da890 100644 --- a/lisp/gnus/spam-stat.el +++ b/lisp/gnus/spam-stat.el @@ -492,7 +492,7 @@ Add user supplied modifications if supplied." (let* ((probs (mapcar #'cadr spam-stat-score-data)) (prod (apply #'* probs)) (score0 - (/ prod (+ prod (apply #'* (mapcar #'(lambda (x) (- 1 x)) + (/ prod (+ prod (apply #'* (mapcar (lambda (x) (- 1 x)) probs))))) (score1s (condition-case nil diff --git a/lisp/gnus/spam.el b/lisp/gnus/spam.el index d00f0a60b66..3f978918b9a 100644 --- a/lisp/gnus/spam.el +++ b/lisp/gnus/spam.el @@ -710,16 +710,8 @@ finds ham or spam.") (defun spam-set-difference (list1 list2) "Return a set difference of LIST1 and LIST2. When either list is nil, the other is returned." - (if (and list1 list2) - ;; we have two non-nil lists - (progn - (dolist (item (append list1 list2)) - (when (and (memq item list1) (memq item list2)) - (setq list1 (delq item list1)) - (setq list2 (delq item list2)))) - (append list1 list2)) - ;; if either of the lists was nil, return the other one - (if list1 list1 list2))) + (declare (obsolete seq-difference "28.1")) + (seq-difference list1 list2 #'eq)) (defun spam-group-ham-mark-p (group mark &optional spam) "Checks if MARK is considered a ham mark in GROUP." @@ -1327,7 +1319,7 @@ In the case of mover backends, checks the setting of (new-articles (spam-list-articles gnus-newsgroup-articles classification)) - (changed-articles (spam-set-difference new-articles old-articles))) + (changed-articles (seq-difference new-articles old-articles #'eq))) ;; now that we have the changed articles, we go through the processors (dolist (backend (spam-backend-list)) (let (unregister-list) |