From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#20587: 24.1 forward-line docs inconsistent/surprising return value Date: Sat, 16 May 2015 16:28:42 +0300 Message-ID: <83y4kofy7p.fsf@gnu.org> References: <83d221gfsn.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1431782964 8527 80.91.229.3 (16 May 2015 13:29:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 16 May 2015 13:29:24 +0000 (UTC) Cc: 20587@debbugs.gnu.org To: Vivek Dasmohapatra Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 16 15:29:14 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Ytc9P-0006Gz-Rj for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 May 2015 15:29:11 +0200 Original-Received: from localhost ([::1]:34640 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ytc9O-0008GU-Qz for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 May 2015 09:29:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ytc9K-0008GM-Ke for bug-gnu-emacs@gnu.org; Sat, 16 May 2015 09:29:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ytc9G-0001Nh-KP for bug-gnu-emacs@gnu.org; Sat, 16 May 2015 09:29:06 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36887) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ytc9G-0001Nc-Gi for bug-gnu-emacs@gnu.org; Sat, 16 May 2015 09:29:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Ytc9G-0003YG-7X for bug-gnu-emacs@gnu.org; Sat, 16 May 2015 09:29:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 16 May 2015 13:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 20587 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 20587-submit@debbugs.gnu.org id=B20587.143178293313635 (code B ref 20587); Sat, 16 May 2015 13:29:02 +0000 Original-Received: (at 20587) by debbugs.gnu.org; 16 May 2015 13:28:53 +0000 Original-Received: from localhost ([127.0.0.1]:46862 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ytc96-0003Xq-KS for submit@debbugs.gnu.org; Sat, 16 May 2015 09:28:53 -0400 Original-Received: from mtaout25.012.net.il ([80.179.55.181]:60999) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ytc92-0003XZ-5p for 20587@debbugs.gnu.org; Sat, 16 May 2015 09:28:50 -0400 Original-Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NOG0090024VW400@mtaout25.012.net.il> for 20587@debbugs.gnu.org; Sat, 16 May 2015 16:24:28 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NOG00BDP2KROJ00@mtaout25.012.net.il>; Sat, 16 May 2015 16:24:28 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:102875 Archived-At: > Date: Sat, 16 May 2015 11:07:03 +0100 (BST) > From: Vivek Dasmohapatra > cc: 20587@debbugs.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. You are again talking about the doc string. Let's first talk about what it should return in this case. If it returns 1, it would mean it didn't move, and you'd expect it to be at the beginning of the last line, not at its end. IOW, the function moved as far as it could, since there's no next line in this case. > 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. You can always test eob to see if this is the case. It's a special case anyway. > 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 But it did move. Returning zero would mean it didn't, or would be indistinguishable from the case it didn't. > 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. That's the only logical thing to do in that case. > 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. If we agree about the behavior, I can change the doc string. That's easy enough.