Re: [PATCH] emacs: globally replace non-branching "(if (not ..." with "(unless ..."
authorPieter Praet <pieter@praet.org>
Sat, 14 Jan 2012 09:52:27 +0000 (10:52 +0100)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:42:08 +0000 (09:42 -0800)
20/f15b78b309c096e0042e1106e184f21055715d [new file with mode: 0644]

diff --git a/20/f15b78b309c096e0042e1106e184f21055715d b/20/f15b78b309c096e0042e1106e184f21055715d
new file mode 100644 (file)
index 0000000..d092a04
--- /dev/null
@@ -0,0 +1,93 @@
+Return-Path: <pieter@praet.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 6973B429E50\r
+       for <notmuch@notmuchmail.org>; Sat, 14 Jan 2012 01:54:16 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id Z4mhwjyqSOcn for <notmuch@notmuchmail.org>;\r
+       Sat, 14 Jan 2012 01:54:15 -0800 (PST)\r
+Received: from mail-ww0-f45.google.com (mail-ww0-f45.google.com\r
+ [74.125.82.45])       (using TLSv1 with cipher RC4-SHA (128/128 bits))        (No client\r
+ certificate requested)        by olra.theworths.org (Postfix) with ESMTPS id\r
+ A7F97429E4E   for <notmuch@notmuchmail.org>; Sat, 14 Jan 2012 01:54:15 -0800\r
+ (PST)\r
+Received: by wgbds11 with SMTP id ds11so3550447wgb.2\r
+       for <notmuch@notmuchmail.org>; Sat, 14 Jan 2012 01:54:14 -0800 (PST)\r
+Received: by 10.180.99.232 with SMTP id et8mr2258473wib.8.1326534854577;\r
+       Sat, 14 Jan 2012 01:54:14 -0800 (PST)\r
+Received: from localhost ([109.131.75.86]) by mx.google.com with ESMTPS id\r
+       fo18sm14268495wbb.12.2012.01.14.01.54.13\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Sat, 14 Jan 2012 01:54:14 -0800 (PST)\r
+From: Pieter Praet <pieter@praet.org>\r
+To: David Edmondson <dme@dme.org>, Jani Nikula <jani@nikula.org>\r
+Subject: Re: [PATCH] emacs: globally replace non-branching "(if (not ..." with\r
+       "(unless ..."\r
+In-Reply-To: <87k44uprvy.fsf@praet.org>\r
+References: <87vcogketu.fsf@praet.org>\r
+       <1326389586-21683-1-git-send-email-pieter@praet.org>\r
+       <cunobu8huxw.fsf@hotblack-desiato.hh.sledj.net>\r
+       <87k44uprvy.fsf@praet.org>\r
+User-Agent: Notmuch/0.10.2+115~gadd29f6 (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-unknown-linux-gnu)\r
+Date: Sat, 14 Jan 2012 10:52:27 +0100\r
+Message-ID: <8762gepq5g.fsf@praet.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+Cc: Notmuch Mail <notmuch@notmuchmail.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 14 Jan 2012 09:54:16 -0000\r
+\r
+On Sat, 14 Jan 2012 10:14:57 +0100, Pieter Praet <pieter@praet.org> wrote:\r
+> On Fri, 13 Jan 2012 08:23:55 +0000, David Edmondson <dme@dme.org> wrote:\r
+> > On Thu, 12 Jan 2012 18:33:06 +0100, Pieter Praet <pieter@praet.org> wrote:\r
+> > > Less code, same results, without sacrificing readability.\r
+> > \r
+> > +1, but why not replace non-branching `if' with `when' as well?\r
+> \r
+> I was planning to do that when the `unless' patch was accepted,\r
+                    ^^\r
+                   submit\r
+\r
+> but after reading Xavier and Tomi's replies, I've changed my mind.\r
+                                               ^^^^^^^^^^^^^^^^^^^^\r
+                                               I hadn't, though...\r
+\r
+> \r
+> Looking at "subr.el", it's actually more efficient to use `if'\r
+> (implemented in C) instead of `when' (a macro, which essentially\r
+> runs "if conf (progn ...)".\r
+> \r
+> The amount of non-branching "(if COND (progn ..."  statements is very\r
+> limited though, so if inclined to "fix" them nonetheless, a patch\r
+> follows (relative to the previous one!).\r
+> \r
+> \r
+> Peace\r
+> \r
+> -- \r
+> Pieter\r
+\r
+Typsos FTW!\r
+\r
+-- \r
+Pieter\r