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: Sat, 17 Jul 2010 10:27:32 +0300 Message-ID: <837hkuftzv.fsf@gnu.org> References: <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> <8339vlgcax.fsf@gnu.org> <87fwzkbzg8.fsf@telefonica.net> <877hkwag6y.fsf@stupidchicken.com> <877hkwbth6.fsf@telefonica.net> <83pqyofzdg.fsf@gnu.org> <8739vkbpq5.fsf@telefonica.net> <83oce8fwlq.fsf@gnu.org> <87tyo0a11p.fsf@telefonica.net> <83k4ovg7rn.fsf@gnu.org> <87630fa4j8.fsf@telefonica.net> <83d3unfo92.fsf@gnu.org> <87wrsv8l6u.fsf@telefonica.net> <83bpa7feta.fsf@gnu.org> <87zkxr6s34.fsf@telefonica.net> 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 1279351796 22156 80.91.229.12 (17 Jul 2010 07:29:56 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 17 Jul 2010 07:29:56 +0000 (UTC) Cc: emacs-devel@gnu.org To: =?utf-8?Q?=C3=93scar_Fuentes?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Jul 17 09:29:55 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 1Oa1qM-0008NC-LF for ged-emacs-devel@m.gmane.org; Sat, 17 Jul 2010 09:29:54 +0200 Original-Received: from localhost ([127.0.0.1]:57501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oa1qL-0002Wt-P0 for ged-emacs-devel@m.gmane.org; Sat, 17 Jul 2010 03:29:53 -0400 Original-Received: from [140.186.70.92] (port=51080 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oa1oR-0001rm-Ks for emacs-devel@gnu.org; Sat, 17 Jul 2010 03:27:56 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oa1oQ-0003GJ-GK for emacs-devel@gnu.org; Sat, 17 Jul 2010 03:27:55 -0400 Original-Received: from mtaout21.012.net.il ([80.179.55.169]:48174) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Oa1oQ-0003GF-8C for emacs-devel@gnu.org; Sat, 17 Jul 2010 03:27:54 -0400 Original-Received: from conversion-daemon.a-mtaout21.012.net.il by a-mtaout21.012.net.il (HyperSendmail v2007.08) id <0L5O00D00XY6L000@a-mtaout21.012.net.il> for emacs-devel@gnu.org; Sat, 17 Jul 2010 10:27:33 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([77.127.120.144]) by a-mtaout21.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0L5O00D54Y1WA220@a-mtaout21.012.net.il>; Sat, 17 Jul 2010 10:27:33 +0300 (IDT) In-reply-to: <87zkxr6s34.fsf@telefonica.net> 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:127490 Archived-At: > From: =C3=93scar Fuentes > Date: Fri, 16 Jul 2010 23:21:19 +0200 >=20 > > How can a display engine has its memory management isolated, if i= t > > needs to call Lisp primitives to access Lisp objects and operate = on > > them? Just a random example: when you bump into a buffer positio= n > > that is covered by a text property or overlay, you need to call a > > function that returns that property's value, which requires a cal= l > > such as > > > > prop =3D get_char_property_and_overlay (make_number (position->= charpos), > > =09=09=09=09=09Qdisplay, object, &overlay); > > > > The call to make_number here creates a Lisp object. > > get_char_property_and_overlay is one of the few basic APIs the di= splay > > engine calls to find what are the text properties at a specific b= uffer > > or string position. >=20 > For this especific example, I see no problem. The display backend w= ill > obtain `prop' as you say, gather the needed information and dispose > `prop' immediately, following whatever Emacs protocol is required. `prop' is a Lisp object. (So are `object' and `overlay'.) Lisp objects don't need to be disposed of, they are garbage-collected by the GC. But GC, too, might need to be examined for possible incompatibilities with C++ memory management. As another example, consider constructing the mode line. The mode-line spec is nowadays full of Lisp strings and text properties, and the code which handles that in the current engine calls make_string quite a lot. make_string creates a Lisp string and triggers all kinds of behind-the-scenes reshuffling of string and buffer text that a normal C/C++ program does not expect. Anyway, what I tried to show was that manipulating Lisp objects is an integral part of any Emacs display engine; you cannot hope to sideste= p it. Therefore, it is important to have a plan and infrastructure for dealing with it, because otherwise you will need to change your implementation each time you bump into an example you didn't think about. > I want to use Qt. What for?