all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Keith David Bershatsky <esq@lawlist.com>
To: Emacs Devel <emacs-devel@gnu.org>
Subject: Efficiently using MOVE_IT_... to gather a plethora of information.
Date: Tue, 22 Aug 2017 11:26:25 -0700	[thread overview]
Message-ID: <m2y3qba27i.wl%esq@lawlist.com> (raw)

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



             reply	other threads:[~2017-08-22 18:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-22 18:26 Keith David Bershatsky [this message]
2017-08-22 19:16 ` Efficiently using MOVE_IT_... to gather a plethora of information Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2017-08-22 20:17 Keith David Bershatsky
2017-08-23  3:58 ` Stefan Monnier
2017-08-23  8:46   ` martin rudalics
2017-08-23  8:49     ` martin rudalics
2017-08-23 20:56     ` Stefan Monnier
2017-08-23 17:21   ` Eli Zaretskii
2017-08-23 18:08 ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2y3qba27i.wl%esq@lawlist.com \
    --to=esq@lawlist.com \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.