emacs-devel
[Top][All Lists]
Advanced

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

Re: point-min and 1


From: martin rudalics
Subject: Re: point-min and 1
Date: Wed, 12 Aug 2009 10:55:58 +0200
User-agent: Thunderbird 2.0.0.21 (Windows/20090302)

>>  > Can `(goto-char (point-min))' be different from `(goto-char 1)' after
>>  > a call to `widen'?
>>
>> simple.el should not promote bad programming style ;-)
>
> What's bad about it?

The call to `widen' is of no importance here.  As a matter of fact,
`(goto-char (point-min))' and `(goto-char 1)' are operationally
equivalent - they "always" move point to the same buffer position
regardless of whether the buffer was narrowed or not.

IMHO writing `(goto-char 1)' is bad style because it exhibits a low
level detail of Elisp implementation, namely that it sees buffer
positions as numbers counted from 1.  I think Elisp code - and in
particular code in simple.el which might be used as some kind of
reference code for people starting to speak Elisp - should hide such
details wherever it can.

martin




reply via email to

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