Subject: RE: bug#42307: Feature request: Visual block attribute for overlays

From: Gregory Heytings <[email-masked]>
Date: Fri, 10 Jul 2020 16:02:52 +0000

Thanks for your feedback!

>
> Looking only at the images, I have this question about your "visual 
> block" coverage:
>
> What if `overlay-start' were on the `u', instead of the `i',
>

Actually it starts on the '(', the opening parenthesis is green if you 
look close enough.

>
> of `if (consp ,funs))'?  Would the overlay cover only from that `u' 
> onward, or would it still cover from the `i' of `if' onward?  IOW, does 
> the left edge of the highlighted area extend downward from 
> `overlay-start', or does it start from the first non-whitespace char in 
> the line?
>

If you take the algorithm, it would start on the "u", extend to the place 
it extends on the picture on the right, and on the next lines two 
whitespace characters on the left would not be displayed as green anymore 
(that is, the green area would start under the "f" of "(if".

>
> What about a variant of your "visual block" that extends the overlay so 
> that all lines, from the first line, which contains `overlay-start' to 
> the last line, which contains `overlay-end', are covered through the 
> same columns?  Coverage (highlighting) would then always be a rectangle. 
> In your example, it would the highlighting of the last line would be 
> extended to the same column as that of the other lines.
>

That's a possible variant, indeed.  Let's name this one "visualrectangle". 
But from a programmer's point of view it makes (IMHO) less sense.

>
> Your "visual block", and the variant just described, just like the old 
> behavior, cover both whitespace chars and empty screen real estate (no 
> chars), from `overlay-start' to `overlay-end'.  The new behavior is the 
> only one that covers only _chars_ in that span (whitespace or other 
> chars).
>

Indeed.  Yet another possibility would be cover only non-whitespace chars. 
Let's name this one "visiblechars".

>
> In any case, whatever the choices we offer, Elisp should make it simple 
> to choose any of them.
>

Yes ;-)  My personal preference order among the possible choices is:

1. visualblock
2. the previous default
3. visiblechars
4. the current default
5. visualrectangle

Gregory