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 10:08:56 +0300 Message-ID: <83d221gfsn.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Trace: ger.gmane.org 1431760226 1599 80.91.229.3 (16 May 2015 07:10:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 16 May 2015 07:10:26 +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 09:10:15 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 1YtWEh-0001t7-7H for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 May 2015 09:10:15 +0200 Original-Received: from localhost ([::1]:33818 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtWEg-0004Gc-10 for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 May 2015 03:10:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60868) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtWEb-0004GX-Tp for bug-gnu-emacs@gnu.org; Sat, 16 May 2015 03:10:11 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtWEW-0007Ci-V4 for bug-gnu-emacs@gnu.org; Sat, 16 May 2015 03:10:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36768) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtWEW-0007C0-RQ for bug-gnu-emacs@gnu.org; Sat, 16 May 2015 03:10:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YtWEW-0000sN-6T for bug-gnu-emacs@gnu.org; Sat, 16 May 2015 03:10:04 -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 07:10:04 +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.14317601463292 (code B ref 20587); Sat, 16 May 2015 07:10:04 +0000 Original-Received: (at 20587) by debbugs.gnu.org; 16 May 2015 07:09:06 +0000 Original-Received: from localhost ([127.0.0.1]:46743 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YtWDa-0000r1-0n for submit@debbugs.gnu.org; Sat, 16 May 2015 03:09:06 -0400 Original-Received: from mtaout25.012.net.il ([80.179.55.181]:50491) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YtWDX-0000qT-3M for 20587@debbugs.gnu.org; Sat, 16 May 2015 03:09:04 -0400 Original-Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NOF00400KNAXX00@mtaout25.012.net.il> for 20587@debbugs.gnu.org; Sat, 16 May 2015 10:04:43 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NOF003EHKZVZF20@mtaout25.012.net.il>; Sat, 16 May 2015 10:04:43 +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:102865 Archived-At: > Date: Sat, 16 May 2015 00:23:56 +0100 (BST) > From: Vivek Dasmohapatra > > In the elisp manual, (forward-line X) is described as returning > the number of lines left to move if it cannot satisfy the caller's > request to move forward X lines. > > However, calling (forward-line 1) at the start of a line with > no terminating newline (ie the incomplete final line in a buffer, > if it is incomplete) returns 0. > > Calling (forward-line 1) at the _end_ of such a line returns 1. > > The docstring for forward line does say the following at the end: > > “With positive N, a non-empty line at the end counts as one line > successfully moved (for the return value).” > > I think this is surprising and inconsistent behaviour. Why do you think it's inconsistent? In the first case, the command 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 doesn't seem reasonable to me, especially given that the > documentation starts with: > > “Move N lines forward (backward if N is negative). > Precisely, if point is on line I, move to the start of line I + N > ("start of line" in the logical order).” Again, the documentation could be made more accurate, but let's first agree on the desirable behavior, okay?