unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: martin rudalics <rudalics@gmx.at>
Cc: 23574@debbugs.gnu.org, john.b.mastro@gmail.com,
	cwoodbury@azavea.com, npostavs@users.sourceforge.net
Subject: bug#23574: 24.5; Overzealous underlining in emacs-nox
Date: Fri, 10 Jun 2016 17:24:39 +0300	[thread overview]
Message-ID: <83eg85p1eg.fsf@gnu.org> (raw)
In-Reply-To: <575AC7CD.1030506@gmx.at> (message from martin rudalics on Fri, 10 Jun 2016 15:59:41 +0200)

> 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	other threads:[~2016-06-10 14:24 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-18 17:03 bug#23574: 24.5; Overzealous underlining in emacs-nox Colin Woodbury
2016-05-30 15:04 ` Colin Woodbury
2016-06-04  7:48   ` Eli Zaretskii
     [not found]     ` <CAHuwsfihHJ8WHwmHvMDF7Ynns4YOJSKEEbjhpbYrw0V=5aYXEQ@mail.gmail.com>
2016-06-04 16:20       ` Eli Zaretskii
2016-06-04 21:37         ` John Mastro
2016-06-05 15:54           ` Eli Zaretskii
2016-06-05 17:05             ` Noam Postavsky
2016-06-05 17:56               ` Eli Zaretskii
2016-06-05 18:20                 ` Colin Woodbury
2016-06-05 18:36                   ` Eli Zaretskii
2016-06-05 19:13                 ` Noam Postavsky
2016-06-06  2:27                   ` Eli Zaretskii
2016-06-06 11:42                     ` Noam Postavsky
2016-06-06 15:04                       ` Eli Zaretskii
2016-06-06 16:54                         ` martin rudalics
2016-06-06 18:25                           ` Colin Woodbury
2016-06-06 19:18                             ` Eli Zaretskii
2016-06-07  0:18                               ` Noam Postavsky
2016-06-07 15:55                                 ` Eli Zaretskii
2016-06-08  2:52                                   ` Noam Postavsky
2016-06-06 18:55                           ` Eli Zaretskii
2016-06-07  9:10                             ` martin rudalics
2016-06-07 15:50                               ` Eli Zaretskii
2016-06-08  6:33                                 ` martin rudalics
2016-06-08 17:05                                   ` Eli Zaretskii
2016-06-09  8:38                                     ` martin rudalics
2016-06-09 12:26                                       ` Eli Zaretskii
2016-06-10  7:16                                         ` martin rudalics
2016-06-10  8:10                                           ` Eli Zaretskii
2016-06-10  8:24                                             ` martin rudalics
2016-06-10  9:50                                               ` Eli Zaretskii
2016-06-10 13:59                                                 ` martin rudalics
2016-06-10 14:24                                                   ` Eli Zaretskii [this message]
2019-10-21 11:49 ` Ergus via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-08  5:32   ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83eg85p1eg.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=23574@debbugs.gnu.org \
    --cc=cwoodbury@azavea.com \
    --cc=john.b.mastro@gmail.com \
    --cc=npostavs@users.sourceforge.net \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).