[Top][All Lists]

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

Re: Layered display API

From: Eli Zaretskii
Subject: Re: Layered display API
Date: Sat, 16 Aug 2014 10:41:50 +0300

> Date: Sat, 16 Aug 2014 03:03:33 +0400
> From: Dmitry Gutov <address@hidden>
> CC: address@hidden, address@hidden
> > What I'm suggesting will allow you not to duplicate the displayed
> > text, but just add an overlay with your own.
> Sorry, I'm getting strongly mixed signals here: just recently, when I 
> enumerated a list of requirements for displaying our popup, you replied:
> """
> Given these requirements, I think the only 2 alternatives to implement
> them for GUI frames are:
>    . tooltip frames, suitably beefed up to provide some features they
>      currently don't, like more control of colors and faces
>    . some low-level graphics feature that would allow to overlay an
>      arbitrary pixmap on the window display (this is far from my area
>      of expertise, so I cannot say anything more about this
>      possibility)
> Nothing else seems possible, because if we rely on the current display
> engine, we will be unable to fully control at least the vertical
> position of the lines in your popup, and in some cases (e.g.,
> line-prefix) also the horizontal position.
> """
> So, which part of the job would the new text property perform, and which 
> part of it will be left to us to implement?

None.  The new property is yet another possibility, IMO inferior to
the 2 I suggested above.

> Let's imagine this sample case:
>    (insert "e\naaaaaa\n")
>    (insert (propertize " " 'display "bbbbbb\ncccccc")
> (By the way, try this out in *scratch* and do some C-n, C-p. Do you see 
> the movement error? Here, the cursor always jumps over the "aaa..." 
> line when moving toward the beginning of the buffer.)

Please file a bug report.

> Let's say the point is at the end of the first line (after "e"), and 
> we'd like to display a popup under it, 4 columns wide and 2 lines tall. 
> If the popup is all filled with "x" characters, it should look like this:
> e.
> axxxxa
> bxxxxb
> cccccc
> If the new property was already implemented, what would the code to do 
> this look like?

Something like this:

  (put-text-property POS1 POS1+4 'eliz "xxxx")
  (put-text-property 1 5 STRING 'eliz "xxxx")
  (put-text-property 8 12 STRING 'eliz "xxxx")

where POS1 is the buffer position of the second 'a', and STRING is the
string that is the value of the 'display' property.

reply via email to

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