From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Roehler Newsgroups: gmane.emacs.help Subject: until-found Date: Thu, 10 Dec 2009 13:50:01 +0100 Message-ID: <4B20EE79.607@online.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1260451607 21983 80.91.229.12 (10 Dec 2009 13:26:47 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 10 Dec 2009 13:26:47 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 10 14:26:40 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1NIj2V-0001IB-L1 for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Dec 2009 14:26:39 +0100 Original-Received: from localhost ([127.0.0.1]:37704 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIj2V-0003Ku-BU for geh-help-gnu-emacs@m.gmane.org; Thu, 10 Dec 2009 08:26:39 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NIiTQ-0001FL-Ry for help-gnu-emacs@gnu.org; Thu, 10 Dec 2009 07:50:24 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NIiTL-0001Ac-Ng for help-gnu-emacs@gnu.org; Thu, 10 Dec 2009 07:50:23 -0500 Original-Received: from [199.232.76.173] (port=52533 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NIiTL-0001AE-FB for help-gnu-emacs@gnu.org; Thu, 10 Dec 2009 07:50:19 -0500 Original-Received: from moutng.kundenserver.de ([212.227.126.171]:49631) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1NIiTL-0005J1-2o for help-gnu-emacs@gnu.org; Thu, 10 Dec 2009 07:50:19 -0500 Original-Received: from [192.168.178.27] (p54BE8034.dip0.t-ipconnect.de [84.190.128.52]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0LfWo9-1NppJR34Jd-00p2xD; Thu, 10 Dec 2009 13:50:09 +0100 User-Agent: Thunderbird 2.0.0.19 (X11/20081227) X-Provags-ID: V01U2FsdGVkX19MPnlpDEs8EIShu4wSPqkHb2oV9glbL/aiE2n 4gUf19EOK+fTt22EEf2sqerO8DWTeO7++cNqGBP2nc8h+XvgVb emMjoVh+yXEtceDiSw4vwEqacW/hg1JBoSZlMo9W00= X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:70552 Archived-At: Hi, given a list or a list of lists: list shall be returned, if it contains a certain member. I'm pretty sure a general form exists, but ignore it. Function `dired-compress-file' in dired-aux.el does it that way: (let (... (suffixes dired-compress-file-suffixes)) ;; See if any suffix rule matches this file name. (while suffixes (let (case-fold-search) (if (string-match (car (car suffixes)) file) (setq suffix (car suffixes) suffixes nil)) (setq suffixes (cdr suffixes)))) And here my implementation so far: (defun until-found (search-string liste) (let ((liste liste) element) (while liste (if (member search-string (car liste)) (setq element (car liste) liste nil)) (setq liste (cdr liste))) element)) However, would prefer making use of some existing... Any comments welcome Andreas -- https://code.launchpad.net/s-x-emacs-werkstatt/ http://bazaar.launchpad.net/~a-roehler/python-mode/python-mode.el/