From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: emacs-devel@gnu.org
Subject: Re: point-min and 1
Date: Thu, 13 Aug 2009 00:38:57 -0400 [thread overview]
Message-ID: <E1MbS5Z-00027t-IU@fencepost.gnu.org> (raw)
In-Reply-To: <jwvk518h2vd.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Wed, 12 Aug 2009 22:22:30 -0400)
> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: emacs-devel@gnu.org
> 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.
next prev parent reply other threads:[~2009-08-13 4:38 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <E1Macea-0002f3-HQ@monty-python.gnu.org>
2009-08-11 3:07 ` point-min and 1 Eli Zaretskii
2009-08-11 9:18 ` martin rudalics
2009-08-11 18:22 ` Eli Zaretskii
2009-08-12 8:55 ` martin rudalics
2009-08-12 17:39 ` Eli Zaretskii
2009-08-12 23:03 ` Miles Bader
2009-08-13 0:13 ` Daniel Colascione
2009-08-13 9:52 ` martin rudalics
2009-08-13 16:49 ` Stefan Monnier
2009-08-13 18:08 ` martin rudalics
2009-08-13 21:28 ` Chong Yidong
2009-08-13 23:21 ` Juri Linkov
2009-08-14 7:16 ` martin rudalics
2009-08-14 9:30 ` David Kastrup
2009-08-14 9:50 ` martin rudalics
2009-08-14 9:55 ` Miles Bader
2009-08-14 1:29 ` Stefan Monnier
2009-08-14 7:15 ` martin rudalics
2009-08-14 8:44 ` David Kastrup
2009-08-14 9:50 ` martin rudalics
2009-08-11 15:13 ` Stefan Monnier
2009-08-11 18:32 ` Eli Zaretskii
2009-08-13 2:22 ` Stefan Monnier
2009-08-13 4:38 ` Eli Zaretskii [this message]
2009-08-13 9:53 ` martin rudalics
2009-08-13 12:38 ` David Kastrup
2009-08-13 14:40 ` martin rudalics
2009-08-13 16:48 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=E1MbS5Z-00027t-IU@fencepost.gnu.org \
--to=eliz@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).