]> git.eshelyaron.com Git - emacs.git/commitdiff
Obsolete gnus-copy-sequence and gnus-last-element
authorEric Abrahamsen <eric@ericabrahamsen.net>
Tue, 9 May 2017 11:17:29 +0000 (19:17 +0800)
committerEric Abrahamsen <eric@ericabrahamsen.net>
Sat, 25 Nov 2017 06:36:35 +0000 (22:36 -0800)
(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.

lisp/gnus/gnus-agent.el
lisp/gnus/gnus-cache.el
lisp/gnus/gnus-cus.el
lisp/gnus/gnus-group.el
lisp/gnus/gnus-range.el
lisp/gnus/gnus-score.el
lisp/gnus/gnus-srvr.el
lisp/gnus/gnus-sum.el
lisp/gnus/gnus.el

index 6e7cc57a4cc7eca7ce036a27b370498de9f15118..466da535605f5f77d3498f33c291aabc1e757c01 100644 (file)
@@ -1108,7 +1108,7 @@ downloadable."
                 gnus-newsgroup-cached)
         (setq articles (gnus-sorted-ndifference
                        (gnus-sorted-ndifference
-                        (gnus-copy-sequence articles)
+                        (copy-tree articles)
                         gnus-newsgroup-downloadable)
                        gnus-newsgroup-cached)))
 
