unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Gregory Heytings via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: 42307@debbugs.gnu.org
Subject: bug#42307: bug#42347: Feature request: Visual block attribute for overlays
Date: Tue, 14 Jul 2020 15:45:01 +0000	[thread overview]
Message-ID: <alpine.NEB.2.21.2007141716040394.1144@sdf.lonestar.org> (raw)
In-Reply-To: <83eepem9im.fsf@gnu.org>


>>>> 2. remove all pixel columns on the right *and on the left* of the 
>>>> overlay which have no "content" (that is, no characters on the right, 
>>>> and whitespace characters on the left).
>>>
>>> What would be the definition of "whitespace" for this purpose?
>>>
>>
>> I think the regexp "[ \t\r\n]*" would be appropriate.
>
> Are you sure?
>
> First, \r doesn't happen in Emacs buffers,
>

I wasn't sure about \r, but included it just in case.

>
> and \n is the newline, so it isn't on the same line.
>

It is, but it's the last character of the line.  With the current default 
behavior it is displayed, there is one more blank character after each 
line, just type C-x = on that character.

In the two pictures (visualblock.png and visualblock-2.png) I sent (see 
bug #42307), the \n is removed on the right.  Otherwise there would be one 
more column on the right.

>
> Next, what about \f, and more generally about any other sequence of 
> characters that match [:blank:]?
>

Good question.  As far as I know \f is displayed by default as '^L' by 
Emacs, so it's a visible character, and I'm fine with this.  I think it 
should not count as a blank character, which means that an overlay with a 
'\f' in a column would extend at least to that column.

>
> And finally, what about stretches of whitespace generated by the 'space' 
> display properties?
>

I don't know, and I'm not sure I fully understand the question.  The 
"algorithm" I proposed is, I think, clear and simple: draw the overlay 
with :extend t, and trim whitespace on the left and on the right.

That being said, on a second thought I think a better name for the 
proposed attribute would be ":trim" (or perhaps ":trimleft" and 
"trimright" to give as much possible freedom to Emacs users).  It could 
have, for example, three values:

- default value = nil, gives the default behavior (with and without 
:extend)

- value = t, gives the behavior of "visiblechars.png"

- value = column, gives the behavior of "visualblock.png" and 
"visualblock-2.png"

Gregory





  reply	other threads:[~2020-07-14 15:45 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-08 17:19 bug#42347: Feature request: Visual block attribute for overlays Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-07-14  2:32 ` Eli Zaretskii
2020-07-14  7:38   ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-07-14 14:55     ` Eli Zaretskii
2020-07-14 15:45       ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2020-07-14 16:34         ` bug#42307: " Eli Zaretskii
2020-07-14 17:01           ` bug#42307: " Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-07-14 17:10             ` Eli Zaretskii
2020-07-14 17:20               ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-07-14  4:23 ` bug#42347: " Drew Adams
2020-07-14  7:49   ` Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors
2020-07-14 14:48     ` Drew Adams
2020-07-14 15:53       ` bug#42307: " Gregory Heytings via Bug reports for GNU Emacs, the Swiss army knife of text editors

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=alpine.NEB.2.21.2007141716040394.1144@sdf.lonestar.org \
    --to=bug-gnu-emacs@gnu.org \
    --cc=42307@debbugs.gnu.org \
    --cc=ghe@sdf.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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).