From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: how to find out when display property is deleted in C? Date: Mon, 12 May 2008 12:57:23 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1210611461 9731 80.91.229.12 (12 May 2008 16:57:41 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 12 May 2008 16:57:41 +0000 (UTC) Cc: emacs-devel@gnu.org To: joakim@verona.se Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon May 12 18:58:17 2008 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.50) id 1JvbLr-0000sl-R3 for ged-emacs-devel@m.gmane.org; Mon, 12 May 2008 18:58:16 +0200 Original-Received: from localhost ([127.0.0.1]:43779 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JvbL8-000283-Ih for ged-emacs-devel@m.gmane.org; Mon, 12 May 2008 12:57:30 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JvbL4-00027L-AL for emacs-devel@gnu.org; Mon, 12 May 2008 12:57:26 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JvbL2-00026z-Qi for emacs-devel@gnu.org; Mon, 12 May 2008 12:57:25 -0400 Original-Received: from [199.232.76.173] (port=59149 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JvbL2-00026w-K6 for emacs-devel@gnu.org; Mon, 12 May 2008 12:57:24 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:40393) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JvbL2-0004rL-8E for emacs-devel@gnu.org; Mon, 12 May 2008 12:57:24 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AocDADMUKEjO+JgrdGdsb2JhbACBU5A6ASeZGA X-IronPort-AV: E=Sophos;i="4.27,474,1204520400"; d="scan'208";a="20426769" Original-Received: from smtp.pppoe.ca (HELO smtp.teksavvy.com) ([65.39.196.238]) by ironport2-out.teksavvy.com with ESMTP; 12 May 2008 12:57:23 -0400 Original-Received: from pastel.home ([206.248.152.43]) by smtp.teksavvy.com (Internet Mail Server v1.0) with ESMTP id SVR62523; Mon, 12 May 2008 12:57:23 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id 39F39801D; Mon, 12 May 2008 12:57:23 -0400 (EDT) In-Reply-To: (joakim@verona.se's message of "Mon, 12 May 2008 16:58:29 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. 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:97039 Archived-At: >>> How do I find out when a display property is deleted in C? >> You don't/can't. > Hmm. >>> In the xwidget patch I need to delete the corresponding xwdiget when >>> the display property is deleted. >> What happens if the display property is later re-added? >> If that situations is not problematic, then you can keep your xwidgets >> in a cache which you can flush every once in a while. > But I need to remove the gtk widget from display the precise moment the > display property goes away, or there will be very awkward display bugs. how do you deal with the case where the widget is scrolled out of view? > I could maybe have a new phase at the end of emacs redisplay, where all > xwidgets which haven't been drawn in this redisplay will be deleted. Or marked as "out of view". Yes, that sounds sensible. >> Also what happens if the same display property gets added at two places >> (either in the same buffer or in different buffers)? > They cant be the same, because I require a unique id for every xwidget > in the display property: > (put-text-property (point) (+ 1 (point)) 'display '(xwidget :xwidget-id 3 :type 3 :title "3" :width 400 :height 200)) > adding the same id twice is an error, as currently designed. Is this error properly caught and signalled to the user? Stefan