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: 16691@debbugs.gnu.org, lekktu@gmail.com
Subject: bug#16691: 24.3.50; emacs_backtrace.txt
Date: Mon, 10 Feb 2014 19:42:46 +0200	[thread overview]
Message-ID: <83wqh2uand.fsf@gnu.org> (raw)
In-Reply-To: <52F88A69.3060104@gmx.at>

> Date: Mon, 10 Feb 2014 09:14:33 +0100
> From: martin rudalics <rudalics@gmx.at>
> CC: lekktu@gmail.com, drew.adams@oracle.com, 16691@debbugs.gnu.org
> 
>  >> - int x, y: Where and how are these set for a particular row (including
>  >>    header- and mode-line) and when and how are these eventually consumed?
>  >>    This is the greatest mystery for me so far.
>  >
>  > They are assigned in display_line and display_string.  Examples from
>  > display_line:
>  >
>  >   row->y = it->current_y;
> 
> Does the value set here account for extra_line_spacing or is the latter
> (as I presume) handled separately?

The y-coordinate of the row does include the extra_line_spacing, it
must.  More accurately, the next row gets its y coordinate increased
due to extra line spacing of the previous row.

We calculate the value inside PRODUCE_GLYPHS (which expands into a
call to x_produce_glyphs in a GUI session), and then enlarge
it->descent by the computed value.  Then display_line, which calls
PRODUCE_GLYPHS, copies these values from 'struct it' to the glyph row,
updates row->height accordingly, and uses row->height to increment
row->y when it advances to the next row (see near the end of
display_line).

>  >   [...]
>  >   if (it->current_x - it->pixel_width < it->first_visible_x)
>  >     row->x = x - it->first_visible_x;
>  >
>  > Mode line and header line are generated from strings, so look in
>  > display_mode_line and display_string.
> 
> I tried that but never found anything useful there.  I suppose the
> header line has current_y always set to 0.  But the mode line?

The magic hides in init_iterator, which is called by display_mode_line:

  /* Use one of the mode line rows of W's desired matrix if
     appropriate.  */
  if (row == NULL)
    {
      if (base_face_id == MODE_LINE_FACE_ID
	  || base_face_id == MODE_LINE_INACTIVE_FACE_ID)
	row = MATRIX_MODE_LINE_ROW (w->desired_matrix);
      else if (base_face_id == HEADER_LINE_FACE_ID)
	row = MATRIX_HEADER_LINE_ROW (w->desired_matrix);
    }

IOW, we rely on the fact that the header line is always the first row,
and the mode line is the last one.

>  > Not sure what you mean by "consumed".  Consumed by whom and for what
>  > purposes?
> 
> I suppose when exposing the window (another part of Emacs display which
> I don't understand yet).  What would current_y else be used for?

Why are we suddenly talking about current_y?  There's no such member
in the glyph_row structure.

If you meant row->y, then it is used in many different places,
including the display back-end, various redisplay optimizations (which
compare rows of current and desired matrices), functions that find
buffer/string positions that correspond to a mouse click, and move_it_*
functions which simulate display, to name just a few.

If you meant something else, please elaborate.





  reply	other threads:[~2014-02-10 17:42 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-08 17:30 bug#16691: 24.3.50; emacs_backtrace.txt Drew Adams
2014-02-08 19:22 ` Juanma Barranquero
2014-02-08 19:34   ` Eli Zaretskii
2014-02-08 20:06     ` martin rudalics
2014-02-08 20:31       ` Eli Zaretskii
2014-02-08 20:40         ` Glenn Morris
2014-02-08 20:55           ` Eli Zaretskii
2014-02-08 23:25             ` Glenn Morris
2014-02-09 11:04         ` martin rudalics
2014-02-09 16:30           ` Eli Zaretskii
2014-02-09 18:58             ` martin rudalics
2014-02-09 20:20               ` Eli Zaretskii
2014-02-10  8:14                 ` martin rudalics
2014-02-10 17:42                   ` Eli Zaretskii [this message]
2014-02-10 18:35                     ` martin rudalics
2014-02-10 18:44                       ` Eli Zaretskii
2015-12-26 13:26                         ` Lars Ingebrigtsen
2015-12-26 13:38                           ` Eli Zaretskii

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=83wqh2uand.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=16691@debbugs.gnu.org \
    --cc=lekktu@gmail.com \
    --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).