emacs-devel
[Top][All Lists]
Advanced

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

Re: Emacs and Gnome Canvas


From: Jan Djärv
Subject: Re: Emacs and Gnome Canvas
Date: Thu, 15 Jul 2010 16:24:27 +0200
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; sv-SE; rv:1.9.2.4) Gecko/20100608 Thunderbird/3.1



Eli Zaretskii skrev 2010-07-15 14.27:

Inserting one character moves all the attributes after it by one
character position, doesn't it?


Yes, but that is something the Canvas can do by itself.

You wouldn't have to do redisplay all the time just in case
something changed (like now)

?? We don't _do_ redisplay now all the time.  We _enter_ redisplay
every time Emacs is idle, but if nothing's changed, we exit it almost
immediately, after testing a bunch of flags.


That is the same thing to me. With the Canvas design, you would not need to check, once it is done Canvas does all repainting as needed.

if you propagated the change the whole way when it happened.  This
is a big difference on how Emacs works now.

The way it looks, parts of the current redisplay code will have to run
whenever there's a change, any change, to some buffer or some related
data structure.  If the parts affected by these changes are not
displayed, or become not displayed before the GTK+ idle handlers run,
propagating those changes would be a waste of CPU cycles.

No, they need to be done anyway sometime, it is no waste. If the text isn't displayed, the attributes are nvertheless set up correctly for the time when the text is to be displayed later (by scrolling for example). The Canvas just have to scroll things in view and the display is up to date. If they never come into view, then there is a waste of CPU cycles.

Now in Emacs you postpone the update until it is in view. With the canvas you would do the update at once, but you then don't have to bother with it anymore, for example if it comes in to view later. It should be about the same CPU-cycles, just distributed differently.


So you win some and you lose some.  Not sure about the balance.
Basically, scrolling should be very fast (assuming it is done entirely
on the Canvas side), but I'm not sure if everything else won't be
significantly slower.


If done right, I don't think it would be slower. But someone has to do the code before we know.

        Jan D.




reply via email to

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