emacs-devel
[Top][All Lists]
Advanced

[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: Sat, 17 Aug 2019 10:25:13 +0200

> I'd prefer this method.  Two reasons: (1) it is localized to the code
> which may need such a face; and (2) it scales better, because the
> display code is frequently invoked on short portions of the text, so
> there's no guarantee that it will actually get to producing glyphs
> with the "extension" variant of the face, so realizing that face in
> advance might well be waste of unneeded effort, because the additional
> face will never be used.

The following should capture what emerged from this discussion so far:

(1) Provide an :extend face attribute with the semantics to extend, if
    set, any "background-related" attributes like :background,
    :underline, :box ... specified by this face.

(2) When merging faces, set an extend-background, extend-underline,
    extend-box ... bit for all background-related attributes whenever
    the face merged in has both the :extend attribute non-nil and the
    corresponding background-related attribute set.

(3) When the display engine encounters a newline character and the
    current face has one of the extend-* bits set, either reuse or
    create a new realized face based on the current face, removing
    from a new realized face any background-related information for
    which the current face that has the corresponding extend-* bit
    set.  For example, if the current face specifies a background,
    remove that in the new face if the extend-background bit is unset.

(4) Use the face found or made in (3) for glyphs on the rest of the
    current line.

Conversely, we could use a :no-extend attribute and/or
no-extend-background bits in the realized faces if that's simpler or
more intuitive.

martin



reply via email to

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