From: Andreas Roehler <andreas.roehler@online.de>
To: help-gnu-emacs@gnu.org
Subject: until-found
Date: Thu, 10 Dec 2009 13:50:01 +0100 [thread overview]
Message-ID: <4B20EE79.607@online.de> (raw)
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/
next reply other threads:[~2009-12-10 12:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-10 12:50 Andreas Roehler [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4B20EE79.607@online.de \
--to=andreas.roehler@online.de \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).