From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Deniz Dogan Newsgroups: gmane.emacs.devel Subject: Re: Add a filter function to emacs Date: Thu, 8 Jul 2010 11:12:35 +0200 Message-ID: References: <20100707194545.GA14668@rolando-desktop> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1278580402 14872 80.91.229.12 (8 Jul 2010 09:13:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 8 Jul 2010 09:13:22 +0000 (UTC) Cc: emacs-devel@gnu.org To: Rolando Pereira Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 08 11:13:19 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OWnAU-0000cC-FT for ged-emacs-devel@m.gmane.org; Thu, 08 Jul 2010 11:13:18 +0200 Original-Received: from localhost ([127.0.0.1]:45566 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWnAT-0001BC-SG for ged-emacs-devel@m.gmane.org; Thu, 08 Jul 2010 05:13:17 -0400 Original-Received: from [140.186.70.92] (port=36952 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OWnAL-0001B5-94 for emacs-devel@gnu.org; Thu, 08 Jul 2010 05:13:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OWnAJ-00078w-Cq for emacs-devel@gnu.org; Thu, 08 Jul 2010 05:13:09 -0400 Original-Received: from mail-wy0-f169.google.com ([74.125.82.169]:45833) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OWnAJ-00078X-8r for emacs-devel@gnu.org; Thu, 08 Jul 2010 05:13:07 -0400 Original-Received: by wyj26 with SMTP id 26so425297wyj.0 for ; Thu, 08 Jul 2010 02:13:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=DOqdPDeSfMCoTZLMh6hp42aGHKF+rRvcGkNiFbMJVlU=; b=jR2XjDCEuxH/ZotcRBU/x93b3NAANC3msSBHpMAfNx1Yd+3lPvbzixHt2Q6ZQljRQp A4rPnW0MrsKjl+2QwTLOk5wsxKDokGaWqvSAkJANWQ1EnNzbPSpKGbT29M9OjawpqeZh rox2c7LttTzysBoXyR+dR0P9PkVBMG7oOPAVA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=M84kaWUsh67Z3znxsFXEnLIWin81gJap1TLYfTiepPk63NQKOjAKU88PsNyR6Z2pcF 1+e+NpOocZYHzytbJsmeeAXvl4v/HJUiMW5AYD+nrm9fMfwW3cggP2Ll6WL8AE9+2Ua5 UnGm+4ipPssuMr1w0hgETSQl6K6HppQrovzZ4= Original-Received: by 10.227.151.138 with SMTP id c10mr6337928wbw.46.1278580385369; Thu, 08 Jul 2010 02:13:05 -0700 (PDT) Original-Received: by 10.216.184.196 with HTTP; Thu, 8 Jul 2010 02:12:35 -0700 (PDT) In-Reply-To: <20100707194545.GA14668@rolando-desktop> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) 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:126902 Archived-At: 2010/7/7 Rolando Pereira : > Hello, > > I would like to know if there is a reason for the lack of a filter > function on the emacs code base. > > According to the Elisp Cookbook on the Emacs Wiki, it seems that it > would be simple to implement: > > =A0(defun my-filter (condp lst) > =A0 =A0(delq nil > =A0 =A0 =A0 =A0 =A0(mapcar (lambda (x) (and (funcall condp x) x)) lst))) > ;; From http://www.emacswiki.org/emacs/ElispCookbook > > Shouldn't this function be in the regular emacs code base (maybe in the > lisp/simple.el file)? > > Is there any problem with it? > > I brought this up some time ago as I found that many higher-order functions were missing in (non-cl.el) Emacs. If I remember correctly, it's the lack of lexical scoping that makes it difficult. --=20 Deniz Dogan