[PATCH] emacs: globally replace non-branching "(if (not ..." with "(unless ..."
Pieter Praet
pieter at praet.org
Sat Jan 14 01:52:27 PST 2012
On Sat, 14 Jan 2012 10:14:57 +0100, Pieter Praet <pieter at praet.org> wrote:
> 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,
^^
submit
> but after reading Xavier and Tomi's replies, I've changed my mind.
^^^^^^^^^^^^^^^^^^^^
I hadn't, though...
>
> 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
Typsos FTW!
--
Pieter
More information about the notmuch
mailing list