From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/59375 Path: main.gmane.org!not-for-mail From: sigurd@12move.de (Karl =?iso-8859-1?Q?Pfl=E4sterer?=) Newsgroups: gmane.emacs.gnus.general Subject: Re: gnus-summary-limit-to-recipient and Date: Sat, 04 Dec 2004 22:30:27 +0100 Organization: Lemis World Message-ID: References: Reply-To: khp@pflaesterer.de (Karl =?iso-8859-1?Q?Pfl=E4sterer?=) NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1102434935 8855 80.91.229.6 (7 Dec 2004 15:55:35 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 7 Dec 2004 15:55:35 +0000 (UTC) Original-X-From: ding-owner+M7914@lists.math.uh.edu Tue Dec 07 16:55:28 2004 Return-path: Original-Received: from malifon.math.uh.edu ([129.7.128.13] ident=mail) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1CbhRy-0007s2-00 for ; Tue, 07 Dec 2004 16:40:26 +0100 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 1CbhN5-0003O2-00; Tue, 07 Dec 2004 09:35:23 -0600 Original-Received: from util2.math.uh.edu ([129.7.128.23]) by malifon.math.uh.edu with esmtp (Exim 3.20 #1) id 1CahW3-0002xx-00 for ding@lists.math.uh.edu; Sat, 04 Dec 2004 15:32:31 -0600 Original-Received: from justine.libertine.org ([66.139.78.221] ident=postfix) by util2.math.uh.edu with esmtp (Exim 4.30) id 1CahVy-0005O0-FK for ding@lists.math.uh.edu; Sat, 04 Dec 2004 15:32:26 -0600 Original-Received: from quimby.gnus.org (quimby.gnus.org [80.91.224.244]) by justine.libertine.org (Postfix) with ESMTP id 5889C3A0066 for ; Sat, 4 Dec 2004 15:32:25 -0600 (CST) Original-Received: from news by quimby.gnus.org with local (Exim 3.35 #1 (Debian)) id 1CahVw-0006iS-00 for ; Sat, 04 Dec 2004 22:32:24 +0100 Original-To: ding@gnus.org Original-Path: wintendo.pflaesterer.de!not-for-mail Original-Newsgroups: gnus.ding Original-Lines: 38 Original-NNTP-Posting-Host: b85c6.b.pppool.de Original-X-Trace: quimby.gnus.org 1102195944 25819 213.7.133.198 (4 Dec 2004 21:32:24 GMT) Original-X-Complaints-To: usenet@quimby.gnus.org Original-NNTP-Posting-Date: Sat, 4 Dec 2004 21:32:24 +0000 (UTC) Mail-Copies-To: never User-Agent: Gnus/5.110003 (No Gnus v0.3) Hamster/2.0.6.0 Cancel-Lock: sha1:t4Hem2bSvsSH37FTMRjqCYIxzNI= Precedence: bulk Original-Sender: ding-owner@lists.math.uh.edu Xref: main.gmane.org gmane.emacs.gnus.general:59375 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:59375 On 3 Dez 2004, reinersteib+gmane@imap.cc wrote: > An elisp question related to this: Give two lists of number, `to' and > `cc'. What is the best way to get a list of all numbers that are > present in both lists? > > Example: > > to -> (173 175 177 178 180 181 182 183 184) > cc -> (173 174 175 176 177 178 179 180 181 182 183 184) > > goal: (173 175 177 178 180 181 182 183 184) > > I have done it as follows (the "not-matching"-part), but maybe I was > missing a more simple solution: > > (let* ((to ...) ; list of numbers > (cc ...) ; list of numbers > (articles > (if not-matching > ;; We need the numbers that are in both lists: > (mapcar (lambda (a) > (and (memq a to) a)) > cc) > (nconc to cc)))) > ...) You could simply write: (intersection list1 list2) or (nintersection list1 list2) If the order matters you perhaps have to write: (nreverse (nintersection list1 list2)) This is code from the CL lib so a `(require 'cl)' is needed. KP