all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* until-found
@ 2009-12-10 12:50 Andreas Roehler
  2009-12-10 13:58 ` until-found tomas
  0 siblings, 1 reply; 5+ messages in thread
From: Andreas Roehler @ 2009-12-10 12:50 UTC (permalink / raw)
  To: help-gnu-emacs


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/




^ permalink raw reply	[flat|nested] 5+ messages in thread
[parent not found: <mailman.12661.1260449426.2239.help-gnu-emacs@gnu.org>]

end of thread, other threads:[~2009-12-11 17:35 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-10 12:50 until-found Andreas Roehler
2009-12-10 13:58 ` until-found tomas
2009-12-11 10:33   ` until-found Andreas Röhler
     [not found] <mailman.12661.1260449426.2239.help-gnu-emacs@gnu.org>
2009-12-11 16:10 ` until-found Helmut Eller
2009-12-11 17:35   ` until-found Andreas Röhler

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.