From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Keith David Bershatsky Newsgroups: gmane.emacs.devel Subject: Efficiently using MOVE_IT_... to gather a plethora of information. Date: Tue, 22 Aug 2017 11:26:25 -0700 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Trace: blaine.gmane.org 1503426477 28873 195.159.176.226 (22 Aug 2017 18:27:57 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 22 Aug 2017 18:27:57 +0000 (UTC) To: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 22 20:27:53 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 1dkDu5-0007HE-5s for ged-emacs-devel@m.gmane.org; Tue, 22 Aug 2017 20:27:53 +0200 Original-Received: from localhost ([::1]:43883 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkDuB-0002Ad-Sr for ged-emacs-devel@m.gmane.org; Tue, 22 Aug 2017 14:27:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dkDsz-0001oL-RD for emacs-devel@gnu.org; Tue, 22 Aug 2017 14:26:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dkDsw-0002JX-JE for emacs-devel@gnu.org; Tue, 22 Aug 2017 14:26:45 -0400 Original-Received: from gateway22.websitewelcome.com ([192.185.47.125]:26621) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dkDsw-0002Gj-9l for emacs-devel@gnu.org; Tue, 22 Aug 2017 14:26:42 -0400 Original-Received: from cm17.websitewelcome.com (cm17.websitewelcome.com [100.42.49.20]) by gateway22.websitewelcome.com (Postfix) with ESMTP id 02E955264A for ; Tue, 22 Aug 2017 13:26:27 -0500 (CDT) Original-Received: from gator3053.hostgator.com ([50.87.144.69]) by cmsmtp with SMTP id kDs3drASjc72gkDs3dhYkY; Tue, 22 Aug 2017 13:25:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lawlist.com ; s=default; h=Content-Type:MIME-Version:Subject:To:From:Message-ID:Date: Sender:Reply-To:Cc:Content-Transfer-Encoding:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=5Q4QYFrX+tfwC1w4BwBA69SnMJxA54eutVFkF/B7JBI=; b=ela5boQ2mnDmqga1LKNPBc2dO3 tl5zPPPDa38X9PSk/vgEZpMk0gRupC/ohh987Tmu1JbUvGnVhL0GtkhoHVikeMkYN44Tv34hTCVNJ K8KErj72ccSyIfdS3WmiWBw1tnRmHlOfTGzB2bzl1RhmRXc97cw9VnMkLpw2K724wF1cLbNC6kyA5 q4NctM2lA1ADxHb+91m67esbClDBjWS5u8getu64R7mlPJmbQdVRisKa4xfMkTDBaMrjWz0yqNoIt sdAMqf3gk424vKOkQjkHrURMbnlmmzQKav7OomxOP2BhqfLibuhuYrFGiC+qSekHV+XmZ0/KcHmVQ Trl+uY0A==; Original-Received: from cpe-45-48-239-195.socal.res.rr.com ([45.48.239.195]:50935 helo=server.local) by gator3053.hostgator.com with esmtpsa (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.87) (envelope-from ) id 1dkDsg-0010fV-BU for emacs-devel@gnu.org; Tue, 22 Aug 2017 13:26:26 -0500 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3053.hostgator.com X-AntiAbuse: Original Domain - gnu.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - lawlist.com X-BWhitelist: no X-Source-IP: 45.48.239.195 X-Exim-ID: 1dkDsg-0010fV-BU X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: cpe-45-48-239-195.socal.res.rr.com (server.local) [45.48.239.195]:50935 X-Source-Auth: lawlist X-Email-Count: 1 X-Source-Cap: bGF3bGlzdDtsYXdsaXN0O2dhdG9yMzA1My5ob3N0Z2F0b3IuY29t X-Local-Domain: yes X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 192.185.47.125 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:217697 Archived-At: I am working on two of my related feature requests: #17684 (vertical line spanning window body height); and, #22873 (multiple fake cursors). draw_window_cursor is used to create fake cursors with/without glyphs on top -- the creation of glyphs is optional by permitting/suppressing the call to draw_phys_cursor_glyph. On OSX, a glyphless fake cursor (i.e., no character on top) can be erased by redrawing it with the window background color. Fake cursors with glyphs on top (i.e., a character) are erased with erase_phys_cursor. [I have not yet experimented with erasing a glyphless fake cursor on a Windows or X11 platform, but am hoping the concept is similar to the approach I use for OSX.] The combination of glyph/glyphless fake cursors can be used to create a thin vertical line spanning the window body height, which has a variety of applications; e.g., a vertical line indicating the fill-column, a vertical line that tracks the cursor position, etc. Creating a horizontal line spanning the window body width is easier, and can be done with hbar fake cursors and/or overlays (using a combination of 'display and 'after-string properties with an :underline). This application is similar to hl-line-mode, except that the :underline can be extended beyond the end of the text. `word-wrap` set to a non-nil value and truncate-lines set to a nil value makes the coordinate calculations costly if they are run each command loop. At the present time, I am using an idle timer to calculate/display the vertical line. 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. 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 Thanks, Keith