emacs-devel
[Top][All Lists]
Advanced

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

Re: How is current_matrix and desired_matrix be created?


From: tomas
Subject: Re: How is current_matrix and desired_matrix be created?
Date: Mon, 4 May 2020 13:49:55 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

On Mon, May 04, 2020 at 01:32:15PM +0800, Tipo Jo wrote:
> I know that window->contents is the buffer should be shown in window. The
> redisplay code use current_matrix and desired_matrix as the content should
> be shown.

(Disclaimer: I haven't read the code yet, but the very readable
comments by Gerd Moellmann)

> So what's the relationship between contents and those matrices? How does
> emacs create the two matrices from window->contents?

Current matrix is the status as is shown on screen. Buffer updates
(insert character here, change some property there, scroll, etc)
go (conceptually, see below) to desired matrix. So the differences
of both represent the work that has to be done.

At redisplay time, both are compared and some "minimal" set of
changes is calculated, which are transmitted to the "glass", as
Gerd calls that. At this point, current matrix is thrown away,
and desired matrix becomes current matrix.

The "conceptually" above hints at the fact that the desired
matrix is "sparse", i.e. where it is equal to the current matrix
it might have a "hole" (if I got things right it happens line-
wise). So at redisplay time it starts out empty (which means
"equal to current matrix").

Cheers
-- t

Attachment: signature.asc
Description: Digital signature


reply via email to

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