aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Abrahamsen2017-05-09 19:17:29 +0800
committerEric Abrahamsen2017-11-24 22:36:35 -0800
commite27004c5fe3c227476ea210ff5bee2efb783ae17 (patch)
treefe6103d35d6f8c8835d779acf06c6b18c8d2c660
parentd1000fb48bb941c5336051f20fe7d46e60260605 (diff)
downloademacs-e27004c5fe3c227476ea210ff5bee2efb783ae17.tar.gz
emacs-e27004c5fe3c227476ea210ff5bee2efb783ae17.zip
Obsolete gnus-copy-sequence and gnus-last-element
(Bug#28856, Bug#28867) * lisp/gnus/gnus-range.el: Leave gnus-last-element in place, but obsolete it and point to car of last. Remove gnus-copy-sequence and define as an obsolete alias for copy-tree. (gnus-remove-from-range): * lisp/gnus/gnus-cache.el (gnus-cache-generate-active): * lisp/gnus/gnus-sum.el (gnus-summary-insert-articles, gnus-select-newsgroup, gnus-summary-read-group-1, gnus-select-newsgroup, gnus-update-marks, gnus-summary-insert-articles, gnus-summary-insert-new-articles): Replace calls in these locations. * lisp/gnus/gnus-agent.el (gnus-agent-catchup, gnus-agent-summary-fetch-series, gnus-category-copy): * lisp/gnus/gnus-cus.el (gnus-group-customize): * lisp/gnus/gnus-group.el (gnus-group-edit-group-done, gnus-group-make-useful-group): * lisp/gnus/gnus-score.el (gnus-score-adaptive): * lisp/gnus/gnus-srvr.el (gnus-server-copy-server): Replace calls in these locations.
-rw-r--r--lisp/gnus/gnus-agent.el6
-rw-r--r--lisp/gnus/gnus-cache.el2
-rw-r--r--lisp/gnus/gnus-cus.el2
-rw-r--r--lisp/gnus/gnus-group.el4
-rw-r--r--lisp/gnus/gnus-range.el14
-rw-r--r--lisp/gnus/gnus-score.el2
-rw-r--r--lisp/gnus/gnus-srvr.el2
-rw-r--r--lisp/gnus/gnus-sum.el12
-rw-r--r--lisp/gnus/gnus.el1
9 files changed, 18 insertions, 27 deletions
diff --git a/lisp/gnus/gnus-agent.el b/lisp/gnus/gnus-agent.el
index 6e7cc57a4cc..466da535605 100644
--- a/lisp/gnus/gnus-agent.el
+++ b/lisp/gnus/gnus-agent.el
@@ -1108,7 +1108,7 @@ downloadable."
1108 gnus-newsgroup-cached) 1108 gnus-newsgroup-cached)
1109 (setq articles (gnus-sorted-ndifference 1109 (setq articles (gnus-sorted-ndifference
1110 (gnus-sorted-ndifference 1110 (gnus-sorted-ndifference
1111 (gnus-copy-sequence articles) 1111 (copy-tree articles)
1112 gnus-newsgroup-downloadable) 1112 gnus-newsgroup-downloadable)
1113 gnus-newsgroup-cached))) 1113 gnus-newsgroup-cached)))
1114 1114
@@ -1123,7 +1123,7 @@ downloadable."
1123 (when gnus-newsgroup-processable 1123 (when gnus-newsgroup-processable
1124 (setq gnus-newsgroup-downloadable 1124 (setq gnus-newsgroup-downloadable
1125 (let* ((dl gnus-newsgroup-downloadable) 1125 (let* ((dl gnus-newsgroup-downloadable)
1126 (processable (sort (gnus-copy-sequence gnus-newsgroup-processable) '<)) 1126 (processable (sort (copy-tree gnus-newsgroup-processable) '<))
1127 (gnus-newsgroup-downloadable processable)) 1127 (gnus-newsgroup-downloadable processable))
1128 (gnus-agent-summary-fetch-group) 1128 (gnus-agent-summary-fetch-group)
1129 1129
@@ -2833,7 +2833,7 @@ The following commands are available:
2833 "Copy the current category." 2833 "Copy the current category."
2834 (interactive (list (gnus-category-name) (intern (read-string "New name: ")))) 2834 (interactive (list (gnus-category-name) (intern (read-string "New name: "))))
2835 (let ((info (assq category gnus-category-alist))) 2835 (let ((info (assq category gnus-category-alist)))
2836 (push (let ((newcat (gnus-copy-sequence info))) 2836 (push (let ((newcat (copy-tree info)))
2837 (setf (gnus-agent-cat-name newcat) to) 2837 (setf (gnus-agent-cat-name newcat) to)
2838 (setf (gnus-agent-cat-groups newcat) nil) 2838 (setf (gnus-agent-cat-groups newcat) nil)
2839 newcat) 2839 newcat)
diff --git a/lisp/gnus/gnus-cache.el b/lisp/gnus/gnus-cache.el
index 12c8903d029..801728d2f26 100644
--- a/lisp/gnus/gnus-cache.el
+++ b/lisp/gnus/gnus-cache.el
@@ -735,7 +735,7 @@ If LOW, update the lower bound instead."
735 ;; `gnus-cache-unified-group-names' needless. 735 ;; `gnus-cache-unified-group-names' needless.
736 (gnus-sethash (or (cdr (assoc group gnus-cache-unified-group-names)) 736 (gnus-sethash (or (cdr (assoc group gnus-cache-unified-group-names))
737 group) 737 group)
738 (cons (car nums) (gnus-last-element nums)) 738 (cons (car nums) (car (last nums)))
739 gnus-cache-active-hashtb)) 739 gnus-cache-active-hashtb))
740 ;; Go through all the other files. 740 ;; Go through all the other files.
741 (dolist (file alphs) 741 (dolist (file alphs)
diff --git a/lisp/gnus/gnus-cus.el b/lisp/gnus/gnus-cus.el
index 600b33f2268..c22c9c1d5ac 100644
--- a/lisp/gnus/gnus-cus.el
+++ b/lisp/gnus/gnus-cus.el
@@ -406,7 +406,7 @@ category."))
406 ;; every duplicate ends up being displayed. So, rather than 406 ;; every duplicate ends up being displayed. So, rather than
407 ;; display them, remove them from the list. 407 ;; display them, remove them from the list.
408 408
409 (let ((tmp (setq values (gnus-copy-sequence values))) 409 (let ((tmp (setq values (copy-tree values)))
410 elem) 410 elem)
411 (while (cdr tmp) 411 (while (cdr tmp)
412 (while (setq elem (assq (caar tmp) (cdr tmp))) 412 (while (setq elem (assq (caar tmp) (cdr tmp)))
diff --git a/lisp/gnus/gnus-group.el b/lisp/gnus/gnus-group.el
index 3b6ff0ab813..63e59e94e2e 100644
--- a/lisp/gnus/gnus-group.el
+++ b/lisp/gnus/gnus-group.el
@@ -3000,7 +3000,7 @@ and NEW-NAME will be prompted for."
3000 ;; Set the info. 3000 ;; Set the info.
3001 (if (not (and info new-group)) 3001 (if (not (and info new-group))
3002 (gnus-group-set-info form (or new-group group) part) 3002 (gnus-group-set-info form (or new-group group) part)
3003 (setq info (gnus-copy-sequence info)) 3003 (setq info (copy-tree info))
3004 (setcar info new-group) 3004 (setcar info new-group)
3005 (unless (gnus-server-equal method "native") 3005 (unless (gnus-server-equal method "native")
3006 (unless (nthcdr 3 info) 3006 (unless (nthcdr 3 info)
@@ -3023,7 +3023,7 @@ and NEW-NAME will be prompted for."
3023 ;; Don't use `caddr' here since macros within the `interactive' 3023 ;; Don't use `caddr' here since macros within the `interactive'
3024 ;; form won't be expanded. 3024 ;; form won't be expanded.
3025 (car (cddr entry))))) 3025 (car (cddr entry)))))
3026 (setq method (gnus-copy-sequence method)) 3026 (setq method (copy-tree method))
3027 (let (entry) 3027 (let (entry)
3028 (while (setq entry (memq (assq 'eval method) method)) 3028 (while (setq entry (memq (assq 'eval method) method))
3029 (setcar entry (eval (cadar entry))))) 3029 (setcar entry (eval (cadar entry)))))
diff --git a/lisp/gnus/gnus-range.el b/lisp/gnus/gnus-range.el
index b30b2e90992..70548d02804 100644
--- a/lisp/gnus/gnus-range.el
+++ b/lisp/gnus/gnus-range.el
@@ -38,17 +38,9 @@ If RANGE is a single range, return (RANGE). Otherwise, return RANGE."
38 (while (cdr list) 38 (while (cdr list)
39 (setq list (cdr list))) 39 (setq list (cdr list)))
40 (car list)) 40 (car list))
41(make-obsolete 'gnus-last-element "use `car' of `last' instead." "27.1")
41 42
42(defun gnus-copy-sequence (list) 43(define-obsolete-function-alias 'gnus-copy-sequence 'copy-tree "27.1")
43 "Do a complete, total copy of a list."
44 (let (out)
45 (while (consp list)
46 (if (consp (car list))
47 (push (gnus-copy-sequence (pop list)) out)
48 (push (pop list) out)))
49 (if list
50 (nconc (nreverse out) list)
51 (nreverse out))))
52 44
53(defun gnus-set-difference (list1 list2) 45(defun gnus-set-difference (list1 list2)
54 "Return a list of elements of LIST1 that do not appear in LIST2." 46 "Return a list of elements of LIST1 that do not appear in LIST2."
@@ -455,7 +447,7 @@ modified."
455 (if (or (null range1) (null range2)) 447 (if (or (null range1) (null range2))
456 range1 448 range1
457 (let (out r1 r2 r1_min r1_max r2_min r2_max 449 (let (out r1 r2 r1_min r1_max r2_min r2_max
458 (range2 (gnus-copy-sequence range2))) 450 (range2 (copy-tree range2)))
459 (setq range1 (if (listp (cdr range1)) range1 (list range1)) 451 (setq range1 (if (listp (cdr range1)) range1 (list range1))
460 range2 (sort (if (listp (cdr range2)) range2 (list range2)) 452 range2 (sort (if (listp (cdr range2)) range2 (list range2))
461 (lambda (e1 e2) 453 (lambda (e1 e2)
diff --git a/lisp/gnus/gnus-score.el b/lisp/gnus/gnus-score.el
index 6c3a8b4cecf..765dfab570a 100644
--- a/lisp/gnus/gnus-score.el
+++ b/lisp/gnus/gnus-score.el
@@ -2318,7 +2318,7 @@ score in `gnus-newsgroup-scored' by SCORE."
2318 (when (or (not (listp gnus-newsgroup-adaptive)) 2318 (when (or (not (listp gnus-newsgroup-adaptive))
2319 (memq 'line gnus-newsgroup-adaptive)) 2319 (memq 'line gnus-newsgroup-adaptive))
2320 (save-excursion 2320 (save-excursion
2321 (let* ((malist (gnus-copy-sequence gnus-adaptive-score-alist)) 2321 (let* ((malist (copy-tree gnus-adaptive-score-alist))
2322 (alist malist) 2322 (alist malist)
2323 (date (current-time-string)) 2323 (date (current-time-string))
2324 (data gnus-newsgroup-data) 2324 (data gnus-newsgroup-data)
diff --git a/lisp/gnus/gnus-srvr.el b/lisp/gnus/gnus-srvr.el
index 23d8b02efde..a3341470fa2 100644
--- a/lisp/gnus/gnus-srvr.el
+++ b/lisp/gnus/gnus-srvr.el
@@ -609,7 +609,7 @@ The following commands are available:
609 (error "%s already exists" to)) 609 (error "%s already exists" to))
610 (unless (gnus-server-to-method from) 610 (unless (gnus-server-to-method from)
611 (error "%s: no such server" from)) 611 (error "%s: no such server" from))
612 (let ((to-entry (cons from (gnus-copy-sequence 612 (let ((to-entry (cons from (copy-tree
613 (gnus-server-to-method from))))) 613 (gnus-server-to-method from)))))
614 (setcar to-entry to) 614 (setcar to-entry to)
615 (setcar (nthcdr 2 to-entry) to) 615 (setcar (nthcdr 2 to-entry) to)
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el
index f1a3600288f..e599a8460f3 100644
--- a/lisp/gnus/gnus-sum.el
+++ b/lisp/gnus/gnus-sum.el
@@ -3992,7 +3992,7 @@ If SELECT-ARTICLES, only select those articles from GROUP."
3992 (spam-initialize)) 3992 (spam-initialize))
3993 ;; Save the active value in effect when the group was entered. 3993 ;; Save the active value in effect when the group was entered.
3994 (setq gnus-newsgroup-active 3994 (setq gnus-newsgroup-active
3995 (gnus-copy-sequence 3995 (copy-tree
3996 (gnus-active gnus-newsgroup-name))) 3996 (gnus-active gnus-newsgroup-name)))
3997 (setq gnus-newsgroup-highest (cdr gnus-newsgroup-active)) 3997 (setq gnus-newsgroup-highest (cdr gnus-newsgroup-active))
3998 ;; You can change the summary buffer in some way with this hook. 3998 ;; You can change the summary buffer in some way with this hook.
@@ -5737,7 +5737,7 @@ If SELECT-ARTICLES, only select those articles from GROUP."
5737 (mail-header-number (car gnus-newsgroup-headers)) 5737 (mail-header-number (car gnus-newsgroup-headers))
5738 gnus-newsgroup-end 5738 gnus-newsgroup-end
5739 (mail-header-number 5739 (mail-header-number
5740 (gnus-last-element gnus-newsgroup-headers)))) 5740 (car (last gnus-newsgroup-headers)))))
5741 ;; GROUP is successfully selected. 5741 ;; GROUP is successfully selected.
5742 (or gnus-newsgroup-headers t))))) 5742 (or gnus-newsgroup-headers t)))))
5743 5743
@@ -6076,12 +6076,12 @@ If SELECT-ARTICLES, only select those articles from GROUP."
6076 (del 6076 (del
6077 (gnus-list-range-intersection 6077 (gnus-list-range-intersection
6078 gnus-newsgroup-articles 6078 gnus-newsgroup-articles
6079 (gnus-remove-from-range (gnus-copy-sequence old) list))) 6079 (gnus-remove-from-range (copy-tree old) list)))
6080 (add 6080 (add
6081 (gnus-list-range-intersection 6081 (gnus-list-range-intersection
6082 gnus-newsgroup-articles 6082 gnus-newsgroup-articles
6083 (gnus-remove-from-range 6083 (gnus-remove-from-range
6084 (gnus-copy-sequence list) old)))) 6084 (copy-tree list) old))))
6085 (when add 6085 (when add
6086 (push (list add 'add (list (cdr type))) delta-marks)) 6086 (push (list add 'add (list (cdr type))) delta-marks))
6087 (when del 6087 (when del
@@ -12915,7 +12915,7 @@ returned."
12915 (mail-header-number (car gnus-newsgroup-headers)) 12915 (mail-header-number (car gnus-newsgroup-headers))
12916 gnus-newsgroup-end 12916 gnus-newsgroup-end
12917 (mail-header-number 12917 (mail-header-number
12918 (gnus-last-element gnus-newsgroup-headers)))) 12918 (car (last gnus-newsgroup-headers)))))
12919 (when gnus-use-scoring 12919 (when gnus-use-scoring
12920 (gnus-possibly-score-headers)))) 12920 (gnus-possibly-score-headers))))
12921 12921
@@ -13002,7 +13002,7 @@ If ALL is a number, fetch this number of articles."
13002 i new) 13002 i new)
13003 (unless new-active 13003 (unless new-active
13004 (error "Couldn't fetch new data")) 13004 (error "Couldn't fetch new data"))
13005 (setq gnus-newsgroup-active (gnus-copy-sequence new-active)) 13005 (setq gnus-newsgroup-active (copy-tree new-active))
13006 (setq i (cdr gnus-newsgroup-active) 13006 (setq i (cdr gnus-newsgroup-active)
13007 gnus-newsgroup-highest i) 13007 gnus-newsgroup-highest i)
13008 (while (> i old-high) 13008 (while (> i old-high)
diff --git a/lisp/gnus/gnus.el b/lisp/gnus/gnus.el
index 0b6f72870ee..3458fdea718 100644
--- a/lisp/gnus/gnus.el
+++ b/lisp/gnus/gnus.el
@@ -2769,7 +2769,6 @@ gnus-registry.el will populate this if it's loaded.")
2769 gnus-check-reasonable-setup) 2769 gnus-check-reasonable-setup)
2770 ("gnus-dup" gnus-dup-suppress-articles gnus-dup-unsuppress-article 2770 ("gnus-dup" gnus-dup-suppress-articles gnus-dup-unsuppress-article
2771 gnus-dup-enter-articles) 2771 gnus-dup-enter-articles)
2772 ("gnus-range" gnus-copy-sequence)
2773 ("gnus-eform" gnus-edit-form) 2772 ("gnus-eform" gnus-edit-form)
2774 ("gnus-logic" gnus-score-advanced) 2773 ("gnus-logic" gnus-score-advanced)
2775 ("gnus-undo" gnus-undo-mode gnus-undo-register) 2774 ("gnus-undo" gnus-undo-mode gnus-undo-register)