* gnus-util.el (gnus-remove-duplicates): Remove.
authorReiner Steib <Reiner.Steib@gmx.de>
Tue, 4 Oct 2005 15:27:45 +0000 (15:27 +0000)
committerReiner Steib <Reiner.Steib@gmx.de>
Tue, 4 Oct 2005 15:27:45 +0000 (15:27 +0000)
* nnmail.el (nnmail-article-group): Use mm-delete-duplicates
instead of gnus-remove-duplicates.

* message.el (message-remove-duplicates): Remove.
(message-idna-to-ascii-rhs-1): Use mm-delete-duplicates instead of
message-remove-duplicates.

* mm-util.el (mm-delete-duplicates): Use `delete-dups' if
available, else use implementation from `delete-dups'.

lisp/ChangeLog
lisp/gnus-util.el
lisp/message.el
lisp/mm-util.el
lisp/nnmail.el

index 51e581b..da49826 100644 (file)
@@ -1,5 +1,17 @@
 2005-10-04  Reiner Steib  <Reiner.Steib@gmx.de>
 
+       * gnus-util.el (gnus-remove-duplicates): Remove.
+
+       * nnmail.el (nnmail-article-group): Use mm-delete-duplicates
+       instead of gnus-remove-duplicates.
+
+       * message.el (message-remove-duplicates): Remove.
+       (message-idna-to-ascii-rhs-1): Use mm-delete-duplicates instead of
+       message-remove-duplicates.
+
+       * mm-util.el (mm-delete-duplicates): Use `delete-dups' if
+       available, else use implementation from `delete-dups'.
+
        * message.el (message-insert-expires): New function.
        (message-mode-map): Add key binding.
        (message-mode-field-menu): Add menu entry.
index c8df319..b7257f0 100644 (file)
@@ -1030,14 +1030,6 @@ This function saves the current buffer."
         (set-buffer gnus-group-buffer)
         (eq major-mode 'gnus-group-mode))))
 
-(defun gnus-remove-duplicates (list)
-  (let (new)
-    (while list
-      (or (member (car list) new)
-         (setq new (cons (car list) new)))
-      (setq list (cdr list)))
-    (nreverse new)))
-
 (defun gnus-remove-if (predicate list)
   "Return a copy of LIST with all items satisfying PREDICATE removed."
   (let (out)
index 756cc44..f41c595 100644 (file)
@@ -2087,14 +2087,6 @@ With prefix-argument just set Follow-Up, don't cross-post."
 
 ;;; End of functions adopted from `message-utils.el'.
 
-(defun message-remove-duplicates (list)
-  (let (new)
-    (while list
-      (or (member (car list) new)
-         (setq new (cons (car list) new)))
-      (setq list (cdr list)))
-    (nreverse new)))
-
 (defun message-remove-header (header &optional is-regexp first reverse)
   "Remove HEADER in the narrowed buffer.
 If IS-REGEXP, HEADER is a regular expression.
@@ -5054,7 +5046,7 @@ subscribed address (and not the additional To and Cc header contents)."
        rhs ace  address)
     (when field
       (dolist (rhs
-              (message-remove-duplicates
+              (mm-delete-duplicates
                (mapcar (lambda (rhs) (or (cadr (split-string rhs "@")) ""))
                        (mapcar 'downcase
                                (mapcar
index 960f3dd..fc1edc7 100644 (file)
@@ -549,14 +549,21 @@ If the charset is `composition', return the actual one."
     ;; This is for XEmacs.
     (mm-mule-charset-to-mime-charset charset)))
 
-(defun mm-delete-duplicates (list)
-  "Simple substitute for CL `delete-duplicates', testing with `equal'."
-  (let (result head)
-    (while list
-      (setq head (car list))
-      (setq list (delete head list))
-      (setq result (cons head result)))
-    (nreverse result)))
+(if (fboundp 'delete-dups)
+    (defalias 'mm-delete-duplicates 'delete-dups)
+  (defun mm-delete-duplicates (list)
+    "Destructively remove `equal' duplicates from LIST.
+Store the result in LIST and return it.  LIST must be a proper list.
+Of several `equal' occurrences of an element in LIST, the first
+one is kept.
+
+This is a compatibility function for Emacsen without `delete-dups'."
+    ;; Code from `subr.el' in Emacs 22:
+    (let ((tail list))
+      (while tail
+       (setcdr tail (delete (car tail) (cdr tail)))
+       (setq tail (cdr tail))))
+    list))
 
 ;; Fixme:  This is used in places when it should be testing the
 ;; default multibyteness.  See mm-default-multibyte-p.
index d5f5b57..4211978 100644 (file)
@@ -1141,7 +1141,7 @@ FUNC will be called with the group name to determine the article number."
                       5 "Error in `nnmail-split-methods'; using `bogus' mail group")
                      (sit-for 1)
                      '("bogus")))))
-             (setq split (gnus-remove-duplicates split))
+             (setq split (mm-delete-duplicates split))
              ;; The article may be "cross-posted" to `junk'.  What
              ;; to do?  Just remove the `junk' spec.  Don't really
              ;; see anything else to do...