From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thorsten Jolitz Subject: Re: Circular lists/shared structures in org-element parse-tree Date: Fri, 28 Jun 2013 23:59:27 +0200 Message-ID: <871u7laocg.fsf@gmail.com> References: <87a9ma9fra.fsf@gmail.com> <877ghex8y1.fsf@tanger.home> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:35117) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Usghi-00047l-9W for emacs-orgmode@gnu.org; Fri, 28 Jun 2013 17:59:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Usghh-0007K6-3P for emacs-orgmode@gnu.org; Fri, 28 Jun 2013 17:59:42 -0400 Received: from plane.gmane.org ([80.91.229.3]:39377) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Usghg-0007Jb-Sj for emacs-orgmode@gnu.org; Fri, 28 Jun 2013 17:59:41 -0400 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Usghd-0007TC-B4 for emacs-orgmode@gnu.org; Fri, 28 Jun 2013 23:59:37 +0200 Received: from e178117198.adsl.alicedsl.de ([85.178.117.198]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 28 Jun 2013 23:59:37 +0200 Received: from tjolitz by e178117198.adsl.alicedsl.de with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 28 Jun 2013 23:59:37 +0200 List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Daimrod writes: > Thorsten Jolitz writes: [...] >> but when processing the parse tree as a list in elisp, how can I >> detect the fact that >> >> ,------------ >> | :parent #2# >> `------------ >> >> refers to >> >> ,----------------- >> | #2=(org-data nil >> `----------------- >> >> i.e. points back to an already existing structure? > > AFAIK you have to track all pointers inspected to see if one has already > be seen. > > For example, I've implemented a version of equal[1] to compare this kind > of lists (to add tests to org-sync). > > [1] > https://github.com/daimrod/Emacs-config/blob/master/elisp/dmd-utils.el#L25 Oh my ... I knew this would complicate my life a bit ... Thanks for the link, this example function is indeed very helpful. -- cheers, Thorsten