emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Placing eol glyph (buffer-display-table) before an overlay after-str


From: Keith David Bershatsky
Subject: Re: Placing eol glyph (buffer-display-table) before an overlay after-string.
Date: Sat, 12 Aug 2017 12:03:05 -0700

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 obtain 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\",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"&+++++++++#\",
\"address@hidden"};")

(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\",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden",
\"address@hidden"};")

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: with_buffer_display_table.png
Description: application/png

Attachment: xpm_only.png
Description: application/png


reply via email to

[Prev in Thread] Current Thread [Next in Thread]