From: Vivek Dasmohapatra <vivek@etla.org>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 20587@debbugs.gnu.org
Subject: bug#20587: 24.1 forward-line docs inconsistent/surprising return value
Date: Sat, 16 May 2015 11:07:03 +0100 (BST) [thread overview]
Message-ID: <alpine.DEB.2.02.1505161051180.18547@platypus.pepperfish.net> (raw)
In-Reply-To: <83d221gfsn.fsf@gnu.org>
> Why do you think it's inconsistent? In the first case, the command
It strikes me as inconsistent because of this:
>> Precisely, if point is on line I, move to the start of line I + N
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
And it is precisely this which it has not been able to do.
Take the example of a case where I wish to move N lines forward
to leave a gap of N lines before I insert some text, and I use
the return value of forward-line to check how far I have moved.
On an incomplete last line with an N of 1, forward-line will return 0,
indicating that it has satisfied my request to move to the start of
line I + 1, when in fact it has not, so now I must check for end-of-buffer
explicitly to see if this case has occurred.
> moved; in the second one it didn't. So the return value looks OK to
> me, and I see that the implementation goes to some length to catch the
> first case and return zero. (The doc string indeed is inaccurate.)
It did not do that. It moved to the end of line I, not the start of
line I + 1.
That's the part I find surprising.
It may be that the behaviour is so ancient that it cannot be altered
without breaking things: I wouldn't push for the behaviour change in
that case. But I think the special case should be more clearly flagged
and stated.
next prev parent reply other threads:[~2015-05-16 10:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-15 23:23 bug#20587: 24.1 forward-line docs inconsistent/surprising return value Vivek Dasmohapatra
2015-05-16 7:08 ` Eli Zaretskii
2015-05-16 10:07 ` Vivek Dasmohapatra [this message]
2015-05-16 13:28 ` Eli Zaretskii
2015-05-16 14:20 ` Eli Zaretskii
2015-05-23 2:50 ` Vivek Dasmohapatra
2015-05-23 3:26 ` Eric Hanchrow
2015-05-23 8:05 ` Eli Zaretskii
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=alpine.DEB.2.02.1505161051180.18547@platypus.pepperfish.net \
--to=vivek@etla.org \
--cc=20587@debbugs.gnu.org \
--cc=eliz@gnu.org \
/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).