unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: assoc-delete-all
Date: Mon, 4 Jul 2005 11:00:46 +0200	[thread overview]
Message-ID: <f7ccd24b05070402006d30c1cc@mail.gmail.com> (raw)
In-Reply-To: <87zmt3nsx8.fsf@jurta.org>

On 7/4/05, Juri Linkov <juri@jurta.org> wrote:

> with this function
> 
> (assoc-delete-all "." (assoc-delete-all ".." file-alist1))
> 
> Even better would be to allow a test function like in assoc-default:
> 
> (assoc-delete-all nil file-alist1 (lambda (key) (string-match "^\.\.?$" key)))

That's one of these things that would be much easier if we could use CL:

 ; Not a particularly good implementation, but...
 (defun assoc-delete-all (key alist &rest keywords)
  (or keywords (setq keywords (list ':test 'eq )))
  (apply #'remove* key alist :key #'car keywords))

and you could do

 (assoc-delete-all "^\.\.?$" file-alist1
                   :test #'(lambda (test item)
                             (string-match test item)))

<sigh> :-)

-- 
                    /L/e/k/t/u

  reply	other threads:[~2005-07-04  9:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-03  0:23 assoc-delete-all Lennart Borgman
2005-07-03  0:52 ` assoc-delete-all Juanma Barranquero
2005-07-03  7:30   ` assoc-delete-all Lennart Borgman
2005-07-03 10:24 ` assoc-delete-all Lute Kamstra
2005-07-03 10:51   ` assoc-delete-all Lennart Borgman
2005-07-03 10:58   ` assoc-delete-all Lennart Borgman
2005-07-03 20:43 ` assoc-delete-all Richard M. Stallman
2005-07-04  0:16   ` assoc-delete-all Juri Linkov
2005-07-04  9:00     ` Juanma Barranquero [this message]
2005-07-05  5:33       ` assoc-delete-all Juri Linkov
2005-07-05  4:35     ` assoc-delete-all Richard M. Stallman
2005-07-05  5:27       ` assoc-delete-all Juri Linkov

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=f7ccd24b05070402006d30c1cc@mail.gmail.com \
    --to=lekktu@gmail.com \
    --cc=emacs-devel@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.
Code repositories for project(s) associated with this public inbox

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

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