From: yamaoka Date: Mon, 10 Oct 2005 22:58:14 +0000 (+0000) Subject: (mm-delete-duplicates): New function. X-Git-Tag: t-gnus-6_17_4-quimby-~315 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc3ccfa1aedb3eddadc8476efa2036c4e8489b69;p=elisp%2Fgnus.git- (mm-delete-duplicates): New function. --- diff --git a/ChangeLog b/ChangeLog index 8c839b3..570e631 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2005-10-10 Katsumi Yamaoka + + * lisp/nnheader.el (mm-delete-duplicates): New function. + 2005-10-04 Katsumi Yamaoka * aclocal.m4 (AC_PATH_LISPDIR): Default to .../site-lisp/gnus for diff --git a/lisp/nnheader.el b/lisp/nnheader.el index 8888fc3..193bcbf 100644 --- a/lisp/nnheader.el +++ b/lisp/nnheader.el @@ -336,7 +336,24 @@ nil, ." (cond ((fboundp 'char-or-char-int-p) 'char-or-char-int-p) ((fboundp 'char-valid-p) 'char-valid-p) - (t 'identity)))) + (t 'identity))) + + ;; Should keep track of the same function in mm-util.el. + (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))) ;; mail-parse stuff. (unless (featurep 'mail-parse)