From: Simon Josefsson <jas@extundo.com>
Subject: Re: message-remove-duplicates and gnus-remove-duplicates
Date: Mon, 03 Oct 2005 10:38:29 +0200 [thread overview]
Message-ID: <iluhdbz806y.fsf@latte.josefsson.org> (raw)
In-Reply-To: <v9zmprk6qh.fsf@marauder.physik.uni-ulm.de> (Reiner Steib's message of "Sun, 02 Oct 2005 22:24:06 +0200")
Reiner Steib <reinersteib+gmane@imap.cc> writes:
> On Thu, Sep 29 2005, Simon Josefsson wrote:
>
>> Reiner Steib <reinersteib+gmane@imap.cc> 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
next prev parent reply other threads:[~2005-10-03 8:38 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1EKH9h-0000UQ-00@quimby.gnus.org>
2005-09-28 14:25 ` message-remove-duplicates and gnus-remove-duplicates (was: Changes committed gnus/lisp (ChangeLog gnus-art.el message.el)) Reiner Steib
2005-09-29 13:39 ` message-remove-duplicates and gnus-remove-duplicates Simon Josefsson
2005-10-02 20:24 ` Reiner Steib
2005-10-03 8:38 ` Simon Josefsson [this message]
2005-10-03 10:51 ` Reiner Steib
2005-10-03 13:58 ` Simon Josefsson
2005-10-03 17:55 ` Reiner Steib
2005-10-04 10:01 ` Simon Josefsson
2005-10-04 15:50 ` Reiner Steib
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=iluhdbz806y.fsf@latte.josefsson.org \
--to=jas@extundo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).