all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Keith David Bershatsky <esq@lawlist.com>
To: Eli Zaretskii <eliz@gnu.org>,Yuri Khan <yuri.v.khan@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Placing eol glyph (buffer-display-table) before an overlay after-string.
Date: Sat, 12 Aug 2017 12:03:05 -0700	[thread overview]
Message-ID: <m24ltcip7a.wl%esq@lawlist.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4974 bytes --]

Thank you, Eli, for letting me know the exact locations responsible for the behavior at issue, and also for suggesting the use of a real pilcrow in the overlay after-string as a possible workaround.

I have attached a couple of screen-shots and links to the same uploaded images, which were requested by Yuri.  One screen-shot is *without* the pilcrow buffer-display-table entry and *with* the after-string (containing an XPM pilcrow).  The other screen-shot is *with* a pilcrow buffer-display-table and *with* the after-string (containing the XPM pilcrow) -- all of the pilcrows to the immediate right of the vertical line are the pilcrow buffer-display-table entries that were laid during redisplay subsequent to the after-string.

The cross-hairs are designed to be compatible when word-wrap is non-nil and truncate-lines is nil.  It involves time costly custom vertical-motion calculations on each screen line.  I have set up a list of functions that trigger drawing cross-hairs, and also a list of functions that trigger removing cross-hairs and temporarily inhibit new cross-hairs from being drawn.  The horizontal line of the cross-bar and eol pilcrows draw each command loop for things like self-insert-command, whereas the vertical line of the cross-bar is on an idle-timer.  There are a few functions that trigger unconditional drawing of horizontal/vertical lines for a complete cross-hairs, such as switching to a window where that minor-mode is active.  I use a more recent implementation of Emacs Bug feature #22404 to o
 btain definitive window-start/end values and the cross-hairs (with corresponding calculations) regarding same are limited to the bounds of the visible window.

The idea about using a regular pilcrow as part of the overlay after-string instead of an XPM would "probably" [untested] work if I use the new multiple fake cursors feature (Emacs Bug feature #22873) to achieve a vbar cursor through the pilcrow whenever the cursor vertically lines up with an eol pilcrow.  Prior to the invention of #22873, I achieved the vertical bar through the eol pilcrow with an XPM that can change colors at different areas of the pilcrow depending upon the situation -- e.g., odd/even numbered columns, fill-column and beyond, last point at right window edge, and wrapped lines subsequent to the first wrapped screen line.  The hbar fake cursor can also be used with a real pilcrow in lieu of the horizontal line that I have been creating as part of the XPM pilcrow.

To save time with certain rapid-fire commands like scrolling and moving the real cursor around, I erase the cross-hairs overlays and inhibit vertical-motion calculation.  The pilcrows disappear as a result.  The visual affect of the pilcrows disappearing while the cross-hairs are temporarily inhibited from being drawn is something that I have never been able to get accustomed to seeing.  I previously experimented with temporarily removing the XPM pilcrows and temporarily enabling the buffer-display-table pilcrows for rapid-fire functions (e.g., scrolling and cursor movement), but there was a time cost and I seem to remember another hitch/glitch in involved in timing and also the visual effect when subsequently removing the buffer-display-table entry and re-enabling the XPM overlays.

Keeping the eol pilcrows visible when the cross-hairs are disabled is my preferred behavior (if possible), and that is what lead me to launching this particular thread.

Here are the two flavors of XPM pilcrows that I presently use for the custom cross-hairs minor-mode:

(defvar xpm--pilcrow
"/* XPM */
static char * pilcrow_special_xpm[] = {
\"11 20 10 1\",
\"+ s col1\",
\". s col2\",
\"% s col3\",
\"@ s col4\",
\"& s col5\",
\"# s col6\",
\"^ s col7\",
\"! s col8\",
\"$ s col9\",
\"* s col10\",
\"%.........@\",
\"%.........@\",
\"%.........@\",
\"%.........@\",
\"%.........@\",
\"%..!!!!!!.@\",
\"%.!!!!.!..@\",
\"%.!!!!.!..@\",
\"%.!!!!.!..@\",
\"%..!!!.!..@\",
\"%....!.!..@\",
\"%....!.!..@\",
\"%....!.!..@\",
\"%....!.!..@\",
\"%....!.!..@\",
\"%....!.!..@\",
\"%.........@\",
\"%.........@\",
\"&+++++++++#\",
\"%.........@\"};")

(defvar pilcrow
"/* XPM */
static char * pilcrow_regular_xpm[] = {
\"11 20 10 1\",
\"+ s col1\",
\". s col2\",
\"% s col3\",
\"@ s col4\",
\"& s col5\",
\"# s col6\",
\"^ s col7\",
\"! s col8\",
\"$ s col9\",
\"* s col10\",
\"%.........@\",
\"%.........@\",
\"%.........@\",
\"%.........@\",
\"%.........@\",
\"%..++++++.@\",
\"%.++++.+..@\",
\"%.++++.+..@\",
\"%.++++.+..@\",
\"%..+++.+..@\",
\"%....+.+..@\",
\"%....+.+..@\",
\"%....+.+..@\",
\"%....+.+..@\",
\"%....+.+..@\",
\"%....+.+..@\",
\"%.........@\",
\"%.........@\",
\"%.........@\",
\"%.........@\"};")

I am including links to the uploaded pictures just in case the mail list cannot handle storage of files that exceed a certain limit.

Links to the same images that are attached:

https://lawlist.com/images/xpm_only.png

https://lawlist.com/images/with_buffer_display_table.png


[-- Attachment #2: with_buffer_display_table.png --]
[-- Type: application/png, Size: 176100 bytes --]

[-- Attachment #3: xpm_only.png --]
[-- Type: application/png, Size: 172993 bytes --]

             reply	other threads:[~2017-08-12 19:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-12 19:03 Keith David Bershatsky [this message]
  -- strict thread matches above, loose matches on Subject: below --
2017-08-12  6:14 Placing eol glyph (buffer-display-table) before an overlay after-string Keith David Bershatsky
2017-08-12  6:56 ` Eli Zaretskii
2017-08-12  9:26 ` Yuri Khan
2017-08-12  9:52   ` Eli Zaretskii
2017-08-12 10:18     ` Yuri Khan
2017-08-12 10:32       ` 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=m24ltcip7a.wl%esq@lawlist.com \
    --to=esq@lawlist.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=yuri.v.khan@gmail.com \
    /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.