all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Gerd Möllmann" <gerd.moellmann@gmail.com>
To: Akib Azmain Turja <akib@disroot.org>
Cc: emacs-devel@gnu.org
Subject: Re: Questions on glyph matrices used for rendering frame in terminal
Date: Tue, 5 Jul 2022 08:24:19 +0200	[thread overview]
Message-ID: <5A1712BC-CE33-4013-9F5C-2F4668147884@gmail.com> (raw)
In-Reply-To: <87y1x8kwwa.fsf@disroot.org>


[-- Attachment #1.1: Type: text/plain, Size: 2173 bytes --]



> On 2022-07-05,, at 6:26 , Akib Azmain Turja <akib@disroot.org> wrote:
> 
> Gerd Möllmann <gerd.moellmann@gmail.com <mailto:gerd.moellmann@gmail.com>> writes:
> 
>>>> 
>>> 1. What's the purpose of the following in
>>> build_frame_matrix_from_leaf_window? "frame_row->used[TEXT_AREA]" will
>>> always end up being equal to "window_matrix->matrix_w" after processing
>>> the right-most window of the row.
>> 
>> I don't understand. What about the /matrix_x/ + matrix_w below?
> 
> Oh sorry, I meant "it will end up being equal to
> *frame_matrix->matrix_w*".

Probably.  I don't remember what I thought exactly when I wrote that code.  But, a few lines above what you mentioned there is

      /* Fill up the frame row with spaces up to the left margin of the
	 window row.  */
      fill_up_frame_row_with_spaces (frame_row, window_matrix->matrix_x);

In general, I prefer code that relies on what is known locally, instead of what is known more globally, so to speak.  (We have too much of that already in Emacs.)  Maybe that was the reason.

In this case, because of the fill_up..., we know locally that the frame row is filled up to matrix_x of the window, so...

>> In the TTY case, the glyph memory (struct glyph) for desired window matrices is sub-allocated from the glyph memory that is allocated for the frame. The glyph_row structures on the other hand are different between windows and frame. Clear_glyph_row doesn't affect the glyph memory, only the glyh_rows.
> 
> I can't understand. What does that glyph memory contain? Individual
> glyphs or the glyph matrix? If the glyph memory holds the glyph matrix,
> then IIUC glyph row is a row of that glyph matrix, so why clearing that
> doesn't affect the glyph matrix?

It does affect a struct glyph_matrix, indirectly, because a struct glyph_row used by it is memset to zeros.

But no struct glyph is modified by that.  Please take a look at clear_glyph_row.  Only bookkeeping information is cleared. The struct glyph_row points to struct glyphs, but the glyphs themselves are not changed.

Have you read dispextern.h?  There are some comments that might be helpful.



[-- Attachment #1.2: Type: text/html, Size: 4219 bytes --]

[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 874 bytes --]

  reply	other threads:[~2022-07-05  6:24 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-04 19:37 Questions on glyph matrices used for rendering frame in terminal Gerd Möllmann
2022-07-05  2:49 ` Po Lu
2022-07-05  4:26 ` Akib Azmain Turja
2022-07-05  6:24   ` Gerd Möllmann [this message]
2022-07-05  9:03     ` Akib Azmain Turja
  -- strict thread matches above, loose matches on Subject: below --
2022-07-04 17:26 Akib Azmain Turja

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

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

  git send-email \
    --in-reply-to=5A1712BC-CE33-4013-9F5C-2F4668147884@gmail.com \
    --to=gerd.moellmann@gmail.com \
    --cc=akib@disroot.org \
    --cc=emacs-devel@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.