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: martin rudalics
Subject: bug#23574: 24.5; Overzealous underlining in emacs-nox
Date: Fri, 10 Jun 2016 15:59:41 +0200

>> I meant the overhead for adding the text property to every newline
>> character in the buffer.
>
> You mean, memory overhead?  I don't think it's significant.

I meant the time overhead to find each newline (or the character before
it) in the buffer and put the property on it.

> 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
      ...

?

>> 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.

>>   > 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;

> Or maybe I don't understand
> the problem you are trying to solve.

I want to put a mini-frame in the empty space on the right side of a L2R
window and accordingly on the left side of a R2L window.  I more or less
know how to do the former but have not yet tried the latter.

martin





reply via email to

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