From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Efficiently using MOVE_IT_... to gather a plethora of information. Date: Tue, 22 Aug 2017 22:16:41 +0300 Message-ID: <83inhf9zvq.fsf@gnu.org> References: Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1503429456 14939 195.159.176.226 (22 Aug 2017 19:17:36 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 22 Aug 2017 19:17:36 +0000 (UTC) Cc: emacs-devel@gnu.org To: Keith David Bershatsky Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 22 21:17:31 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dkEft-0002jK-OF for ged-emacs-devel@m.gmane.org; Tue, 22 Aug 2017 21:17:17 +0200 Original-Received: from localhost ([::1]:47865 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkEfx-00025M-5U for ged-emacs-devel@m.gmane.org; Tue, 22 Aug 2017 15:17:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38392) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkEfl-00024o-2n for emacs-devel@gnu.org; Tue, 22 Aug 2017 15:17:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkEfg-0006Vx-4g for emacs-devel@gnu.org; Tue, 22 Aug 2017 15:17:09 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:35430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkEfg-0006Vp-1U; Tue, 22 Aug 2017 15:17:04 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:3133 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dkEfe-0003am-RC; Tue, 22 Aug 2017 15:17:03 -0400 In-reply-to: (message from Keith David Bershatsky on Tue, 22 Aug 2017 11:26:25 -0700) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.devel:217698 Archived-At: > Date: Tue, 22 Aug 2017 11:26:25 -0700 > From: Keith David Bershatsky > > The method that I am presently using to calculate coordinates is inefficient and relies upon a unique set of circumstances that must exist for everything to work. I am looking for the most efficient approach to calculate certain values at three locations of each visible screen line -- `point` and coordinates (x/y/hpos/vpos): > > 1. Beginning of each visible screen line. > > 2. Ending of each visible screen line. > > 3. The current X axis aligned with the cursor on each visible screen line. You need to do this for _every_ screen line in the window? If so, this will be terribly slow, so slow as to be impractical in some situations. Why do you need all those coordinates of all the screen lines? Btw, if variable fonts are used, the cursor positions on two adjacent lines might not be aligned, so I'm not sure I understand how your feature is supposed to work in that case. > This project utilizes the MOVE_IT family within xdisp.c. We would probably all agree that we start the IT at w->start, but where do we go from there is the question. Is the following connect-the-dot the most efficient approach to move the IT to each location from window-start to window-end? > > 1 2 3 > > 4 5 6 > > 7 8 9 The move_it_* functions all proceed in the buffer logical order, so you are traversing all these places anyway. IOW, yes, this is the most efficient order. But it will be very slow, if you need to do this for all screen lines in a window.