From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: "... the window start at a meaningless point within a line." Date: Fri, 16 Oct 2015 21:23:10 +0300 Message-ID: <837fmm65bl.fsf@gnu.org> References: <20150930204513.GA3174@acm.fritz.box> <83mvw39dp3.fsf@gnu.org> <20151001094138.GA2515@acm.fritz.box> <83h9maao7w.fsf@gnu.org> <20151001110204.GB2515@acm.fritz.box> <83egheaj9e.fsf@gnu.org> <20151015181642.GA6467@acm.fritz.box> <834mhr99e8.fsf@gnu.org> <20151016095535.GA2779@acm.fritz.box> <83a8ri67jg.fsf@gnu.org> <20151016181249.GC2779@acm.fritz.box> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1445019811 20125 80.91.229.3 (16 Oct 2015 18:23:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 16 Oct 2015 18:23:31 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alan Mackenzie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 16 20:23:23 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 1Zn9f0-0001JZ-8O for ged-emacs-devel@m.gmane.org; Fri, 16 Oct 2015 20:23:22 +0200 Original-Received: from localhost ([::1]:55337 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zn9ez-0005il-Nf for ged-emacs-devel@m.gmane.org; Fri, 16 Oct 2015 14:23:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34507) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zn9ev-0005hy-Lv for emacs-devel@gnu.org; Fri, 16 Oct 2015 14:23:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Zn9eq-0007ah-LZ for emacs-devel@gnu.org; Fri, 16 Oct 2015 14:23:17 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:39341) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Zn9eq-0007Za-EB for emacs-devel@gnu.org; Fri, 16 Oct 2015 14:23:12 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NWB00L00RJWSE00@mtaout24.012.net.il> for emacs-devel@gnu.org; Fri, 16 Oct 2015 21:16:24 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NWB00D3DS3CJA80@mtaout24.012.net.il>; Fri, 16 Oct 2015 21:16:24 +0300 (IDT) In-reply-to: <20151016181249.GC2779@acm.fritz.box> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.180 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:191783 Archived-At: > Date: Fri, 16 Oct 2015 18:12:50 +0000 > Cc: emacs-devel@gnu.org > From: Alan Mackenzie > > > But why do you need to do that? IOW, what problem does > > maybe_move_to_exact_bol solve, and how that problem is related to what > > Fvertical_motion does? > > > Perhaps start by explaining what problems you discovered in > > Fvertical_motion that required you to make those changes. > > Without maybe_move_to_exact_bol, vertical-motion, when it lands near > the top of the window, leaves the cursor not at column 0 on the screen. > > So, for example, with point at C, unmodified (vertical-motion -1) takes > us to A2, when we want to go to L3. So all you need is make a correction after Fvertical_motion did its thing, is that right? Will the following algorithm work: . compute the horizontal difference, in pixels, between the position which xdisp would use as window-start and the actual window-start (the value should always be positive); let's call the result N . let Fvertical_motion do its thing exactly as it does now . move N more pixels to the right, i.e. in the direction of increasing the X coordinate, or to the end of line, if it ends before that coordinate If this should work, then all you need is to implement the 1st bullet, which is very easy, nothing as complicated as your maybe_move_to_exact_bol. It should just call move_it_in_display_line to get to the actual window-start, and save the X coordinate wehen it gets there.