emacs-devel
[Top][All Lists]
Advanced

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

Re: point-min and 1


From: Stefan Monnier
Subject: Re: point-min and 1
Date: Wed, 12 Aug 2009 22:22:30 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

> I asked a serious question.  Would you please humor me with a serious
> answer?

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.


        Stefan




reply via email to

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