From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Vivek Dasmohapatra Newsgroups: gmane.emacs.bugs Subject: bug#20587: 24.1 forward-line docs inconsistent/surprising return value Date: Sat, 16 May 2015 00:23:56 +0100 (BST) Message-ID: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-274034158-1431732243=:18547" X-Trace: ger.gmane.org 1431732325 31614 80.91.229.3 (15 May 2015 23:25:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 15 May 2015 23:25:25 +0000 (UTC) To: 20587@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 16 01:25: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 1YtOyf-0000Nb-Lf for geb-bug-gnu-emacs@m.gmane.org; Sat, 16 May 2015 01:25:13 +0200 Original-Received: from localhost ([::1]:33209 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtOye-0005H3-JU for geb-bug-gnu-emacs@m.gmane.org; Fri, 15 May 2015 19:25:12 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59560) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtOya-0005Fd-KC for bug-gnu-emacs@gnu.org; Fri, 15 May 2015 19:25:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtOyW-0000jc-Er for bug-gnu-emacs@gnu.org; Fri, 15 May 2015 19:25:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:36591) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtOyW-0000iG-Bc for bug-gnu-emacs@gnu.org; Fri, 15 May 2015 19:25:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1YtOyV-0004QY-Tt for bug-gnu-emacs@gnu.org; Fri, 15 May 2015 19:25:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Vivek Dasmohapatra Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 May 2015 23:25:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 20587 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.143173226816955 (code B ref -1); Fri, 15 May 2015 23:25:03 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 May 2015 23:24:28 +0000 Original-Received: from localhost ([127.0.0.1]:46563 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YtOxv-0004PP-NB for submit@debbugs.gnu.org; Fri, 15 May 2015 19:24:28 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:45913) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1YtOxt-0004PC-Uj for submit@debbugs.gnu.org; Fri, 15 May 2015 19:24:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtOxn-0006ye-Mb for submit@debbugs.gnu.org; Fri, 15 May 2015 19:24:20 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:54503) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtOxn-0006yN-KI for submit@debbugs.gnu.org; Fri, 15 May 2015 19:24:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59414) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtOxm-0005A6-Mh for bug-gnu-emacs@gnu.org; Fri, 15 May 2015 19:24:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YtOxi-0006k7-Md for bug-gnu-emacs@gnu.org; Fri, 15 May 2015 19:24:18 -0400 Original-Received: from ceres.etla.org ([85.119.82.193]:59072) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YtOxi-0006Qp-HV for bug-gnu-emacs@gnu.org; Fri, 15 May 2015 19:24:14 -0400 Original-Received: from [2a01:4f8:201:6f00::2001] by ceres.etla.org with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1YtOxX-0001R7-ML for bug-gnu-emacs@gnu.org; Sat, 16 May 2015 00:24:06 +0100 X-X-Sender: vivek@platypus.pepperfish.net User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam_report: Spam detection software, running on the system "ceres.etla.org", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: In GNU Emacs 24.1.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.10) of 2012-08-23 on noise, modified by Debian 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. [...] Content analysis details: (-2.9 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP -1.9 BAYES_00 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). 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:102850 Archived-At: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-274034158-1431732243=:18547 Content-Type: TEXT/PLAIN; format=flowed; charset=UTF-8 Content-Transfer-Encoding: 8BIT In GNU Emacs 24.1.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.10) of 2012-08-23 on noise, modified by Debian 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. 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).” In any case, even if forward-line is not altered (I suppose it is possible that this behaviour has been around for a long time, and many things may depend on forward-line behaving in this manner), the Info manual should be updated to match the docstring. I also think the surprising behaviour is not clearly flagged: It is part of a single lump of docstring text, and not flagged or highlighted in any way (a simple extra blank line before its description, or a "NOTE:" or similar would make it much easier to spot). --8323329-274034158-1431732243=:18547--