Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 42361429E48 for ; Sat, 14 Jan 2012 01:16:46 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Qb1i-AtSP2SF for ; Sat, 14 Jan 2012 01:16:45 -0800 (PST) Received: from mail-wi0-f181.google.com (mail-wi0-f181.google.com [209.85.212.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 929A1431FB6 for ; Sat, 14 Jan 2012 01:16:45 -0800 (PST) Received: by wibhr12 with SMTP id hr12so1049670wib.26 for ; Sat, 14 Jan 2012 01:16:44 -0800 (PST) Received: by 10.180.93.193 with SMTP id cw1mr7442958wib.5.1326532604202; Sat, 14 Jan 2012 01:16:44 -0800 (PST) Received: from localhost ([109.131.75.86]) by mx.google.com with ESMTPS id v13sm14165279wbm.14.2012.01.14.01.16.43 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 14 Jan 2012 01:16:43 -0800 (PST) From: Pieter Praet To: David Edmondson , Jani Nikula Subject: Re: [PATCH] emacs: globally replace non-branching "(if (not ..." with "(unless ..." In-Reply-To: References: <87vcogketu.fsf@praet.org> <1326389586-21683-1-git-send-email-pieter@praet.org> User-Agent: Notmuch/0.10.2+115~gadd29f6 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-unknown-linux-gnu) Date: Sat, 14 Jan 2012 10:14:57 +0100 Message-ID: <87k44uprvy.fsf@praet.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Notmuch Mail X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 14 Jan 2012 09:16:46 -0000 On Fri, 13 Jan 2012 08:23:55 +0000, David Edmondson wrote: > On Thu, 12 Jan 2012 18:33:06 +0100, Pieter Praet wrote: > > Less code, same results, without sacrificing readability. > > +1, but why not replace non-branching `if' with `when' as well? I was planning to do that when the `unless' patch was accepted, but after reading Xavier and Tomi's replies, I've changed my mind. Looking at "subr.el", it's actually more efficient to use `if' (implemented in C) instead of `when' (a macro, which essentially runs "if conf (progn ...)". The amount of non-branching "(if COND (progn ..." statements is very limited though, so if inclined to "fix" them nonetheless, a patch follows (relative to the previous one!). Peace -- Pieter