From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Emacs and Gnome Canvas Date: Thu, 15 Jul 2010 15:27:34 +0300 Message-ID: <8339vlgcax.fsf@gnu.org> References: <4C3CD120.4040905@swipnet.se> <5A91499A-0470-43FD-9F48-560CEAD3424C@mit.edu> <83wrsyr068.fsf@gnu.org> <83iq4hhjww.fsf@gnu.org> <87sk3lbvv0.fsf@telefonica.net> <83hbk1grnq.fsf@gnu.org> <4C3EBCDC.8050709@swipnet.se> <83d3upgmwj.fsf@gnu.org> <4C3ECB4C.6050208@swipnet.se> <83aaptgly1.fsf@gnu.org> <4C3ED4F9.4080603@swipnet.se> <83630hgi0r.fsf@gnu.org> <4C3EE8D6.3020607@swipnet.se> Reply-To: Eli Zaretskii NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE X-Trace: dough.gmane.org 1279197081 3682 80.91.229.12 (15 Jul 2010 12:31:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 15 Jul 2010 12:31:21 +0000 (UTC) Cc: ofv@wanadoo.es, emacs-devel@gnu.org To: =?UTF-8?B?SmFuIERqw6Rydg==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jul 15 14:31:19 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OZNar-0007Nq-Tu for ged-emacs-devel@m.gmane.org; Thu, 15 Jul 2010 14:31:14 +0200 Original-Received: from localhost ([127.0.0.1]:43390 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZNaq-0004Yy-WE for ged-emacs-devel@m.gmane.org; Thu, 15 Jul 2010 08:31:13 -0400 Original-Received: from [140.186.70.92] (port=58830 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OZNZM-0003F8-H8 for emacs-devel@gnu.org; Thu, 15 Jul 2010 08:29:45 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OZNZG-0000A0-9I for emacs-devel@gnu.org; Thu, 15 Jul 2010 08:29:40 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:46639) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OZNZG-00009h-2h for emacs-devel@gnu.org; Thu, 15 Jul 2010 08:29:34 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0L5L00500MID9L00@a-mtaout22.012.net.il> for emacs-devel@gnu.org; Thu, 15 Jul 2010 15:29:32 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.127.120.144]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L5L004VCMP6ZI10@a-mtaout22.012.net.il>; Thu, 15 Jul 2010 15:29:30 +0300 (IDT) In-reply-to: <4C3EE8D6.3020607@swipnet.se> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:127351 Archived-At: > Date: Thu, 15 Jul 2010 12:54:14 +0200 > From: Jan Dj=C3=A4rv > Cc: ofv@wanadoo.es, emacs-devel@gnu.org >=20 > >> As I said, it probably relies on having all text in the GtkTextB= uffer. > > > > But GtkTextBuffer needs text with attributes, right? Currently, = we > > compute these attributes as part of redisplay, and only for the > > displayed portion of the text. Using GtkTextBuffer, it seems lik= e we > > will need to have a part (or an equivalent) of that redisplay cod= e, > > which would need to recompute the attributes for _all_ of the tex= t, > > after each modification of buffer text? How can this be fast eno= ugh? > > E.g., what if I'm viewing a large log file with non-trivial > > fontification and clickable parts? >=20 > If you need to recalculate attributes for the whole buffer because = of one=20 > character was inserted, then that is what you have to do. But I do= n't think=20 > that is the case. You would have to compute the changes, and only = that and=20 > update your text buffer for the changed part. Inserting one character moves all the attributes after it by one character position, doesn't it? > 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. > 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 ru= n 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. So you win some and you lose some. Not sure about the balance. Basically, scrolling should be very fast (assuming it is done entirel= y on the Canvas side), but I'm not sure if everything else won't be significantly slower.