From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juanma Barranquero Newsgroups: gmane.emacs.devel Subject: Re: assoc-delete-all Date: Mon, 4 Jul 2005 11:00:46 +0200 Message-ID: References: <42C7300C.8050104@student.lu.se> <87zmt3nsx8.fsf@jurta.org> Reply-To: Juanma Barranquero NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: sea.gmane.org 1120470226 28875 80.91.229.2 (4 Jul 2005 09:43:46 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 4 Jul 2005 09:43:46 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jul 04 11:43:38 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DpNUD-0000YP-NP for ged-emacs-devel@m.gmane.org; Mon, 04 Jul 2005 11:43:34 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DpNVP-0002b2-BT for ged-emacs-devel@m.gmane.org; Mon, 04 Jul 2005 05:44:47 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DpN0d-0006YG-Hy for emacs-devel@gnu.org; Mon, 04 Jul 2005 05:12:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DpN0S-0006RG-Tv for emacs-devel@gnu.org; Mon, 04 Jul 2005 05:12:57 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DpMq4-0005N5-FI for emacs-devel@gnu.org; Mon, 04 Jul 2005 05:02:05 -0400 Original-Received: from [64.233.182.192] (helo=nproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DpMua-0000eu-Jr for emacs-devel@gnu.org; Mon, 04 Jul 2005 05:06:44 -0400 Original-Received: by nproxy.gmail.com with SMTP id i2so145185nfe for ; Mon, 04 Jul 2005 02:00:46 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=SFbcMSmUlJrUxncgl1amg34m8pG8LkLBPQ3U1ydLVoR0TsAKZznRk6UoNSwcGF7CtfjDLb3Uf+pnFGODSSn4UUv2KlTAve3VOxzlcFLoXnsUKznrvrxTV6DXvY7ZVxmszLqrG/o8vM9IAPxXE9EpltkMVN9t/7HtgDjftRVJc5g= Original-Received: by 10.48.240.7 with SMTP id n7mr99266nfh; Mon, 04 Jul 2005 02:00:46 -0700 (PDT) Original-Received: by 10.48.250.5 with HTTP; Mon, 4 Jul 2005 02:00:46 -0700 (PDT) Original-To: Juri Linkov In-Reply-To: <87zmt3nsx8.fsf@jurta.org> Content-Disposition: inline X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:40319 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:40319 On 7/4/05, Juri Linkov wrote: > with this function >=20 > (assoc-delete-all "." (assoc-delete-all ".." file-alist1)) >=20 > Even better would be to allow a test function like in assoc-default: >=20 > (assoc-delete-all nil file-alist1 (lambda (key) (string-match "^\.\.?$" k= ey))) 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))) :-) --=20 /L/e/k/t/u