From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/61066 Path: news.gmane.org!not-for-mail From: Reiner Steib Newsgroups: gmane.emacs.gnus.general Subject: Re: message-remove-duplicates and gnus-remove-duplicates Date: Sun, 02 Oct 2005 22:24:06 +0200 Organization: Dept. of Theoretical Physics, University of Ulm Message-ID: References: Reply-To: Reiner Steib NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1128285185 28741 80.91.229.2 (2 Oct 2005 20:33:05 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 2 Oct 2005 20:33:05 +0000 (UTC) Original-X-From: ding-owner+m9598@lists.math.uh.edu Sun Oct 02 22:33:01 2005 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EMAUl-0005Ta-No for ding-account@gmane.org; Sun, 02 Oct 2005 22:31:40 +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 1EMAUZ-00005U-00; Sun, 02 Oct 2005 15:31:27 -0500 Original-Received: from nas01.math.uh.edu ([129.7.128.39]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1EMAQc-00005L-00 for ding@lists.math.uh.edu; Sun, 02 Oct 2005 15:27:22 -0500 Original-Received: from quimby.gnus.org ([80.91.224.244]) by nas01.math.uh.edu with esmtp (Exim 4.52) id 1EMAQV-0005W9-9P for ding@lists.math.uh.edu; Sun, 02 Oct 2005 15:27:21 -0500 Original-Received: from main.gmane.org ([80.91.229.2] helo=ciao.gmane.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1EMAQT-0004Jj-00 for ; Sun, 02 Oct 2005 22:27:13 +0200 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1EMAPK-0004Vb-0T for ding@gnus.org; Sun, 02 Oct 2005 22:26:02 +0200 Original-Received: from bridgekeeper.physik.uni-ulm.de ([134.60.10.123]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 02 Oct 2005 22:26:02 +0200 Original-Received: from Reiner.Steib by bridgekeeper.physik.uni-ulm.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 02 Oct 2005 22:26:02 +0200 X-Injected-Via-Gmane: http://gmane.org/ Mail-Followup-To: ding@gnus.org Original-To: ding@gnus.org Original-Lines: 52 Original-X-Complaints-To: usenet@sea.gmane.org X-Gmane-NNTP-Posting-Host: bridgekeeper.physik.uni-ulm.de X-Face: /U7=m^"/-Dn61mAl{g9e3>\G5Tp,oEX|V)g2I1hBk\ML;)7A?6cmB-y7y?'NA^J<=oz7syB =(McAwIHgLX!.B?R3X}98d@?>CrT094KLWh]WU4gDpnL/")MS(XoQTv`Oq225uL>+;CpPXo$N5e>N> $tPd-gbB^F{gQS#1ase]XO~D4p4M"3+F-7~u]dy3I?Pb8RO*H-EFeWDUf?Rf,d]pv\Jvh2Cht!A=im yKAS2Z%Ao^;}W/qzMvMm Mail-Copies-To: nobody User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) Cancel-Lock: sha1:fxZA8bIhimt078dokt22WZW7cWE= X-Spam-Score: -2.4 (--) Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: news.gmane.org gmane.emacs.gnus.general:61066 Archived-At: 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. > 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--- Bye, Reiner. -- ,,, (o o) ---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/