From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Kastrup Newsgroups: gmane.emacs.devel Subject: Re: Additon to tumme.el Date: Sun, 16 Jul 2006 14:35:56 +0200 Message-ID: <85sll14thv.fsf@lola.goethe.zz> References: <7dbe73ed0607160221o38238f6dl10dd953a12112e0c@mail.gmail.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1153053419 7864 80.91.229.2 (16 Jul 2006 12:36:59 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 16 Jul 2006 12:36:59 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Jul 16 14:36:57 2006 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1G25rg-0004gQ-LJ for ged-emacs-devel@m.gmane.org; Sun, 16 Jul 2006 14:36:52 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G25rg-0008PY-4B for ged-emacs-devel@m.gmane.org; Sun, 16 Jul 2006 08:36:52 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1G25rP-0008MQ-IS for emacs-devel@gnu.org; Sun, 16 Jul 2006 08:36:35 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1G25rO-0008LY-S4 for emacs-devel@gnu.org; Sun, 16 Jul 2006 08:36:35 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1G25rO-0008LK-OS for emacs-devel@gnu.org; Sun, 16 Jul 2006 08:36:34 -0400 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.52) id 1G25tp-0006Zc-Vk for emacs-devel@gnu.org; Sun, 16 Jul 2006 08:39:06 -0400 Original-Received: from localhost ([127.0.0.1] helo=lola.goethe.zz) by fencepost.gnu.org with esmtp (Exim 4.34) id 1G25rO-0001qX-4P; Sun, 16 Jul 2006 08:36:34 -0400 Original-Received: by lola.goethe.zz (Postfix, from userid 1002) id 7F29F1C3660E; Sun, 16 Jul 2006 14:35:56 +0200 (CEST) Original-To: "Mathias Dahl" In-Reply-To: <7dbe73ed0607160221o38238f6dl10dd953a12112e0c@mail.gmail.com> (Mathias Dahl's message of "Sun, 16 Jul 2006 11:21:44 +0200") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) 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:57091 Archived-At: "Mathias Dahl" writes: Just a code remark: > (mapc > (lambda (file) > (let* ((thumb-file (tumme-thumb-name file)) > (img (create-image thumb-file)) > comment-widget tag-widget) > (insert-image img) [Kilometers of code...] > files)) I'd rather use (let (thumb-file img comment-widget tag-widget) (dolist (file files) (setq thumb-file (tumme-thumb-name file) img (create-image thumb-file)) ... That is much more efficient (probably not a concern here) and also much more readable, since the "files" does not crop up at some point way down in the hierarchy. The main point about efficiency is that (mapc (lambda...)) has to create and destroy bindings for every single iteration. Moving the bindings of thumb-file etc out of the loop is also an efficiency thing. -- David Kastrup, Kriemhildstr. 15, 44793 Bochum