[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: point-min and 1

From: Eli Zaretskii
Subject: Re: point-min and 1
Date: Thu, 13 Aug 2009 00:38:57 -0400

> From: Stefan Monnier <address@hidden>
> Cc: address@hidden
> Date: Wed, 12 Aug 2009 22:22:30 -0400
> Just the same old general programming principle that says that you
> should avoid using integer constants and prefer to give them names, so
> the intention is clear.  In the case of "1", there might be many
> different kinds of "1", it can be "1" the size of chars in a buffer, or
> "1" the position of the second char in a string, or ...
> As a general rule, using 1 rather than (point-min) tends to also
> introduce bugs where code only works when the buffer is widened, so it's
> good practice to prefer (point-min) over 1.

Thanks.  I don't necessarily agree with the reasoning, but at least I
understand the reasons for the change now.

If we want this to be a general style convention, perhaps we should
say something about it in the ELisp manual.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]