[Top][All Lists]
[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
- point-min and 1, Eli Zaretskii, 2009/08/10
- Re: point-min and 1, martin rudalics, 2009/08/11
- Re: point-min and 1, Eli Zaretskii, 2009/08/11
- Re: point-min and 1,
martin rudalics <=
- Re: point-min and 1, Eli Zaretskii, 2009/08/12
- Re: point-min and 1, Miles Bader, 2009/08/12
- Re: point-min and 1, Daniel Colascione, 2009/08/12
- Re: point-min and 1, martin rudalics, 2009/08/13
- Re: point-min and 1, Stefan Monnier, 2009/08/13
- Re: point-min and 1, martin rudalics, 2009/08/13
- Re: point-min and 1, Chong Yidong, 2009/08/13
- Re: point-min and 1, Juri Linkov, 2009/08/13
- Re: point-min and 1, martin rudalics, 2009/08/14
- Re: point-min and 1, David Kastrup, 2009/08/14