[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
until-found
From: |
Andreas Roehler |
Subject: |
until-found |
Date: |
Thu, 10 Dec 2009 13:50:01 +0100 |
User-agent: |
Thunderbird 2.0.0.19 (X11/20081227) |
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/
- until-found,
Andreas Roehler <=