@@ -1123,7 +1123,7 @@ downloadable."
   (when gnus-newsgroup-processable
     (setq gnus-newsgroup-downloadable
           (let* ((dl gnus-newsgroup-downloadable)
-                (processable (sort (gnus-copy-sequence gnus-newsgroup-processable) '<))
+                (processable (sort (copy-tree gnus-newsgroup-processable) '<))
                  (gnus-newsgroup-downloadable processable))
            (gnus-agent-summary-fetch-group)
 
@@ -2833,7 +2833,7 @@ The following commands are available:
   "Copy the current category."
   (interactive (list (gnus-category-name) (intern (read-string "New name: "))))
   (let ((info (assq category gnus-category-alist)))
-    (push (let ((newcat (gnus-copy-sequence info)))
+    (push (let ((newcat (copy-tree info)))
             (setf (gnus-agent-cat-name newcat) to)
             (setf (gnus-agent-cat-groups newcat) nil)
             newcat)
index 12c8903d02977dfeb3527a9c842a7f7faf80f2a8..801728d2f2649b7269997145216dc01ba664f206 100644 (file)
@@ -735,7 +735,7 @@ If LOW, update the lower bound instead."
       ;; `gnus-cache-unified-group-names' needless.
       (gnus-sethash (or (cdr (assoc group gnus-cache-unified-group-names))
                        group)
-                   (cons (car nums) (gnus-last-element nums))
+                   (cons (car nums) (car (last nums)))
                    gnus-cache-active-hashtb))
     ;; Go through all the other files.
     (dolist (file alphs)
index 600b33f2268a78a2cb91cb7982c705c7a6430804..c22c9c1d5ac638f7e5cc1225d41a81c7a35ef0f1 100644 (file)
@@ -406,7 +406,7 @@ category."))
       ;; every duplicate ends up being displayed.  So, rather than
       ;; display them, remove them from the list.
 
-      (let ((tmp (setq values (gnus-copy-sequence values)))
+      (let ((tmp (setq values (copy-tree values)))
            elem)
        (while (cdr tmp)
          (while (setq elem (assq (caar tmp) (cdr tmp)))
index 3b6ff0ab813d3b4c3ebc75fdd5519e456f30ea62..63e59e94e2e0edb721f172b9ea35fff2247d1bd9 100644 (file)
@@ -3000,7 +3000,7 @@ and NEW-NAME will be prompted for."
     ;; Set the info.
     (if (not (and info new-group))
        (gnus-group-set-info form (or new-group group) part)
-      (setq info (gnus-copy-sequence info))
+      (setq info (copy-tree info))
       (setcar info new-group)
       (unless (gnus-server-equal method "native")
        (unless (nthcdr 3 info)
@@ -3023,7 +3023,7 @@ and NEW-NAME will be prompted for."
           ;; Don't use `caddr' here since macros within the `interactive'
           ;; form won't be expanded.
           (car (cddr entry)))))
-  (setq method (gnus-copy-sequence method))
+  (setq method (copy-tree method))
   (let (entry)
     (while (setq entry (memq (assq 'eval method) method))
       (setcar entry (eval (cadar entry)))))
index b30b2e90992a9ddc9354f21241fa42069b011f8a..70548d028047d2b63fbee5a572b48e038dee7587 100644 (file)
@@ -38,17 +38,9 @@ If RANGE is a single range, return (RANGE). Otherwise, return RANGE."
   (while (cdr list)
     (setq list (cdr list)))
   (car list))
+(make-obsolete 'gnus-last-element "use `car' of `last' instead." "27.1")
 
-(defun gnus-copy-sequence (list)
-  "Do a complete, total copy of a list."
-  (let (out)
-    (while (consp list)
-      (if (consp (car list))
-         (push (gnus-copy-sequence (pop list)) out)
-       (push (pop list) out)))
-    (if list
-       (nconc (nreverse out) list)
-      (nreverse out))))
+(define-obsolete-function-alias 'gnus-copy-sequence 'copy-tree "27.1")
 
 (defun gnus-set-difference (list1 list2)
   "Return a list of elements of LIST1 that do not appear in LIST2."
@@ -455,7 +447,7 @@ modified."
   (if (or (null range1) (null range2))
       range1
     (let (out r1 r2 r1_min r1_max r2_min r2_max
-             (range2 (gnus-copy-sequence range2)))
+             (range2 (copy-tree range2)))
       (setq range1 (if (listp (cdr range1)) range1 (list range1))
            range2 (sort (if (listp (cdr range2)) range2 (list range2))
                         (lambda (e1 e2)
index 6c3a8b4cecf67e2f1a9116e735d16e9450c7353f..765dfab570ad962a6f4de7a4da4293e1df7e34bf 100644 (file)
@@ -2318,7 +2318,7 @@ score in `gnus-newsgroup-scored' by SCORE."
     (when (or (not (listp gnus-newsgroup-adaptive))
              (memq 'line gnus-newsgroup-adaptive))
       (save-excursion
-       (let* ((malist (gnus-copy-sequence gnus-adaptive-score-alist))
+       (let* ((malist (copy-tree gnus-adaptive-score-alist))
               (alist malist)
               (date (current-time-string))
               (data gnus-newsgroup-data)
index 23d8b02efde16a476e3f9f9af760974146a98296..a3341470fa2d5d4f3b8a4c46f6bb4c5df9a6deec 100644 (file)
@@ -609,7 +609,7 @@ The following commands are available:
     (error "%s already exists" to))
   (unless (gnus-server-to-method from)
     (error "%s: no such server" from))
-  (let ((to-entry (cons from (gnus-copy-sequence
+  (let ((to-entry (cons from (copy-tree
                              (gnus-server-to-method from)))))
     (setcar to-entry to)
     (setcar (nthcdr 2 to-entry) to)
index f1a3600288ff28d57cd9a7d068812ba7bd27dd39..e599a8460f36634b3dba0164056e05d0fd4792af 100644 (file)
@@ -3992,7 +3992,7 @@ If SELECT-ARTICLES, only select those articles from GROUP."
        (spam-initialize))
       ;; Save the active value in effect when the group was entered.
       (setq gnus-newsgroup-active
-           (gnus-copy-sequence
+           (copy-tree
             (gnus-active gnus-newsgroup-name)))
       (setq gnus-newsgroup-highest (cdr gnus-newsgroup-active))
       ;; 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."
              (mail-header-number (car gnus-newsgroup-headers))
              gnus-newsgroup-end
              (mail-header-number
-              (gnus-last-element gnus-newsgroup-headers))))
+              (car (last gnus-newsgroup-headers)))))
       ;; GROUP is successfully selected.
       (or gnus-newsgroup-headers t)))))
 
@@ -6076,12 +6076,12 @@ If SELECT-ARTICLES, only select those articles from GROUP."
                 (del
                  (gnus-list-range-intersection
                   gnus-newsgroup-articles
-                  (gnus-remove-from-range (gnus-copy-sequence old) list)))
+                  (gnus-remove-from-range (copy-tree old) list)))
                 (add
                  (gnus-list-range-intersection
                   gnus-newsgroup-articles
                   (gnus-remove-from-range
-                   (gnus-copy-sequence list) old))))
+                   (copy-tree list) old))))
            (when add
              (push (list add 'add (list (cdr type))) delta-marks))
            (when del
@@ -12915,7 +12915,7 @@ returned."
            (mail-header-number (car gnus-newsgroup-headers))
            gnus-newsgroup-end
            (mail-header-number
-            (gnus-last-element gnus-newsgroup-headers))))
+            (car (last gnus-newsgroup-headers)))))
     (when gnus-use-scoring
       (gnus-possibly-score-headers))))
 
@@ -13002,7 +13002,7 @@ If ALL is a number, fetch this number of articles."
        i new)
     (unless new-active
       (error "Couldn't fetch new data"))
-    (setq gnus-newsgroup-active (gnus-copy-sequence new-active))
+    (setq gnus-newsgroup-active (copy-tree new-active))
     (setq i (cdr gnus-newsgroup-active)
          gnus-newsgroup-highest i)
     (while (> i old-high)
index 0b6f72870ee8d164f5c0fb093e8d3caf959aecf2..3458fdea7181bace1704c0df93318c5e67c846a5 100644 (file)
@@ -2769,7 +2769,6 @@ gnus-registry.el will populate this if it's loaded.")
       gnus-check-reasonable-setup)
      ("gnus-dup" gnus-dup-suppress-articles gnus-dup-unsuppress-article
       gnus-dup-enter-articles)
-     ("gnus-range" gnus-copy-sequence)
      ("gnus-eform" gnus-edit-form)
      ("gnus-logic" gnus-score-advanced)
      ("gnus-undo" gnus-undo-mode gnus-undo-register)