bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#23574: 24.5; Overzealous underlining in emacs-nox


From: Eli Zaretskii
Subject: bug#23574: 24.5; Overzealous underlining in emacs-nox
Date: Fri, 10 Jun 2016 17:24:39 +0300

> Date: Fri, 10 Jun 2016 15:59:41 +0200
> From: martin rudalics <rudalics@gmx.at>
> CC: npostavs@users.sourceforge.net, 23574@debbugs.gnu.org, 
>  john.b.mastro@gmail.com, cwoodbury@azavea.com
> 
> I meant the time overhead to find each newline (or the character before
> it) in the buffer and put the property on it.

If they decide to do this, they get what they deserve, no?

>  > Yes, a few.  Look at the comments at the beginning of 'struct glyph'
>  > definition in dispextern.h.
> 
> These ones
> 
>        glyph standing for newline at end of line    0
>        empty space after the end of the line       -1
>        overlay arrow on a TTY                      -1
>        ...
> 
> ?

Yes.

>  >> Is there any other way to get the size of the empty space after text
>  >> on each row?
>  >
>  > "Other way"? other than what?
> 
> Other than subtracting the pixel_width from the window text width.  I
> obviously want to just retrieve a calculated value, not recalculate it.

I guess that's the natural way, yes.  Of course, you can only use it
when the display is up to date, otherwise the glyph matrix cannot be
trusted, and you need the move_it_* functions instead.

>  >>   > row->pixel_width is computed in compute_line_metrics,
>  >>   > after the stretch glyph (and any other glyphs needed for line display)
>  >>   > were already inserted.  compute_line_metrics doesn't care about what
>  >>   > glyphs are there, it counts them all.
>  >>
>  >> Hmm... How would I get the width of that stretch glyph then?
>  >
>  > It's recorded in the glyph's pixel_width.
> 
> So for R2L text to get the width of the empty space on the left of a row
> I have to calculate the pixel_width of the leftmost character on that
> row.  Something like the following for a given row?
> 
>    struct glyph *glyph = row->glyphs[TEXT_AREA];
>    width = glyph->pixel_width;

Yes, modulo the usual caveats of hscroll etc.





reply via email to

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