Gnus development mailing list
 help / color / mirror / Atom feed
From: Ted Zlatanov <tzz@lifelogs.com>
To: ding@gnus.org
Subject: Re: delete-dups
Date: Fri, 01 Oct 2010 08:40:40 -0500	[thread overview]
Message-ID: <87ocbeyqsn.fsf@lifelogs.com> (raw)
In-Reply-To: <b4md3rue6lu.fsf_-_@jpl.org>

On Fri, 01 Oct 2010 16:04:45 +0900 Katsumi Yamaoka <yamaoka@jpl.org> wrote: 

KY> Ted Zlatanov wrote:
>> via  6ace9d5942b93402b9468402592c545dbb92b007 (commit)
>> via  404c492543314455e4f96c80bb0372e1741f0906 (commit)
>> from  ca9880f98c58290a72dc5ad8efbe966bdea725a1 (commit)
KY> [...]
>> +;;;###autoload
>> +(defun gnus-registry-install-nnregistry ()
>> +  "Install the nnregistry refer method in `gnus-refer-article-method'."
>> +  (interactive)
>> +  (when (featurep 'nnregistry)
>> +    (setq gnus-refer-article-method
>> +          (delete-dups
KY> [...]

KY> Could you provide `gnus-delete-dups' or something for XEmacs 21.4?
KY> XEmacs 21.5 and SXEmacs 22.1 (and Emacs >=22 of course) provide
KY> `delete-dups' in subr.el, however XEmacs 21.4 doesn't.

Old version:

;;;###autoload
(defun gnus-registry-install-nnregistry ()
  "Install the nnregistry refer method in `gnus-refer-article-method'."
  (interactive)
  (when (featurep 'nnregistry)
    (setq gnus-refer-article-method
          (delete-dups
           (append
            (if (listp gnus-refer-article-method)
                gnus-refer-article-method
              (list gnus-refer-article-method))
            (list 'nnregistry))))))


How about this rewrite, will that work in XEmacs?  It seems like those
two helper functions should be in ELisp but I don't know where they are
hiding.

;;;###autoload
(defun gnus-registry-install-nnregistry ()
  "Install the nnregistry refer method in `gnus-refer-article-method'."
  (interactive)
  (when (featurep 'nnregistry)
    (setq gnus-refer-article-method
          (gnus-set-append-to-set-or-element
           gnus-refer-article-method
           'nnregistry))))

(defun gnus-make-list (element)
  "Return ELEMENT if it's a list or makes a list of it."
  (if (listp element) element (list element)))

(defun gnus-set-append-to-set-or-element (set-or-element tail)
  "Append TAIL to SET-OR-ELEMENT, which can be a set or a single atom."
  (let ((set (gnus-make-list set-or-element)))
    (if (member tail set)
        set
      (append set (list tail)))))




  reply	other threads:[~2010-10-01 13:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <E1P1RNX-00065o-00@quimby.gnus.org>
2010-10-01  7:04 ` delete-dups Katsumi Yamaoka
2010-10-01 13:40   ` Ted Zlatanov [this message]
2010-10-04  5:14     ` delete-dups Katsumi Yamaoka
2010-10-04 16:44       ` delete-dups Lars Magne Ingebrigtsen
2010-10-05  4:07         ` delete-dups Katsumi Yamaoka

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=87ocbeyqsn.fsf@lifelogs.com \
    --to=tzz@lifelogs.com \
    --cc=ding@gnus.org \
    /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).