[PATCH] emacs: globally replace non-branching "(if (not ..." with "(unless ..."
Pieter Praet
pieter at praet.org
Sat Jan 14 01:14:57 PST 2012
On Fri, 13 Jan 2012 08:23:55 +0000, David Edmondson <dme at dme.org> wrote:
> On Thu, 12 Jan 2012 18:33:06 +0100, Pieter Praet <pieter at praet.org> 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
More information about the notmuch
mailing list