[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


From: Andreas Roehler
Subject: until-found
Date: Thu, 10 Dec 2009 13:50:01 +0100
User-agent: Thunderbird (X11/20081227)


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)))

However, would prefer making use of some existing...

Any comments welcome



reply via email to

[Prev in Thread] Current Thread [Next in Thread]