From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/61071 Path: news.gmane.org!not-for-mail From: Simon Josefsson Newsgroups: gmane.emacs.gnus.general Subject: Re: message-remove-duplicates and gnus-remove-duplicates Date: Mon, 03 Oct 2005 10:38:29 +0200 Message-ID: References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1128328916 18717 80.91.229.2 (3 Oct 2005 08:41:56 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 3 Oct 2005 08:41:56 +0000 (UTC) Original-X-From: ding-owner+m9603@lists.math.uh.edu Mon Oct 03 10:41:47 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EMLsx-0004A9-Sz for ding-account@gmane.org; Mon, 03 Oct 2005 10:41:24 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu ident=lists) by malifon.math.uh.edu with smtp (Exim 3.20 #1) id 1EMLsn-000139-00; Mon, 03 Oct 2005 03:41:13 -0500 Original-Received: from nas02.math.uh.edu ([129.7.128.40]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1EMLqN-000133-00 for ding@lists.math.uh.edu; Mon, 03 Oct 2005 03:38:43 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas02.math.uh.edu with esmtp (Exim 4.52) id 1EMLqJ-0001g1-Us for ding@lists.math.uh.edu; Mon, 03 Oct 2005 03:38:43 -0500 Original-Received: from 178.230.13.217.in-addr.dgcsystems.net ([217.13.230.178] helo=yxa.extundo.com) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1EMLqI-0004Lm-00 for ; Mon, 03 Oct 2005 10:38:38 +0200 Original-Received: from latte.josefsson.org (c494102a.s-bi.bostream.se [217.215.27.65]) (authenticated bits=0) by yxa.extundo.com (8.13.4/8.13.4/Debian-3) with ESMTP id j938cVJd011276 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 3 Oct 2005 10:38:32 +0200 Original-To: ding@gnus.org OpenPGP: id=B565716F; url=http://josefsson.org/key.txt X-Hashcash: 1:21:051003:ding@gnus.org::MVIiDkS3+7QUhtHo:RKX In-Reply-To: (Reiner Steib's message of "Sun, 02 Oct 2005 22:24:06 +0200") User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=failed version=3.0.3 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yxa-iv X-Virus-Scanned: ClamAV version 0.84, clamav-milter version 0.84e on yxa.extundo.com X-Virus-Status: Clean X-Spam-Score: -2.5 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:61071 Archived-At: Reiner Steib writes: > On Thu, Sep 29 2005, Simon Josefsson wrote: > >> Reiner Steib writes: >>> Shouldn't we drop (or defalias) `gnus-remove-duplicates' in favor of >>> `message-remove-duplicates'? (We can safely require `message.el' in >>> Gnus code but not the other way round.) > [...] >> There is also mm-delete-duplicates, I'm not sure how it relates. > > Unless someone can see a reason that we actually need the different > implementations, I'd suggest to replace the defun in `mm-util.el' with > this code: > > --8<---------------cut here---------------start------------->8--- > (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)) > --8<---------------cut here---------------end--------------->8--- > > As `message.el' and `nnmail.el' already require `mm-util.el' we can > use `mm-delete-duplicates' there. Yes, this sounds good. >> Let's defalias it, in case external packages use g-r-d. > > I doubt that there's any external use. At least no package in XEmacs > Sumo uses it. And in Gnus, it's only used once. But I won't mind > something like this in `gnus-util.el': > > --8<---------------cut here---------------start------------->8--- > ;; In case external packages use `gnus-remove-duplicates', we provide an > ;; alias. In new code, `mm-delete-duplicates' or `delete-dups' should be > ;; used. > (defalias 'gnus-remove-duplicates 'mm-delete-duplicates) > --8<---------------cut here---------------end--------------->8--- Yes, I think that is good. Perhaps instead use: (define-obsolete-function-alias 'gnus-remove-duplicates 'mm-delete-duplicates) Thanks, Simon