[Top][All Lists]

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

Re: Placing eol glyph (buffer-display-table) before an overlay after-str

From: Eli Zaretskii
Subject: Re: Placing eol glyph (buffer-display-table) before an overlay after-string.
Date: Sat, 12 Aug 2017 09:56:26 +0300

> Date: Fri, 11 Aug 2017 23:14:31 -0700
> From: Keith David Bershatsky <address@hidden>
> Is it feasible to reverse the order such that the eol glyph is laid before 
> the overlays containing the after-string property?

Not really.  The Emacs display engine considers a screen line ended at
the last glyph before the newline, disregarding the source of that
newline, which could be buffer text, a display or overlay string, or a
display table.  When the display engine finds itself at the end of a
screen line, it performs a set of bookkeeping operations and decisions
that are important for text layout, and must be done immediately prior
to the layout of the next screen line.  Displaying anything after that
bookkeeping, or somehow deferring this bookkeeping to later, would
need extensive changes in what is already very complex piece of code,
which handles several important issues, like
overflow-newline-into-fringe.  Current code assumes that no glyphs are
produced on the current screen line after the end-of-line was

> A hint as to the locations (in the C code) where I would start working on 
> reversing the order would be greatly appreciated.

There are 2 places: one in display_line, the other
move_it_in_display_line_to and move_it_to.  In all of those places,
look for uses of the macro ITERATOR_AT_END_OF_LINE_P.

Once again, I advise against such changes.

> If there is a better way to handle this than trying to reverse the order in 
> which things are happening, any insight would be helpful.

Something like the workaround you use now:

> WORKAROUND:  I have been using a custom XPM image of a pilcrow that is the 
> beginning of the after-string, and I change its coloration 
> (foreground/background) as needed.  The problem with this approach is that 
> the XPM does not look as good as a native eol glpyh, and the XPM would need 
> to be adjusted depending upon the font and size of the font.

Why not use the real pilcrow character, e.g. as display string on the
first character of your overlay string?

reply via email to

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