From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: "... the window start at a meaningless point within a line." Date: Sun, 18 Oct 2015 14:53:56 +0000 Message-ID: <20151018145356.GC1639@acm.fritz.box> References: <834mhr99e8.fsf@gnu.org> <20151016095535.GA2779@acm.fritz.box> <83a8ri67jg.fsf@gnu.org> <20151016181249.GC2779@acm.fritz.box> <837fmm65bl.fsf@gnu.org> <20151016201238.GD2779@acm.fritz.box> <83twpp51xz.fsf@gnu.org> <20151017115738.GA2522@acm.fritz.box> <83oafx4qsb.fsf@gnu.org> <83lhb14o6e.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1445179959 13680 80.91.229.3 (18 Oct 2015 14:52:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 18 Oct 2015 14:52:39 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 18 16:52:29 2015 Return-path: Envelope-to: ged-emacs-devel@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 1ZnpK0-0001sH-Fx for ged-emacs-devel@m.gmane.org; Sun, 18 Oct 2015 16:52:28 +0200 Original-Received: from localhost ([::1]:34214 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnpJz-0005di-E9 for ged-emacs-devel@m.gmane.org; Sun, 18 Oct 2015 10:52:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42557) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnpJv-0005dd-2W for emacs-devel@gnu.org; Sun, 18 Oct 2015 10:52:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZnpJr-0000cI-T5 for emacs-devel@gnu.org; Sun, 18 Oct 2015 10:52:23 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:18228) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZnpJr-0000bt-Iv for emacs-devel@gnu.org; Sun, 18 Oct 2015 10:52:19 -0400 Original-Received: (qmail 48231 invoked by uid 3782); 18 Oct 2015 14:52:18 -0000 Original-Received: from acm.muc.de (p548A5AEF.dip0.t-ipconnect.de [84.138.90.239]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 18 Oct 2015 16:52:17 +0200 Original-Received: (qmail 7778 invoked by uid 1000); 18 Oct 2015 14:53:56 -0000 Content-Disposition: inline In-Reply-To: <83lhb14o6e.fsf@gnu.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 193.149.48.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:191951 Archived-At: Hello, Eli. On Sat, Oct 17, 2015 at 04:31:05PM +0300, Eli Zaretskii wrote: > > Date: Sat, 17 Oct 2015 15:34:44 +0300 > > From: Eli Zaretskii > > Cc: emacs-devel@gnu.org > > So now I think that the problem can be solved as follows: > > . if Fvertical_motion's code without changes ends up before the > > first newline that follows the window-start, you don't need to do > > anything, because Fvertical_motion does exactly what you want in > > that case > > . otherwise Fvertical_motion will either end up on the screen line > > before the goal, or will be on the right screen line, but to the > > right of the goal column, and a correction should be applied by > > moving point to the left > Is the following a correct definition of when Fvertical_motion > overshoots, i.e. lands one line below (for LINES > 0) the correct one: > when the offset between the "actual" window-start and the preceding > "xdisp" BOL is greater than the X coordinate of the last character of > the 1st physical line in the window. Disentangling the words, what I think you're saying is that .... nlines = 3 8. B-------WS-------------A-------L1-------------A2----\nC--------C2--------C3 <---N---> <---------X---------> (a) ^ it,T (b) ^ it T nlines = 3 9. B-----------------WS---A-----------------L1---A2----\nC--------C2--------C3 <--------N--------> <----X----> (a) ^ it,T (b) ^ it T .... an overshoot occurs when N > X. I'm assuming that by "X coordinate of ..." you're meaning the offset from an _actual_ BOL. I don't see at all that this is the case. In diagram 8, N < X, and in diagram 9, N > X. In 8(a) and 9(a) Fvertical_motion hits the target directly. In 8(b) and 9(b), there is an "undershoot" rather than an "overshoot". The critical factor is not whether N > X; it's the precise positioning of point with respect to the actual and xdisp BOLs on the first text line. -- Alan Mackenzie (Nuremberg, Germany).