[Top][All Lists]

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

Re: Question about display engine

From: martin rudalics
Subject: Re: Question about display engine
Date: Mon, 12 Aug 2019 10:59:52 +0200

>> Answering this question should not be the task of a (face agnostic)
>> display engine.  The face merging algorithm would have to decide
>> whether the :extend attribute of the winning face should cause an
>> extension of any attribute specified by that face.
> What is the "winning face" in this context?

IIUC the last one found by face_at_buffer_position that explicitly
specified a value for the attribute in question.  That is, the face
whose attribute is actually used by the display engine.

> Not necessarily true: two or more faces could specify the same value
> of a particular attribute, including background and underlining.  The
> :extend attribute could be different in some of these faces.

Suppose the iterator is at a newline character within some highlighted
text within the region and wants to know the :background attribute at
that position.

With a face-based solution, face_at_buffer_position will have looked
for a :background value provided by the default face, the highlight
face and the region face, in this order.  The value of the :extend
attribute provided by the last face found that way is passed (in some
extend_background variable I presume) to the display engine so the
latter can determine whether the background shall be extended to the
window edge or not.

With an attribute-based solution, face_at_buffer_position will have
provided an appropriate value when the last face "found that way" is a
member of the 'extend-background' Lisp variable.

A similar approach would be used to decide whether the rest of the
line should be underlined, overlined, boxed, appear in inverse-video
or whatever someone considers important (I suppose that none of these
should ever extend).

As stated earlier, the face-based solution will intuitively not DTRT
when we allow underline to extend and a user sets, for example, all
:underline, :background and :extend for the region face.  In that
case, both background and underline of the region will extend.  With
an attribute-based solution, a user would just have added 'region' to
the 'extend-background' variable and this "problem" would be avoided.


reply via email to

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