[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: assoc-delete-all
From: |
Juanma Barranquero |
Subject: |
Re: assoc-delete-all |
Date: |
Mon, 4 Jul 2005 11:00:46 +0200 |
On 7/4/05, Juri Linkov <address@hidden> 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