From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tom Newsgroups: gmane.emacs.devel Subject: Re: Occur stack Date: Sun, 19 Jan 2014 06:40:58 +0000 (UTC) Message-ID: References: <52D6D907.4030702@online.de> <52D8E8CB.5080600@online.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1390113694 1502 80.91.229.3 (19 Jan 2014 06:41:34 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 19 Jan 2014 06:41:34 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jan 19 07:41:42 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1W4m4i-0008QG-TN for ged-emacs-devel@m.gmane.org; Sun, 19 Jan 2014 07:41:41 +0100 Original-Received: from localhost ([::1]:45311 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4m4i-0000QR-FD for ged-emacs-devel@m.gmane.org; Sun, 19 Jan 2014 01:41:40 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:52254) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4m4Z-0000Q8-DB for emacs-devel@gnu.org; Sun, 19 Jan 2014 01:41:37 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W4m4T-0003A9-IU for emacs-devel@gnu.org; Sun, 19 Jan 2014 01:41:31 -0500 Original-Received: from plane.gmane.org ([80.91.229.3]:38896) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4m4T-0003A4-C1 for emacs-devel@gnu.org; Sun, 19 Jan 2014 01:41:25 -0500 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1W4m4Q-0008GD-Im for emacs-devel@gnu.org; Sun, 19 Jan 2014 07:41:22 +0100 Original-Received: from 195-38-125-102.pool.digikabel.hu ([195.38.125.102]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 19 Jan 2014 07:41:22 +0100 Original-Received: from adatgyujto by 195-38-125-102.pool.digikabel.hu with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 19 Jan 2014 07:41:22 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 30 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: sea.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 195.38.125.102 (Opera/9.80 (Windows NT 6.1) Presto/2.12.388 Version/12.16) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:168721 Archived-At: Stefan Monnier iro.umontreal.ca> writes: > > > (eval `(let ((dir default-directory) > > (args command-args)) > > (lambda () > > (let ((default-directory dir)) > > (grep-find args)))) > > t)))) > > Yuck! > This is the first time I used closures, so it may be crude. Is there a simpler way to write this? First I tried to set default-directory in the outer let, but then it had apparently no effect on grep-find. Hmm, I tried it again and it worked, so I must have had some other error when I wrote this. Is this the simplest way then? Or can it be simplified more? (eval `(let ((default-directory default-directory) (args command-args)) (lambda () (grep-find args))) t))))